/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: e3e1cb4d4fc6 */ 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 DatasourceProfile = { /** * The datasource the profile is of. */ datasource: string; /** * The display name of the entity in the given datasource. */ handle: string; /** * URL to view the entity's profile. */ url?: string | undefined; /** * A deep link, if available, into the datasource's native application for the entity's platform (i.e. slack://...). */ nativeAppUrl?: string | undefined; /** * For internal use only. True iff the data source profile was manually added by a user from within Glean (aka not from the original data source) */ isUserGenerated?: boolean | undefined; }; /** @internal */ export const DatasourceProfile$inboundSchema: z.ZodType< DatasourceProfile, z.ZodTypeDef, unknown > = z.object({ datasource: z.string(), handle: z.string(), url: z.string().optional(), nativeAppUrl: z.string().optional(), isUserGenerated: z.boolean().optional(), }); /** @internal */ export type DatasourceProfile$Outbound = { datasource: string; handle: string; url?: string | undefined; nativeAppUrl?: string | undefined; isUserGenerated?: boolean | undefined; }; /** @internal */ export const DatasourceProfile$outboundSchema: z.ZodType< DatasourceProfile$Outbound, z.ZodTypeDef, DatasourceProfile > = z.object({ datasource: z.string(), handle: z.string(), url: z.string().optional(), nativeAppUrl: z.string().optional(), isUserGenerated: z.boolean().optional(), }); export function datasourceProfileToJSON( datasourceProfile: DatasourceProfile, ): string { return JSON.stringify( DatasourceProfile$outboundSchema.parse(datasourceProfile), ); } export function datasourceProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DatasourceProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DatasourceProfile' from JSON`, ); }