/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { RFCDate } from "../../types/rfcdate.js";

export type GetMetaDataByRatingKeyRequest = {
  /**
   * the id of the library item to return the children of.
   */
  ratingKey: number;
};

export type GetMetaDataByRatingKeyStream = {
  id?: number | undefined;
  streamType?: number | undefined;
  default?: boolean | undefined;
  codec?: string | undefined;
  index?: number | undefined;
  bitrate?: number | undefined;
  bitDepth?: number | undefined;
  chromaLocation?: string | undefined;
  chromaSubsampling?: string | undefined;
  codedHeight?: number | undefined;
  codedWidth?: number | undefined;
  colorPrimaries?: string | undefined;
  colorRange?: string | undefined;
  colorSpace?: string | undefined;
  colorTrc?: string | undefined;
  frameRate?: number | undefined;
  hasScalingMatrix?: boolean | undefined;
  height?: number | undefined;
  level?: number | undefined;
  profile?: string | undefined;
  refFrames?: number | undefined;
  scanType?: string | undefined;
  streamIdentifier?: string | undefined;
  width?: number | undefined;
  displayTitle?: string | undefined;
  extendedDisplayTitle?: string | undefined;
  selected?: boolean | undefined;
  channels?: number | undefined;
  language?: string | undefined;
  languageTag?: string | undefined;
  languageCode?: string | undefined;
  samplingRate?: number | undefined;
};

export type GetMetaDataByRatingKeyPart = {
  id?: number | undefined;
  key?: string | undefined;
  duration?: number | undefined;
  file?: string | undefined;
  size?: number | undefined;
  audioProfile?: string | undefined;
  container?: string | undefined;
  has64bitOffsets?: boolean | undefined;
  optimizedForStreaming?: boolean | undefined;
  videoProfile?: string | undefined;
  stream?: Array<GetMetaDataByRatingKeyStream> | undefined;
};

export type GetMetaDataByRatingKeyMedia = {
  id?: number | undefined;
  duration?: number | undefined;
  bitrate?: number | undefined;
  width?: number | undefined;
  height?: number | undefined;
  aspectRatio?: number | undefined;
  audioChannels?: number | undefined;
  audioCodec?: string | undefined;
  videoCodec?: string | undefined;
  videoResolution?: string | undefined;
  container?: string | undefined;
  videoFrameRate?: string | undefined;
  optimizedForStreaming?: number | undefined;
  audioProfile?: string | undefined;
  has64bitOffsets?: boolean | undefined;
  videoProfile?: string | undefined;
  part?: Array<GetMetaDataByRatingKeyPart> | undefined;
};

export type GetMetaDataByRatingKeyGenre = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
};

export type GetMetaDataByRatingKeyCountry = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
};

export type Guids = {
  id?: string | undefined;
};

export type Ratings = {
  image?: string | undefined;
  value?: number | undefined;
  type?: string | undefined;
};

export type GetMetaDataByRatingKeyDirector = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  thumb?: string | undefined;
};

export type GetMetaDataByRatingKeyWriter = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  thumb?: string | undefined;
};

export type GetMetaDataByRatingKeyRole = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  role?: string | undefined;
  thumb?: string | undefined;
};

export type Producer = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  thumb?: string | undefined;
};

