/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 4b82d13c2400 */ 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"; export type AppResult = { /** * The app or other repository type this represents */ datasource: string; /** * The datasource-specific type of the document (e.g. for Jira issues, this is the issue type such as Bug or Feature Request). */ docType?: string | undefined; /** * Mimetype is used to differentiate between sub applications from a datasource (e.g. Sheets, Docs from Gdrive) */ mimeType?: string | undefined; /** * If there is available icon URL. */ iconUrl?: string | undefined; }; /** @internal */ export const AppResult$inboundSchema: z.ZodType< AppResult, z.ZodTypeDef, unknown > = z.object({ datasource: z.string(), docType: z.string().optional(), mimeType: z.string().optional(), iconUrl: z.string().optional(), }); /** @internal */ export type AppResult$Outbound = { datasource: string; docType?: string | undefined; mimeType?: string | undefined; iconUrl?: string | undefined; }; /** @internal */ export const AppResult$outboundSchema: z.ZodType< AppResult$Outbound, z.ZodTypeDef, AppResult > = z.object({ datasource: z.string(), docType: z.string().optional(), mimeType: z.string().optional(), iconUrl: z.string().optional(), }); export function appResultToJSON(appResult: AppResult): string { return JSON.stringify(AppResult$outboundSchema.parse(appResult)); } export function appResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppResult' from JSON`, ); }