/*
 * 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";

export type ChannelMapping = {
  channelKey?: string | undefined;
  deviceIdentifier?: string | undefined;
  enabled?: string | undefined;
  lineupIdentifier?: string | undefined;
};

/** @internal */
export const ChannelMapping$inboundSchema: z.ZodType<
  ChannelMapping,
  z.ZodTypeDef,
  unknown
> = z.object({
  channelKey: z.string().optional(),
  deviceIdentifier: z.string().optional(),
  enabled: z.string().optional(),
  lineupIdentifier: z.string().optional(),
});

export function channelMappingFromJSON(
  jsonString: string,
): SafeParseResult<ChannelMapping, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ChannelMapping$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ChannelMapping' from JSON`,
  );
}
