/* * 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 VaultConnectionsUpdateGlobals = { /** * 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 VaultConnectionsUpdateRequest = { /** * Service ID of the resource to return */ serviceId: string; /** * Unified API */ unifiedApi: string; /** * Fields that need to be updated on the resource */ connection: components.ConnectionInput; }; export type VaultConnectionsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Connection updated */ updateConnectionResponse?: components.UpdateConnectionResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const VaultConnectionsUpdateGlobals$inboundSchema: z.ZodType< VaultConnectionsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type VaultConnectionsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const VaultConnectionsUpdateGlobals$outboundSchema: z.ZodType< VaultConnectionsUpdateGlobals$Outbound, z.ZodTypeDef, VaultConnectionsUpdateGlobals > = 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 VaultConnectionsUpdateGlobals$ { /** @deprecated use `VaultConnectionsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = VaultConnectionsUpdateGlobals$inboundSchema; /** @deprecated use `VaultConnectionsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = VaultConnectionsUpdateGlobals$outboundSchema; /** @deprecated use `VaultConnectionsUpdateGlobals$Outbound` instead. */ export type Outbound = VaultConnectionsUpdateGlobals$Outbound; } export function vaultConnectionsUpdateGlobalsToJSON( vaultConnectionsUpdateGlobals: VaultConnectionsUpdateGlobals, ): string { return JSON.stringify( VaultConnectionsUpdateGlobals$outboundSchema.parse( vaultConnectionsUpdateGlobals, ), ); } export function vaultConnectionsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsUpdateGlobals' from JSON`, ); } /** @internal */ export const VaultConnectionsUpdateRequest$inboundSchema: z.ZodType< VaultConnectionsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ service_id: z.string(), unified_api: z.string(), Connection: components.ConnectionInput$inboundSchema, }).transform((v) => { return remap$(v, { "service_id": "serviceId", "unified_api": "unifiedApi", "Connection": "connection", }); }); /** @internal */ export type VaultConnectionsUpdateRequest$Outbound = { service_id: string; unified_api: string; Connection: components.ConnectionInput$Outbound; }; /** @internal */ export const VaultConnectionsUpdateRequest$outboundSchema: z.ZodType< VaultConnectionsUpdateRequest$Outbound, z.ZodTypeDef, VaultConnectionsUpdateRequest > = z.object({ serviceId: z.string(), unifiedApi: z.string(), connection: components.ConnectionInput$outboundSchema, }).transform((v) => { return remap$(v, { serviceId: "service_id", unifiedApi: "unified_api", connection: "Connection", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultConnectionsUpdateRequest$ { /** @deprecated use `VaultConnectionsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = VaultConnectionsUpdateRequest$inboundSchema; /** @deprecated use `VaultConnectionsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = VaultConnectionsUpdateRequest$outboundSchema; /** @deprecated use `VaultConnectionsUpdateRequest$Outbound` instead. */ export type Outbound = VaultConnectionsUpdateRequest$Outbound; } export function vaultConnectionsUpdateRequestToJSON( vaultConnectionsUpdateRequest: VaultConnectionsUpdateRequest, ): string { return JSON.stringify( VaultConnectionsUpdateRequest$outboundSchema.parse( vaultConnectionsUpdateRequest, ), ); } export function vaultConnectionsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsUpdateRequest' from JSON`, ); } /** @internal */ export const VaultConnectionsUpdateResponse$inboundSchema: z.ZodType< VaultConnectionsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateConnectionResponse: components.UpdateConnectionResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateConnectionResponse": "updateConnectionResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type VaultConnectionsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateConnectionResponse?: | components.UpdateConnectionResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const VaultConnectionsUpdateResponse$outboundSchema: z.ZodType< VaultConnectionsUpdateResponse$Outbound, z.ZodTypeDef, VaultConnectionsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateConnectionResponse: components.UpdateConnectionResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateConnectionResponse: "UpdateConnectionResponse", 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 VaultConnectionsUpdateResponse$ { /** @deprecated use `VaultConnectionsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = VaultConnectionsUpdateResponse$inboundSchema; /** @deprecated use `VaultConnectionsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = VaultConnectionsUpdateResponse$outboundSchema; /** @deprecated use `VaultConnectionsUpdateResponse$Outbound` instead. */ export type Outbound = VaultConnectionsUpdateResponse$Outbound; } export function vaultConnectionsUpdateResponseToJSON( vaultConnectionsUpdateResponse: VaultConnectionsUpdateResponse, ): string { return JSON.stringify( VaultConnectionsUpdateResponse$outboundSchema.parse( vaultConnectionsUpdateResponse, ), ); } export function vaultConnectionsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsUpdateResponse' from JSON`, ); }