/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { AuthenticationType, AuthenticationType$inboundSchema, AuthenticationType$outboundSchema, } from "./authenticationtype.js"; import { DatabaseType, DatabaseType$inboundSchema, DatabaseType$outboundSchema, } from "./databasetype.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { RuntimeMode, RuntimeMode$inboundSchema, RuntimeMode$outboundSchema, } from "./runtimemode.js"; import { UpdateMechanism, UpdateMechanism$inboundSchema, UpdateMechanism$outboundSchema, } from "./updatemechanism.js"; export type SystemResource = { appName?: string | null | undefined; instanceName?: string | null | undefined; version?: string | null | undefined; buildTime?: Date | undefined; isDebug?: boolean | undefined; isProduction?: boolean | undefined; isAdmin?: boolean | undefined; isUserInteractive?: boolean | undefined; startupPath?: string | null | undefined; appData?: string | null | undefined; osName?: string | null | undefined; osVersion?: string | null | undefined; isNetCore?: boolean | undefined; isLinux?: boolean | undefined; isOsx?: boolean | undefined; isWindows?: boolean | undefined; isDocker?: boolean | undefined; mode?: RuntimeMode | undefined; branch?: string | null | undefined; databaseType?: DatabaseType | undefined; databaseVersion?: string | null | undefined; authentication?: AuthenticationType | undefined; migrationVersion?: number | undefined; urlBase?: string | null | undefined; runtimeVersion?: string | null | undefined; runtimeName?: string | null | undefined; startTime?: Date | undefined; packageVersion?: string | null | undefined; packageAuthor?: string | null | undefined; packageUpdateMechanism?: UpdateMechanism | undefined; packageUpdateMechanismMessage?: string | null | undefined; }; /** @internal */ export const SystemResource$inboundSchema: z.ZodType< SystemResource, z.ZodTypeDef, unknown > = z.object({ appName: z.nullable(z.string()).optional(), instanceName: z.nullable(z.string()).optional(), version: z.nullable(z.string()).optional(), buildTime: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), isDebug: z.boolean().optional(), isProduction: z.boolean().optional(), isAdmin: z.boolean().optional(), isUserInteractive: z.boolean().optional(), startupPath: z.nullable(z.string()).optional(), appData: z.nullable(z.string()).optional(), osName: z.nullable(z.string()).optional(), osVersion: z.nullable(z.string()).optional(), isNetCore: z.boolean().optional(), isLinux: z.boolean().optional(), isOsx: z.boolean().optional(), isWindows: z.boolean().optional(), isDocker: z.boolean().optional(), mode: RuntimeMode$inboundSchema.optional(), branch: z.nullable(z.string()).optional(), databaseType: DatabaseType$inboundSchema.optional(), databaseVersion: z.nullable(z.string()).optional(), authentication: AuthenticationType$inboundSchema.optional(), migrationVersion: z.number().int().optional(), urlBase: z.nullable(z.string()).optional(), runtimeVersion: z.nullable(z.string()).optional(), runtimeName: z.nullable(z.string()).optional(), startTime: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), packageVersion: z.nullable(z.string()).optional(), packageAuthor: z.nullable(z.string()).optional(), packageUpdateMechanism: UpdateMechanism$inboundSchema.optional(), packageUpdateMechanismMessage: z.nullable(z.string()).optional(), }); /** @internal */ export type SystemResource$Outbound = { appName?: string | null | undefined; instanceName?: string | null | undefined; version?: string | null | undefined; buildTime?: string | undefined; isDebug?: boolean | undefined; isProduction?: boolean | undefined; isAdmin?: boolean | undefined; isUserInteractive?: boolean | undefined; startupPath?: string | null | undefined; appData?: string | null | undefined; osName?: string | null | undefined; osVersion?: string | null | undefined; isNetCore?: boolean | undefined; isLinux?: boolean | undefined; isOsx?: boolean | undefined; isWindows?: boolean | undefined; isDocker?: boolean | undefined; mode?: string | undefined; branch?: string | null | undefined; databaseType?: string | undefined; databaseVersion?: string | null | undefined; authentication?: string | undefined; migrationVersion?: number | undefined; urlBase?: string | null | undefined; runtimeVersion?: string | null | undefined; runtimeName?: string | null | undefined; startTime?: string | undefined; packageVersion?: string | null | undefined; packageAuthor?: string | null | undefined; packageUpdateMechanism?: string | undefined; packageUpdateMechanismMessage?: string | null | undefined; }; /** @internal */ export const SystemResource$outboundSchema: z.ZodType< SystemResource$Outbound, z.ZodTypeDef, SystemResource > = z.object({ appName: z.nullable(z.string()).optional(), instanceName: z.nullable(z.string()).optional(), version: z.nullable(z.string()).optional(), buildTime: z.date().transform(v => v.toISOString()).optional(), isDebug: z.boolean().optional(), isProduction: z.boolean().optional(), isAdmin: z.boolean().optional(), isUserInteractive: z.boolean().optional(), startupPath: z.nullable(z.string()).optional(), appData: z.nullable(z.string()).optional(), osName: z.nullable(z.string()).optional(), osVersion: z.nullable(z.string()).optional(), isNetCore: z.boolean().optional(), isLinux: z.boolean().optional(), isOsx: z.boolean().optional(), isWindows: z.boolean().optional(), isDocker: z.boolean().optional(), mode: RuntimeMode$outboundSchema.optional(), branch: z.nullable(z.string()).optional(), databaseType: DatabaseType$outboundSchema.optional(), databaseVersion: z.nullable(z.string()).optional(), authentication: AuthenticationType$outboundSchema.optional(), migrationVersion: z.number().int().optional(), urlBase: z.nullable(z.string()).optional(), runtimeVersion: z.nullable(z.string()).optional(), runtimeName: z.nullable(z.string()).optional(), startTime: z.date().transform(v => v.toISOString()).optional(), packageVersion: z.nullable(z.string()).optional(), packageAuthor: z.nullable(z.string()).optional(), packageUpdateMechanism: UpdateMechanism$outboundSchema.optional(), packageUpdateMechanismMessage: z.nullable(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SystemResource$ { /** @deprecated use `SystemResource$inboundSchema` instead. */ export const inboundSchema = SystemResource$inboundSchema; /** @deprecated use `SystemResource$outboundSchema` instead. */ export const outboundSchema = SystemResource$outboundSchema; /** @deprecated use `SystemResource$Outbound` instead. */ export type Outbound = SystemResource$Outbound; } export function systemResourceToJSON(systemResource: SystemResource): string { return JSON.stringify(SystemResource$outboundSchema.parse(systemResource)); } export function systemResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SystemResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SystemResource' from JSON`, ); }