/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SlackData = { channelId: string; channelName: string; }; /** @internal */ export const SlackData$inboundSchema: z.ZodType< SlackData, z.ZodTypeDef, unknown > = z.object({ channel_id: z.string(), channel_name: z.string(), }).transform((v) => { return remap$(v, { "channel_id": "channelId", "channel_name": "channelName", }); }); /** @internal */ export type SlackData$Outbound = { channel_id: string; channel_name: string; }; /** @internal */ export const SlackData$outboundSchema: z.ZodType< SlackData$Outbound, z.ZodTypeDef, SlackData > = z.object({ channelId: z.string(), channelName: z.string(), }).transform((v) => { return remap$(v, { channelId: "channel_id", channelName: "channel_name", }); }); export function slackDataToJSON(slackData: SlackData): string { return JSON.stringify(SlackData$outboundSchema.parse(slackData)); } export function slackDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SlackData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SlackData' from JSON`, ); }