/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { FolderData, FolderData$inboundSchema, FolderData$Outbound, FolderData$outboundSchema, } from "./folderdata.js"; import { OAuthRefreshTokenCredentials, OAuthRefreshTokenCredentials$inboundSchema, OAuthRefreshTokenCredentials$Outbound, OAuthRefreshTokenCredentials$outboundSchema, } from "./oauthrefreshtokencredentials.js"; export type AuthenticatorDropboxConnection = { provider: "dropbox"; data: FolderData; /** * The email of the Dropbox account this is for */ email: string; credentials: OAuthRefreshTokenCredentials; }; /** @internal */ export const AuthenticatorDropboxConnection$inboundSchema: z.ZodType< AuthenticatorDropboxConnection, z.ZodTypeDef, unknown > = z.object({ provider: z.literal("dropbox"), data: FolderData$inboundSchema, email: z.string(), credentials: OAuthRefreshTokenCredentials$inboundSchema, }); /** @internal */ export type AuthenticatorDropboxConnection$Outbound = { provider: "dropbox"; data: FolderData$Outbound; email: string; credentials: OAuthRefreshTokenCredentials$Outbound; }; /** @internal */ export const AuthenticatorDropboxConnection$outboundSchema: z.ZodType< AuthenticatorDropboxConnection$Outbound, z.ZodTypeDef, AuthenticatorDropboxConnection > = z.object({ provider: z.literal("dropbox"), data: FolderData$outboundSchema, email: z.string(), credentials: OAuthRefreshTokenCredentials$outboundSchema, }); export function authenticatorDropboxConnectionToJSON( authenticatorDropboxConnection: AuthenticatorDropboxConnection, ): string { return JSON.stringify( AuthenticatorDropboxConnection$outboundSchema.parse( authenticatorDropboxConnection, ), ); } export function authenticatorDropboxConnectionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthenticatorDropboxConnection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthenticatorDropboxConnection' from JSON`, ); }