/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const ConnectorSettingType = { Text: "text", Checkbox: "checkbox", Tel: "tel", Email: "email", Url: "url", Textarea: "textarea", Select: "select", FilteredSelect: "filtered-select", MultiSelect: "multi-select", Datetime: "datetime", Date: "date", Time: "time", Number: "number", Password: "password", } as const; export type ConnectorSettingType = OpenEnum; export type ConnectorSetting = { id?: string | undefined; label?: string | undefined; type?: ConnectorSettingType | undefined; /** * Whether a value is required for the connection to work. Required settings are always shown in Vault and cannot be hidden by an application. */ required?: boolean | undefined; /** * Whether a value is required before the connection can be authorized. These settings are always shown in Vault and cannot be hidden by an application. */ requiredForAuthorization?: boolean | undefined; /** * Whether the connector hides this setting from the Vault connection form for every application. */ hidden?: boolean | undefined; /** * Help text shown under the setting in the Vault connection form. May contain `${integrationSettings.}` placeholders that are filled in from the application's integration settings when the Vault form is built. */ description?: string | undefined; }; /** @internal */ export const ConnectorSettingType$inboundSchema: z.ZodType< ConnectorSettingType, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(ConnectorSettingType) ); /** @internal */ export const ConnectorSetting$inboundSchema: z.ZodType< ConnectorSetting, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), label: types.optional(types.string()), type: types.optional(ConnectorSettingType$inboundSchema), required: types.optional(types.boolean()), required_for_authorization: types.optional(types.boolean()), hidden: types.optional(types.boolean()), description: types.optional(types.string()), }).transform((v) => { return remap$(v, { "required_for_authorization": "requiredForAuthorization", }); }) ); export function connectorSettingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorSetting$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorSetting' from JSON`, ); }