/* * 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 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 = { /** * 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; /** * 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 type VaultConnectionsUpdateRequest$Outbound = { consumerId?: string | undefined; appId?: string | undefined; service_id: string; unified_api: string; Connection: components.ConnectionInput$Outbound; }; /** @internal */ export const VaultConnectionsUpdateRequest$outboundSchema: z.ZodType< VaultConnectionsUpdateRequest$Outbound, z.ZodTypeDef, VaultConnectionsUpdateRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ consumerId: z.string().optional(), appId: z.string().optional(), serviceId: z.string(), unifiedApi: z.string(), connection: components.ConnectionInput$outboundSchema, }).transform((v) => { return remap$(v, { serviceId: "service_id", unifiedApi: "unified_api", connection: "Connection", }); }) ); export function vaultConnectionsUpdateRequestToJSON( vaultConnectionsUpdateRequest: VaultConnectionsUpdateRequest, ): string { return JSON.stringify( VaultConnectionsUpdateRequest$outboundSchema.parse( vaultConnectionsUpdateRequest, ), ); } /** @internal */ export const VaultConnectionsUpdateResponse$inboundSchema: z.ZodType< VaultConnectionsUpdateResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateConnectionResponse: types.optional( components.UpdateConnectionResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateConnectionResponse": "updateConnectionResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function vaultConnectionsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConnectionsUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConnectionsUpdateResponse' from JSON`, ); }