/* * 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 { GoogleFolderData, GoogleFolderData$inboundSchema, GoogleFolderData$Outbound, GoogleFolderData$outboundSchema, } from "./googlefolderdata.js"; import { OAuthRefreshTokenCredentials, OAuthRefreshTokenCredentials$inboundSchema, OAuthRefreshTokenCredentials$Outbound, OAuthRefreshTokenCredentials$outboundSchema, } from "./oauthrefreshtokencredentials.js"; export type AuthenticatorGoogleDriveConnection = { provider: "google_drive"; data: Array; /** * The email of the Google Drive account this is for */ email: string; credentials: OAuthRefreshTokenCredentials; }; /** @internal */ export const AuthenticatorGoogleDriveConnection$inboundSchema: z.ZodType< AuthenticatorGoogleDriveConnection, z.ZodTypeDef, unknown > = z.object({ provider: z.literal("google_drive"), data: z.array(GoogleFolderData$inboundSchema), email: z.string(), credentials: OAuthRefreshTokenCredentials$inboundSchema, }); /** @internal */ export type AuthenticatorGoogleDriveConnection$Outbound = { provider: "google_drive"; data: Array; email: string; credentials: OAuthRefreshTokenCredentials$Outbound; }; /** @internal */ export const AuthenticatorGoogleDriveConnection$outboundSchema: z.ZodType< AuthenticatorGoogleDriveConnection$Outbound, z.ZodTypeDef, AuthenticatorGoogleDriveConnection > = z.object({ provider: z.literal("google_drive"), data: z.array(GoogleFolderData$outboundSchema), email: z.string(), credentials: OAuthRefreshTokenCredentials$outboundSchema, }); export function authenticatorGoogleDriveConnectionToJSON( authenticatorGoogleDriveConnection: AuthenticatorGoogleDriveConnection, ): string { return JSON.stringify( AuthenticatorGoogleDriveConnection$outboundSchema.parse( authenticatorGoogleDriveConnection, ), ); } export function authenticatorGoogleDriveConnectionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthenticatorGoogleDriveConnection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthenticatorGoogleDriveConnection' from JSON`, ); }