export type GetMetaDataByRatingKeyMetadata = {
  ratingKey?: string | undefined;
  key?: string | undefined;
  guid?: string | undefined;
  studio?: string | undefined;
  type?: string | undefined;
  title?: string | undefined;
  librarySectionTitle?: string | undefined;
  librarySectionID?: number | undefined;
  librarySectionKey?: string | undefined;
  contentRating?: string | undefined;
  summary?: string | undefined;
  rating?: number | undefined;
  audienceRating?: number | undefined;
  year?: number | undefined;
  tagline?: string | undefined;
  thumb?: string | undefined;
  art?: string | undefined;
  duration?: number | undefined;
  originallyAvailableAt?: RFCDate | undefined;
  addedAt?: number | undefined;
  updatedAt?: number | undefined;
  audienceRatingImage?: string | undefined;
  hasPremiumPrimaryExtra?: string | undefined;
  ratingImage?: string | undefined;
  media?: Array<GetMetaDataByRatingKeyMedia> | undefined;
  genre?: Array<GetMetaDataByRatingKeyGenre> | undefined;
  country?: Array<GetMetaDataByRatingKeyCountry> | undefined;
  guids?: Array<Guids> | undefined;
  ratings?: Array<Ratings> | undefined;
  director?: Array<GetMetaDataByRatingKeyDirector> | undefined;
  writer?: Array<GetMetaDataByRatingKeyWriter> | undefined;
  role?: Array<GetMetaDataByRatingKeyRole> | undefined;
  producer?: Array<Producer> | undefined;
};

export type GetMetaDataByRatingKeyMediaContainer = {
  size?: number | undefined;
  allowSync?: boolean | undefined;
  identifier?: string | undefined;
  librarySectionID?: number | undefined;
  librarySectionTitle?: string | undefined;
  librarySectionUUID?: string | undefined;
  mediaTagPrefix?: string | undefined;
  mediaTagVersion?: number | undefined;
  metadata?: Array<GetMetaDataByRatingKeyMetadata> | undefined;
};

/**
 * The metadata of the library item.
 */
export type GetMetaDataByRatingKeyResponseBody = {
  mediaContainer?: GetMetaDataByRatingKeyMediaContainer | undefined;
};

export type GetMetaDataByRatingKeyResponse = {
  /**
   * HTTP response content type for this operation
   */
  contentType: string;
  /**
   * HTTP response status code for this operation
   */
  statusCode: number;
  /**
   * Raw HTTP response; suitable for custom response parsing
   */
  rawResponse: Response;
  /**
   * The metadata of the library item.
   */
  object?: GetMetaDataByRatingKeyResponseBody | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyRequest$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  ratingKey: z.number().int(),
});

/** @internal */
export type GetMetaDataByRatingKeyRequest$Outbound = {
  ratingKey: number;
};

