/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 6331d9b762e6
 */

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  EncodedPayloadOptions,
  EncodedPayloadOptions$outboundSchema,
} from "./encodedpayloadoptions.js";

export type NetworkEncodedInput = {
  /**
   * The encoded payload
   */
  b64payload: string;
  /**
   * The encoding of the payload
   */
  encodingOptions?: Array<EncodedPayloadOptions> | undefined;
  /**
   * Whether the payload is empty
   */
  empty?: boolean | undefined;
};

/** @internal */
export type NetworkEncodedInput$Outbound = {
  b64payload: string;
  encoding_options?: Array<string> | undefined;
  empty: boolean;
};

/** @internal */
export const NetworkEncodedInput$outboundSchema: z.ZodType<
  NetworkEncodedInput$Outbound,
  NetworkEncodedInput
> = z.object({
  b64payload: z.string(),
  encodingOptions: z.array(EncodedPayloadOptions$outboundSchema).optional(),
  empty: z.boolean().default(false),
}).transform((v) => {
  return remap$(v, {
    encodingOptions: "encoding_options",
  });
});

export function networkEncodedInputToJSON(
  networkEncodedInput: NetworkEncodedInput,
): string {
  return JSON.stringify(
    NetworkEncodedInput$outboundSchema.parse(networkEncodedInput),
  );
}
