/**
 * MiniMax Node - Version 1 - Zod Schema
 * Discriminator: resource=video, operation=imageToVideo
 *
 * Use .parse() for strict validation or .safeParse() for error handling.
 *
 * Schema helpers (z, expressionSchema, etc.) are passed as parameters
 * by the schema-validator, not imported from external files.
 *
 * @generated - CommonJS JavaScript for runtime loading
 */

module.exports = function getSchema({ parameters, z, expressionSchema, stringOrExpression, numberOrExpression, booleanOrExpression, resourceLocatorValueSchema, resourceMapperValueSchema, filterValueSchema, assignmentCollectionValueSchema, iDataObjectSchema, resolveSchema, toolInstanceSchema }) {

  // Static subnode schema
  const subnodesSchema = z.object({
    tools: z.array(toolInstanceSchema).optional(),
  }).strict();

  return z.object({
    parameters: z.object({
      resource: z.literal('video'),
      operation: z.literal('imageToVideo'),
      modelId: z.union([z.literal('I2V-01'), z.literal('I2V-01-Director'), z.literal('I2V-01-live'), z.literal('MiniMax-Hailuo-02'), z.literal('MiniMax-Hailuo-2.3'), z.literal('MiniMax-Hailuo-2.3-Fast'), expressionSchema]).optional(),
      imageInputType: z.union([z.literal('url'), z.literal('binary'), expressionSchema]).optional(),
      imageUrl: resolveSchema({ parameters, schema: stringOrExpression, required: true, displayOptions: {"show":{"imageInputType":["url"]}}, defaults: {"imageInputType":"url"} }),
      binaryPropertyName: resolveSchema({ parameters, schema: stringOrExpression, required: false, displayOptions: {"show":{"imageInputType":["binary"]}}, defaults: {"imageInputType":"url"} }),
      prompt: stringOrExpression.optional(),
      duration: z.union([z.literal(6), z.literal(10), expressionSchema]).optional(),
      resolution: z.union([z.literal('512P'), z.literal('720P'), z.literal('768P'), z.literal('1080P'), expressionSchema]).optional(),
      downloadVideo: booleanOrExpression.optional(),
      options: z.object({ promptOptimizer: booleanOrExpression.optional(), lastFrameInputType: z.union([z.literal('none'), z.literal('url'), z.literal('binary'), expressionSchema]).optional(), lastFrameImageUrl: stringOrExpression.optional(), lastFrameBinaryPropertyName: stringOrExpression.optional(), subjectReferenceInputType: z.union([z.literal('none'), z.literal('url'), z.literal('binary'), expressionSchema]).optional(), subjectReferenceImageUrl: stringOrExpression.optional(), subjectReferenceBinaryPropertyName: stringOrExpression.optional() }).optional(),
    }).optional(),
    subnodes: subnodesSchema.optional(),
  });
};