/** @internal */
export const GetMetaDataByRatingKeyRequest$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyRequest$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyRequest
> = z.object({
  ratingKey: z.number().int(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyRequest$ {
  /** @deprecated use `GetMetaDataByRatingKeyRequest$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyRequest$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyRequest$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyRequest$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyRequest$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyRequest$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyStream$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyStream,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  streamType: z.number().int().optional(),
  default: z.boolean().optional(),
  codec: z.string().optional(),
  index: z.number().int().optional(),
  bitrate: z.number().int().optional(),
  bitDepth: z.number().int().optional(),
  chromaLocation: z.string().optional(),
  chromaSubsampling: z.string().optional(),
  codedHeight: z.number().int().optional(),
  codedWidth: z.number().int().optional(),
  colorPrimaries: z.string().optional(),
  colorRange: z.string().optional(),
  colorSpace: z.string().optional(),
  colorTrc: z.string().optional(),
  frameRate: z.number().int().optional(),
  hasScalingMatrix: z.boolean().optional(),
  height: z.number().int().optional(),
  level: z.number().int().optional(),
  profile: z.string().optional(),
  refFrames: z.number().int().optional(),
  scanType: z.string().optional(),
  streamIdentifier: z.string().optional(),
  width: z.number().int().optional(),
  displayTitle: z.string().optional(),
  extendedDisplayTitle: z.string().optional(),
  selected: z.boolean().optional(),
  channels: z.number().int().optional(),
  language: z.string().optional(),
  languageTag: z.string().optional(),
  languageCode: z.string().optional(),
  samplingRate: z.number().int().optional(),
});

/** @internal */
export type GetMetaDataByRatingKeyStream$Outbound = {
  id?: number | undefined;
  streamType?: number | undefined;
  default?: boolean | undefined;
  codec?: string | undefined;
  index?: number | undefined;
  bitrate?: number | undefined;
  bitDepth?: number | undefined;
  chromaLocation?: string | undefined;
  chromaSubsampling?: string | undefined;
  codedHeight?: number | undefined;
  codedWidth?: number | undefined;
  colorPrimaries?: string | undefined;
  colorRange?: string | undefined;
  colorSpace?: string | undefined;
  colorTrc?: string | undefined;
  frameRate?: number | undefined;
  hasScalingMatrix?: boolean | undefined;
  height?: number | undefined;
  level?: number | undefined;
  profile?: string | undefined;
  refFrames?: number | undefined;
  scanType?: string | undefined;
  streamIdentifier?: string | undefined;
  width?: number | undefined;
  displayTitle?: string | undefined;
  extendedDisplayTitle?: string | undefined;
  selected?: boolean | undefined;
  channels?: number | undefined;
  language?: string | undefined;
  languageTag?: string | undefined;
  languageCode?: string | undefined;
  samplingRate?: number | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyStream$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyStream$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyStream
> = z.object({
  id: z.number().int().optional(),
  streamType: z.number().int().optional(),
  default: z.boolean().optional(),
  codec: z.string().optional(),
  index: z.number().int().optional(),
  bitrate: z.number().int().optional(),
  bitDepth: z.number().int().optional(),
  chromaLocation: z.string().optional(),
  chromaSubsampling: z.string().optional(),
  codedHeight: z.number().int().optional(),
  codedWidth: z.number().int().optional(),
  colorPrimaries: z.string().optional(),
  colorRange: z.string().optional(),
  colorSpace: z.string().optional(),
  colorTrc: z.string().optional(),
  frameRate: z.number().int().optional(),
  hasScalingMatrix: z.boolean().optional(),
  height: z.number().int().optional(),
  level: z.number().int().optional(),
  profile: z.string().optional(),
  refFrames: z.number().int().optional(),
  scanType: z.string().optional(),
  streamIdentifier: z.string().optional(),
  width: z.number().int().optional(),
  displayTitle: z.string().optional(),
  extendedDisplayTitle: z.string().optional(),
  selected: z.boolean().optional(),
  channels: z.number().int().optional(),
  language: z.string().optional(),
  languageTag: z.string().optional(),
  languageCode: z.string().optional(),
  samplingRate: z.number().int().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyStream$ {
  /** @deprecated use `GetMetaDataByRatingKeyStream$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyStream$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyStream$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyStream$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyStream$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyStream$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyPart$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyPart,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  key: z.string().optional(),
  duration: z.number().int().optional(),
  file: z.string().optional(),
  size: z.number().int().optional(),
  audioProfile: z.string().optional(),
  container: z.string().optional(),
  has64bitOffsets: z.boolean().optional(),
  optimizedForStreaming: z.boolean().optional(),
  videoProfile: z.string().optional(),
  Stream: z.array(z.lazy(() => GetMetaDataByRatingKeyStream$inboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    "Stream": "stream",
  });
});

/** @internal */
export type GetMetaDataByRatingKeyPart$Outbound = {
  id?: number | undefined;
  key?: string | undefined;
  duration?: number | undefined;
  file?: string | undefined;
  size?: number | undefined;
  audioProfile?: string | undefined;
  container?: string | undefined;
  has64bitOffsets?: boolean | undefined;
  optimizedForStreaming?: boolean | undefined;
  videoProfile?: string | undefined;
  Stream?: Array<GetMetaDataByRatingKeyStream$Outbound> | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyPart$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyPart$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyPart
> = z.object({
  id: z.number().int().optional(),
  key: z.string().optional(),
  duration: z.number().int().optional(),
  file: z.string().optional(),
  size: z.number().int().optional(),
  audioProfile: z.string().optional(),
  container: z.string().optional(),
  has64bitOffsets: z.boolean().optional(),
  optimizedForStreaming: z.boolean().optional(),
  videoProfile: z.string().optional(),
  stream: z.array(z.lazy(() => GetMetaDataByRatingKeyStream$outboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    stream: "Stream",
  });
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyPart$ {
  /** @deprecated use `GetMetaDataByRatingKeyPart$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyPart$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyPart$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyPart$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyPart$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyPart$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyMedia$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyMedia,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  duration: z.number().int().optional(),
  bitrate: z.number().int().optional(),
  width: z.number().int().optional(),
  height: z.number().int().optional(),
  aspectRatio: z.number().optional(),
  audioChannels: z.number().int().optional(),
  audioCodec: z.string().optional(),
  videoCodec: z.string().optional(),
  videoResolution: z.string().optional(),
  container: z.string().optional(),
  videoFrameRate: z.string().optional(),
  optimizedForStreaming: z.number().int().optional(),
  audioProfile: z.string().optional(),
  has64bitOffsets: z.boolean().optional(),
  videoProfile: z.string().optional(),
  Part: z.array(z.lazy(() => GetMetaDataByRatingKeyPart$inboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    "Part": "part",
  });
});

/** @internal */
export type GetMetaDataByRatingKeyMedia$Outbound = {
  id?: number | undefined;
  duration?: number | undefined;
  bitrate?: number | undefined;
  width?: number | undefined;
  height?: number | undefined;
  aspectRatio?: number | undefined;
  audioChannels?: number | undefined;
  audioCodec?: string | undefined;
  videoCodec?: string | undefined;
  videoResolution?: string | undefined;
  container?: string | undefined;
  videoFrameRate?: string | undefined;
  optimizedForStreaming?: number | undefined;
  audioProfile?: string | undefined;
  has64bitOffsets?: boolean | undefined;
  videoProfile?: string | undefined;
  Part?: Array<GetMetaDataByRatingKeyPart$Outbound> | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyMedia$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyMedia$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyMedia
> = z.object({
  id: z.number().int().optional(),
  duration: z.number().int().optional(),
  bitrate: z.number().int().optional(),
  width: z.number().int().optional(),
  height: z.number().int().optional(),
  aspectRatio: z.number().optional(),
  audioChannels: z.number().int().optional(),
  audioCodec: z.string().optional(),
  videoCodec: z.string().optional(),
  videoResolution: z.string().optional(),
  container: z.string().optional(),
  videoFrameRate: z.string().optional(),
  optimizedForStreaming: z.number().int().optional(),
  audioProfile: z.string().optional(),
  has64bitOffsets: z.boolean().optional(),
  videoProfile: z.string().optional(),
  part: z.array(z.lazy(() => GetMetaDataByRatingKeyPart$outboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    part: "Part",
  });
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyMedia$ {
  /** @deprecated use `GetMetaDataByRatingKeyMedia$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyMedia$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyMedia$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyMedia$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyMedia$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyMedia$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyGenre$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyGenre,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
});

/** @internal */
export type GetMetaDataByRatingKeyGenre$Outbound = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyGenre$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyGenre$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyGenre
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyGenre$ {
  /** @deprecated use `GetMetaDataByRatingKeyGenre$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyGenre$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyGenre$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyGenre$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyGenre$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyGenre$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyCountry$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyCountry,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
});

/** @internal */
export type GetMetaDataByRatingKeyCountry$Outbound = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyCountry$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyCountry$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyCountry
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyCountry$ {
  /** @deprecated use `GetMetaDataByRatingKeyCountry$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyCountry$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyCountry$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyCountry$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyCountry$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyCountry$Outbound;
}

/** @internal */
export const Guids$inboundSchema: z.ZodType<Guids, z.ZodTypeDef, unknown> = z
  .object({
    id: z.string().optional(),
  });

/** @internal */
export type Guids$Outbound = {
  id?: string | undefined;
};

/** @internal */
export const Guids$outboundSchema: z.ZodType<
  Guids$Outbound,
  z.ZodTypeDef,
  Guids
> = z.object({
  id: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace Guids$ {
  /** @deprecated use `Guids$inboundSchema` instead. */
  export const inboundSchema = Guids$inboundSchema;
  /** @deprecated use `Guids$outboundSchema` instead. */
  export const outboundSchema = Guids$outboundSchema;
  /** @deprecated use `Guids$Outbound` instead. */
  export type Outbound = Guids$Outbound;
}

/** @internal */
export const Ratings$inboundSchema: z.ZodType<Ratings, z.ZodTypeDef, unknown> =
  z.object({
    image: z.string().optional(),
    value: z.number().optional(),
    type: z.string().optional(),
  });

/** @internal */
export type Ratings$Outbound = {
  image?: string | undefined;
  value?: number | undefined;
  type?: string | undefined;
};

/** @internal */
export const Ratings$outboundSchema: z.ZodType<
  Ratings$Outbound,
  z.ZodTypeDef,
  Ratings
> = z.object({
  image: z.string().optional(),
  value: z.number().optional(),
  type: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace Ratings$ {
  /** @deprecated use `Ratings$inboundSchema` instead. */
  export const inboundSchema = Ratings$inboundSchema;
  /** @deprecated use `Ratings$outboundSchema` instead. */
  export const outboundSchema = Ratings$outboundSchema;
  /** @deprecated use `Ratings$Outbound` instead. */
  export type Outbound = Ratings$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyDirector$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyDirector,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  thumb: z.string().optional(),
});

/** @internal */
export type GetMetaDataByRatingKeyDirector$Outbound = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  thumb?: string | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyDirector$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyDirector$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyDirector
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  thumb: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyDirector$ {
  /** @deprecated use `GetMetaDataByRatingKeyDirector$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyDirector$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyDirector$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyDirector$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyDirector$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyDirector$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyWriter$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyWriter,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  thumb: z.string().optional(),
});

/** @internal */
export type GetMetaDataByRatingKeyWriter$Outbound = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  thumb?: string | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyWriter$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyWriter$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyWriter
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  thumb: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyWriter$ {
  /** @deprecated use `GetMetaDataByRatingKeyWriter$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyWriter$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyWriter$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyWriter$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyWriter$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyWriter$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyRole$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyRole,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  role: z.string().optional(),
  thumb: z.string().optional(),
});

/** @internal */
export type GetMetaDataByRatingKeyRole$Outbound = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  role?: string | undefined;
  thumb?: string | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyRole$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyRole$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyRole
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  role: z.string().optional(),
  thumb: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyRole$ {
  /** @deprecated use `GetMetaDataByRatingKeyRole$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyRole$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyRole$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyRole$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyRole$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyRole$Outbound;
}

/** @internal */
export const Producer$inboundSchema: z.ZodType<
  Producer,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  thumb: z.string().optional(),
});

/** @internal */
export type Producer$Outbound = {
  id?: number | undefined;
  filter?: string | undefined;
  tag?: string | undefined;
  tagKey?: string | undefined;
  thumb?: string | undefined;
};

/** @internal */
export const Producer$outboundSchema: z.ZodType<
  Producer$Outbound,
  z.ZodTypeDef,
  Producer
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  thumb: z.string().optional(),
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace Producer$ {
  /** @deprecated use `Producer$inboundSchema` instead. */
  export const inboundSchema = Producer$inboundSchema;
  /** @deprecated use `Producer$outboundSchema` instead. */
  export const outboundSchema = Producer$outboundSchema;
  /** @deprecated use `Producer$Outbound` instead. */
  export type Outbound = Producer$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyMetadata$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyMetadata,
  z.ZodTypeDef,
  unknown
> = z.object({
  ratingKey: z.string().optional(),
  key: z.string().optional(),
  guid: z.string().optional(),
  studio: z.string().optional(),
  type: z.string().optional(),
  title: z.string().optional(),
  librarySectionTitle: z.string().optional(),
  librarySectionID: z.number().int().optional(),
  librarySectionKey: z.string().optional(),
  contentRating: z.string().optional(),
  summary: z.string().optional(),
  rating: z.number().optional(),
  audienceRating: z.number().optional(),
  year: z.number().int().optional(),
  tagline: z.string().optional(),
  thumb: z.string().optional(),
  art: z.string().optional(),
  duration: z.number().int().optional(),
  originallyAvailableAt: z.string().transform(v => new RFCDate(v)).optional(),
  addedAt: z.number().int().optional(),
  updatedAt: z.number().int().optional(),
  audienceRatingImage: z.string().optional(),
  hasPremiumPrimaryExtra: z.string().optional(),
  ratingImage: z.string().optional(),
  Media: z.array(z.lazy(() => GetMetaDataByRatingKeyMedia$inboundSchema))
    .optional(),
  Genre: z.array(z.lazy(() => GetMetaDataByRatingKeyGenre$inboundSchema))
    .optional(),
  Country: z.array(z.lazy(() => GetMetaDataByRatingKeyCountry$inboundSchema))
    .optional(),
  Guid: z.array(z.lazy(() => Guids$inboundSchema)).optional(),
  Rating: z.array(z.lazy(() => Ratings$inboundSchema)).optional(),
  Director: z.array(z.lazy(() => GetMetaDataByRatingKeyDirector$inboundSchema))
    .optional(),
  Writer: z.array(z.lazy(() => GetMetaDataByRatingKeyWriter$inboundSchema))
    .optional(),
  Role: z.array(z.lazy(() => GetMetaDataByRatingKeyRole$inboundSchema))
    .optional(),
  Producer: z.array(z.lazy(() => Producer$inboundSchema)).optional(),
}).transform((v) => {
  return remap$(v, {
    "Media": "media",
    "Genre": "genre",
    "Country": "country",
    "Guid": "guids",
    "Rating": "ratings",
    "Director": "director",
    "Writer": "writer",
    "Role": "role",
    "Producer": "producer",
  });
});

/** @internal */
export type GetMetaDataByRatingKeyMetadata$Outbound = {
  ratingKey?: string | undefined;
  key?: string | undefined;
  guid?: string | undefined;
  studio?: string | undefined;
  type?: string | undefined;
  title?: string | undefined;
  librarySectionTitle?: string | undefined;
  librarySectionID?: number | undefined;
  librarySectionKey?: string | undefined;
  contentRating?: string | undefined;
  summary?: string | undefined;
  rating?: number | undefined;
  audienceRating?: number | undefined;
  year?: number | undefined;
  tagline?: string | undefined;
  thumb?: string | undefined;
  art?: string | undefined;
  duration?: number | undefined;
  originallyAvailableAt?: string | undefined;
  addedAt?: number | undefined;
  updatedAt?: number | undefined;
  audienceRatingImage?: string | undefined;
  hasPremiumPrimaryExtra?: string | undefined;
  ratingImage?: string | undefined;
  Media?: Array<GetMetaDataByRatingKeyMedia$Outbound> | undefined;
  Genre?: Array<GetMetaDataByRatingKeyGenre$Outbound> | undefined;
  Country?: Array<GetMetaDataByRatingKeyCountry$Outbound> | undefined;
  Guid?: Array<Guids$Outbound> | undefined;
  Rating?: Array<Ratings$Outbound> | undefined;
  Director?: Array<GetMetaDataByRatingKeyDirector$Outbound> | undefined;
  Writer?: Array<GetMetaDataByRatingKeyWriter$Outbound> | undefined;
  Role?: Array<GetMetaDataByRatingKeyRole$Outbound> | undefined;
  Producer?: Array<Producer$Outbound> | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyMetadata$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyMetadata$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyMetadata
> = z.object({
  ratingKey: z.string().optional(),
  key: z.string().optional(),
  guid: z.string().optional(),
  studio: z.string().optional(),
  type: z.string().optional(),
  title: z.string().optional(),
  librarySectionTitle: z.string().optional(),
  librarySectionID: z.number().int().optional(),
  librarySectionKey: z.string().optional(),
  contentRating: z.string().optional(),
  summary: z.string().optional(),
  rating: z.number().optional(),
  audienceRating: z.number().optional(),
  year: z.number().int().optional(),
  tagline: z.string().optional(),
  thumb: z.string().optional(),
  art: z.string().optional(),
  duration: z.number().int().optional(),
  originallyAvailableAt: z.instanceof(RFCDate).transform(v => v.toString())
    .optional(),
  addedAt: z.number().int().optional(),
  updatedAt: z.number().int().optional(),
  audienceRatingImage: z.string().optional(),
  hasPremiumPrimaryExtra: z.string().optional(),
  ratingImage: z.string().optional(),
  media: z.array(z.lazy(() => GetMetaDataByRatingKeyMedia$outboundSchema))
    .optional(),
  genre: z.array(z.lazy(() => GetMetaDataByRatingKeyGenre$outboundSchema))
    .optional(),
  country: z.array(z.lazy(() => GetMetaDataByRatingKeyCountry$outboundSchema))
    .optional(),
  guids: z.array(z.lazy(() => Guids$outboundSchema)).optional(),
  ratings: z.array(z.lazy(() => Ratings$outboundSchema)).optional(),
  director: z.array(z.lazy(() => GetMetaDataByRatingKeyDirector$outboundSchema))
    .optional(),
  writer: z.array(z.lazy(() => GetMetaDataByRatingKeyWriter$outboundSchema))
    .optional(),
  role: z.array(z.lazy(() => GetMetaDataByRatingKeyRole$outboundSchema))
    .optional(),
  producer: z.array(z.lazy(() => Producer$outboundSchema)).optional(),
}).transform((v) => {
  return remap$(v, {
    media: "Media",
    genre: "Genre",
    country: "Country",
    guids: "Guid",
    ratings: "Rating",
    director: "Director",
    writer: "Writer",
    role: "Role",
    producer: "Producer",
  });
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyMetadata$ {
  /** @deprecated use `GetMetaDataByRatingKeyMetadata$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyMetadata$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyMetadata$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyMetadata$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyMetadata$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyMetadata$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyMediaContainer$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyMediaContainer,
  z.ZodTypeDef,
  unknown
> = z.object({
  size: z.number().int().optional(),
  allowSync: z.boolean().optional(),
  identifier: z.string().optional(),
  librarySectionID: z.number().int().optional(),
  librarySectionTitle: z.string().optional(),
  librarySectionUUID: z.string().optional(),
  mediaTagPrefix: z.string().optional(),
  mediaTagVersion: z.number().int().optional(),
  Metadata: z.array(z.lazy(() => GetMetaDataByRatingKeyMetadata$inboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    "Metadata": "metadata",
  });
});

/** @internal */
export type GetMetaDataByRatingKeyMediaContainer$Outbound = {
  size?: number | undefined;
  allowSync?: boolean | undefined;
  identifier?: string | undefined;
  librarySectionID?: number | undefined;
  librarySectionTitle?: string | undefined;
  librarySectionUUID?: string | undefined;
  mediaTagPrefix?: string | undefined;
  mediaTagVersion?: number | undefined;
  Metadata?: Array<GetMetaDataByRatingKeyMetadata$Outbound> | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyMediaContainer$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyMediaContainer$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyMediaContainer
> = z.object({
  size: z.number().int().optional(),
  allowSync: z.boolean().optional(),
  identifier: z.string().optional(),
  librarySectionID: z.number().int().optional(),
  librarySectionTitle: z.string().optional(),
  librarySectionUUID: z.string().optional(),
  mediaTagPrefix: z.string().optional(),
  mediaTagVersion: z.number().int().optional(),
  metadata: z.array(z.lazy(() => GetMetaDataByRatingKeyMetadata$outboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    metadata: "Metadata",
  });
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyMediaContainer$ {
  /** @deprecated use `GetMetaDataByRatingKeyMediaContainer$inboundSchema` instead. */
  export const inboundSchema =
    GetMetaDataByRatingKeyMediaContainer$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyMediaContainer$outboundSchema` instead. */
  export const outboundSchema =
    GetMetaDataByRatingKeyMediaContainer$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyMediaContainer$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyMediaContainer$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyResponseBody$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyResponseBody,
  z.ZodTypeDef,
  unknown
> = z.object({
  MediaContainer: z.lazy(() =>
    GetMetaDataByRatingKeyMediaContainer$inboundSchema
  ).optional(),
}).transform((v) => {
  return remap$(v, {
    "MediaContainer": "mediaContainer",
  });
});

/** @internal */
export type GetMetaDataByRatingKeyResponseBody$Outbound = {
  MediaContainer?: GetMetaDataByRatingKeyMediaContainer$Outbound | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyResponseBody$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyResponseBody$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyResponseBody
> = z.object({
  mediaContainer: z.lazy(() =>
    GetMetaDataByRatingKeyMediaContainer$outboundSchema
  ).optional(),
}).transform((v) => {
  return remap$(v, {
    mediaContainer: "MediaContainer",
  });
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyResponseBody$ {
  /** @deprecated use `GetMetaDataByRatingKeyResponseBody$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyResponseBody$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyResponseBody$outboundSchema` instead. */
  export const outboundSchema =
    GetMetaDataByRatingKeyResponseBody$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyResponseBody$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyResponseBody$Outbound;
}

/** @internal */
export const GetMetaDataByRatingKeyResponse$inboundSchema: z.ZodType<
  GetMetaDataByRatingKeyResponse,
  z.ZodTypeDef,
  unknown
> = z.object({
  ContentType: z.string(),
  StatusCode: z.number().int(),
  RawResponse: z.instanceof(Response),
  object: z.lazy(() => GetMetaDataByRatingKeyResponseBody$inboundSchema)
    .optional(),
}).transform((v) => {
  return remap$(v, {
    "ContentType": "contentType",
    "StatusCode": "statusCode",
    "RawResponse": "rawResponse",
  });
});

/** @internal */
export type GetMetaDataByRatingKeyResponse$Outbound = {
  ContentType: string;
  StatusCode: number;
  RawResponse: never;
  object?: GetMetaDataByRatingKeyResponseBody$Outbound | undefined;
};

/** @internal */
export const GetMetaDataByRatingKeyResponse$outboundSchema: z.ZodType<
  GetMetaDataByRatingKeyResponse$Outbound,
  z.ZodTypeDef,
  GetMetaDataByRatingKeyResponse
> = z.object({
  contentType: z.string(),
  statusCode: z.number().int(),
  rawResponse: z.instanceof(Response).transform(() => {
    throw new Error("Response cannot be serialized");
  }),
  object: z.lazy(() => GetMetaDataByRatingKeyResponseBody$outboundSchema)
    .optional(),
}).transform((v) => {
  return remap$(v, {
    contentType: "ContentType",
    statusCode: "StatusCode",
    rawResponse: "RawResponse",
  });
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetMetaDataByRatingKeyResponse$ {
  /** @deprecated use `GetMetaDataByRatingKeyResponse$inboundSchema` instead. */
  export const inboundSchema = GetMetaDataByRatingKeyResponse$inboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyResponse$outboundSchema` instead. */
  export const outboundSchema = GetMetaDataByRatingKeyResponse$outboundSchema;
  /** @deprecated use `GetMetaDataByRatingKeyResponse$Outbound` instead. */
  export type Outbound = GetMetaDataByRatingKeyResponse$Outbound;
}
