/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AuthenticatorConfluenceConnection, AuthenticatorConfluenceConnection$inboundSchema, AuthenticatorConfluenceConnection$Outbound, AuthenticatorConfluenceConnection$outboundSchema, } from "./authenticatorconfluenceconnection.js"; import { AuthenticatorDropboxConnection, AuthenticatorDropboxConnection$inboundSchema, AuthenticatorDropboxConnection$Outbound, AuthenticatorDropboxConnection$outboundSchema, } from "./authenticatordropboxconnection.js"; import { AuthenticatorGmailConnection, AuthenticatorGmailConnection$inboundSchema, AuthenticatorGmailConnection$Outbound, AuthenticatorGmailConnection$outboundSchema, } from "./authenticatorgmailconnection.js"; import { AuthenticatorGoogleDriveConnection, AuthenticatorGoogleDriveConnection$inboundSchema, AuthenticatorGoogleDriveConnection$Outbound, AuthenticatorGoogleDriveConnection$outboundSchema, } from "./authenticatorgoogledriveconnection.js"; import { AuthenticatorHubspotConnection, AuthenticatorHubspotConnection$inboundSchema, AuthenticatorHubspotConnection$Outbound, AuthenticatorHubspotConnection$outboundSchema, } from "./authenticatorhubspotconnection.js"; import { AuthenticatorJiraConnection, AuthenticatorJiraConnection$inboundSchema, AuthenticatorJiraConnection$Outbound, AuthenticatorJiraConnection$outboundSchema, } from "./authenticatorjiraconnection.js"; import { AuthenticatorNotionConnection, AuthenticatorNotionConnection$inboundSchema, AuthenticatorNotionConnection$Outbound, AuthenticatorNotionConnection$outboundSchema, } from "./authenticatornotionconnection.js"; import { AuthenticatorOnedriveConnection, AuthenticatorOnedriveConnection$inboundSchema, AuthenticatorOnedriveConnection$Outbound, AuthenticatorOnedriveConnection$outboundSchema, } from "./authenticatoronedriveconnection.js"; import { AuthenticatorSalesforceConnection, AuthenticatorSalesforceConnection$inboundSchema, AuthenticatorSalesforceConnection$Outbound, AuthenticatorSalesforceConnection$outboundSchema, } from "./authenticatorsalesforceconnection.js"; import { AuthenticatorSharepointConnection, AuthenticatorSharepointConnection$inboundSchema, AuthenticatorSharepointConnection$Outbound, AuthenticatorSharepointConnection$outboundSchema, } from "./authenticatorsharepointconnection.js"; import { AuthenticatorSlackConnection, AuthenticatorSlackConnection$inboundSchema, AuthenticatorSlackConnection$Outbound, AuthenticatorSlackConnection$outboundSchema, } from "./authenticatorslackconnection.js"; import { MediaModeParam, MediaModeParam$inboundSchema, MediaModeParam$Outbound, MediaModeParam$outboundSchema, } from "./mediamodeparam.js"; export type CreateAuthenticatorConnectionMetadata = | string | number | number | boolean | Array; export type CreateAuthenticatorConnectionConnection = | AuthenticatorConfluenceConnection | AuthenticatorDropboxConnection | AuthenticatorGmailConnection | AuthenticatorGoogleDriveConnection | AuthenticatorHubspotConnection | AuthenticatorJiraConnection | AuthenticatorNotionConnection | AuthenticatorOnedriveConnection | AuthenticatorSalesforceConnection | AuthenticatorSharepointConnection | AuthenticatorSlackConnection; export type CreateAuthenticatorConnection = { partitionStrategy: MediaModeParam; partition?: string | null | undefined; pageLimit?: number | null | undefined; config?: { [k: string]: any } | null | undefined; /** * Metadata for the document. Keys must be strings. Values may be strings, numbers, booleans, or lists of strings. Numbers may be integers or floating point and will be converted to 64 bit floating point. 1000 total values are allowed. Each item in an array counts towards the total. The following keys are reserved for internal use: `document_id`, `document_type`, `document_source`, `document_name`, `document_uploaded_at`, `start_time`, `end_time`, `chunk_content_type`. */ metadata?: | { [k: string]: string | number | number | boolean | Array } | undefined; connection: | AuthenticatorConfluenceConnection | AuthenticatorDropboxConnection | AuthenticatorGmailConnection | AuthenticatorGoogleDriveConnection | AuthenticatorHubspotConnection | AuthenticatorJiraConnection | AuthenticatorNotionConnection | AuthenticatorOnedriveConnection | AuthenticatorSalesforceConnection | AuthenticatorSharepointConnection | AuthenticatorSlackConnection; }; /** @internal */ export const CreateAuthenticatorConnectionMetadata$inboundSchema: z.ZodType< CreateAuthenticatorConnectionMetadata, z.ZodTypeDef, unknown > = z.union([ z.string(), z.number().int(), z.number(), z.boolean(), z.array(z.string()), ]); /** @internal */ export type CreateAuthenticatorConnectionMetadata$Outbound = | string | number | number | boolean | Array; /** @internal */ export const CreateAuthenticatorConnectionMetadata$outboundSchema: z.ZodType< CreateAuthenticatorConnectionMetadata$Outbound, z.ZodTypeDef, CreateAuthenticatorConnectionMetadata > = z.union([ z.string(), z.number().int(), z.number(), z.boolean(), z.array(z.string()), ]); export function createAuthenticatorConnectionMetadataToJSON( createAuthenticatorConnectionMetadata: CreateAuthenticatorConnectionMetadata, ): string { return JSON.stringify( CreateAuthenticatorConnectionMetadata$outboundSchema.parse( createAuthenticatorConnectionMetadata, ), ); } export function createAuthenticatorConnectionMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateAuthenticatorConnectionMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthenticatorConnectionMetadata' from JSON`, ); } /** @internal */ export const CreateAuthenticatorConnectionConnection$inboundSchema: z.ZodType< CreateAuthenticatorConnectionConnection, z.ZodTypeDef, unknown > = z.union([ AuthenticatorConfluenceConnection$inboundSchema, AuthenticatorDropboxConnection$inboundSchema, AuthenticatorGmailConnection$inboundSchema, AuthenticatorGoogleDriveConnection$inboundSchema, AuthenticatorHubspotConnection$inboundSchema, AuthenticatorJiraConnection$inboundSchema, AuthenticatorNotionConnection$inboundSchema, AuthenticatorOnedriveConnection$inboundSchema, AuthenticatorSalesforceConnection$inboundSchema, AuthenticatorSharepointConnection$inboundSchema, AuthenticatorSlackConnection$inboundSchema, ]); /** @internal */ export type CreateAuthenticatorConnectionConnection$Outbound = | AuthenticatorConfluenceConnection$Outbound | AuthenticatorDropboxConnection$Outbound | AuthenticatorGmailConnection$Outbound | AuthenticatorGoogleDriveConnection$Outbound | AuthenticatorHubspotConnection$Outbound | AuthenticatorJiraConnection$Outbound | AuthenticatorNotionConnection$Outbound | AuthenticatorOnedriveConnection$Outbound | AuthenticatorSalesforceConnection$Outbound | AuthenticatorSharepointConnection$Outbound | AuthenticatorSlackConnection$Outbound; /** @internal */ export const CreateAuthenticatorConnectionConnection$outboundSchema: z.ZodType< CreateAuthenticatorConnectionConnection$Outbound, z.ZodTypeDef, CreateAuthenticatorConnectionConnection > = z.union([ AuthenticatorConfluenceConnection$outboundSchema, AuthenticatorDropboxConnection$outboundSchema, AuthenticatorGmailConnection$outboundSchema, AuthenticatorGoogleDriveConnection$outboundSchema, AuthenticatorHubspotConnection$outboundSchema, AuthenticatorJiraConnection$outboundSchema, AuthenticatorNotionConnection$outboundSchema, AuthenticatorOnedriveConnection$outboundSchema, AuthenticatorSalesforceConnection$outboundSchema, AuthenticatorSharepointConnection$outboundSchema, AuthenticatorSlackConnection$outboundSchema, ]); export function createAuthenticatorConnectionConnectionToJSON( createAuthenticatorConnectionConnection: CreateAuthenticatorConnectionConnection, ): string { return JSON.stringify( CreateAuthenticatorConnectionConnection$outboundSchema.parse( createAuthenticatorConnectionConnection, ), ); } export function createAuthenticatorConnectionConnectionFromJSON( jsonString: string, ): SafeParseResult< CreateAuthenticatorConnectionConnection, SDKValidationError > { return safeParse( jsonString, (x) => CreateAuthenticatorConnectionConnection$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CreateAuthenticatorConnectionConnection' from JSON`, ); } /** @internal */ export const CreateAuthenticatorConnection$inboundSchema: z.ZodType< CreateAuthenticatorConnection, z.ZodTypeDef, unknown > = z.object({ partition_strategy: MediaModeParam$inboundSchema, partition: z.nullable(z.string()).optional(), page_limit: z.nullable(z.number().int()).optional(), config: z.nullable(z.record(z.any())).optional(), metadata: z.record( z.union([ z.string(), z.number().int(), z.number(), z.boolean(), z.array(z.string()), ]), ).optional(), connection: z.union([ AuthenticatorConfluenceConnection$inboundSchema, AuthenticatorDropboxConnection$inboundSchema, AuthenticatorGmailConnection$inboundSchema, AuthenticatorGoogleDriveConnection$inboundSchema, AuthenticatorHubspotConnection$inboundSchema, AuthenticatorJiraConnection$inboundSchema, AuthenticatorNotionConnection$inboundSchema, AuthenticatorOnedriveConnection$inboundSchema, AuthenticatorSalesforceConnection$inboundSchema, AuthenticatorSharepointConnection$inboundSchema, AuthenticatorSlackConnection$inboundSchema, ]), }).transform((v) => { return remap$(v, { "partition_strategy": "partitionStrategy", "page_limit": "pageLimit", }); }); /** @internal */ export type CreateAuthenticatorConnection$Outbound = { partition_strategy: MediaModeParam$Outbound; partition?: string | null | undefined; page_limit?: number | null | undefined; config?: { [k: string]: any } | null | undefined; metadata?: | { [k: string]: string | number | number | boolean | Array } | undefined; connection: | AuthenticatorConfluenceConnection$Outbound | AuthenticatorDropboxConnection$Outbound | AuthenticatorGmailConnection$Outbound | AuthenticatorGoogleDriveConnection$Outbound | AuthenticatorHubspotConnection$Outbound | AuthenticatorJiraConnection$Outbound | AuthenticatorNotionConnection$Outbound | AuthenticatorOnedriveConnection$Outbound | AuthenticatorSalesforceConnection$Outbound | AuthenticatorSharepointConnection$Outbound | AuthenticatorSlackConnection$Outbound; }; /** @internal */ export const CreateAuthenticatorConnection$outboundSchema: z.ZodType< CreateAuthenticatorConnection$Outbound, z.ZodTypeDef, CreateAuthenticatorConnection > = z.object({ partitionStrategy: MediaModeParam$outboundSchema, partition: z.nullable(z.string()).optional(), pageLimit: z.nullable(z.number().int()).optional(), config: z.nullable(z.record(z.any())).optional(), metadata: z.record( z.union([ z.string(), z.number().int(), z.number(), z.boolean(), z.array(z.string()), ]), ).optional(), connection: z.union([ AuthenticatorConfluenceConnection$outboundSchema, AuthenticatorDropboxConnection$outboundSchema, AuthenticatorGmailConnection$outboundSchema, AuthenticatorGoogleDriveConnection$outboundSchema, AuthenticatorHubspotConnection$outboundSchema, AuthenticatorJiraConnection$outboundSchema, AuthenticatorNotionConnection$outboundSchema, AuthenticatorOnedriveConnection$outboundSchema, AuthenticatorSalesforceConnection$outboundSchema, AuthenticatorSharepointConnection$outboundSchema, AuthenticatorSlackConnection$outboundSchema, ]), }).transform((v) => { return remap$(v, { partitionStrategy: "partition_strategy", pageLimit: "page_limit", }); }); export function createAuthenticatorConnectionToJSON( createAuthenticatorConnection: CreateAuthenticatorConnection, ): string { return JSON.stringify( CreateAuthenticatorConnection$outboundSchema.parse( createAuthenticatorConnection, ), ); } export function createAuthenticatorConnectionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateAuthenticatorConnection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthenticatorConnection' from JSON`, ); }