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

import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { safeParse } from "../../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { RFCDate } from "../../types/rfcdate.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

/**
 * A key representing a specific tag within the section.
 */
export enum Tag {
  Unwatched = "unwatched",
  Newest = "newest",
  RecentlyAdded = "recentlyAdded",
  RecentlyViewed = "recentlyViewed",
  OnDeck = "onDeck",
  Collection = "collection",
  Edition = "edition",
  Year = "year",
  Decade = "decade",
  Director = "director",
  ContentRating = "contentRating",
  Rating = "rating",
  Resolution = "resolution",
  FirstCharacter = "firstCharacter",
  Folder = "folder",
  Albums = "albums",
}

/**
 * Adds the Guids object to the response
 *
 * @remarks
 */
export enum IncludeGuids {
  Disable = 0,
  Enable = 1,
}

/**
 * The type of media to retrieve or filter by.
 *
 * @remarks
 * 1 = movie
 * 2 = show
 * 3 = season
 * 4 = episode
 * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
 */
export enum GetLibraryItemsQueryParamType {
  Movie = 1,
  TvShow = 2,
  Season = 3,
  Episode = 4,
  Audio = 8,
  Album = 9,
  Track = 10,
}

/**
 * Adds the Meta object to the response
 *
 * @remarks
 */
export enum GetLibraryItemsQueryParamIncludeMeta {
  Disable = 0,
  Enable = 1,
}

export type GetLibraryItemsRequest = {
  /**
   * A key representing a specific tag within the section.
   */
  tag: Tag;
  /**
   * Adds the Guids object to the response
   *
   * @remarks
   */
  includeGuids?: IncludeGuids | undefined;
  /**
   * The type of media to retrieve or filter by.
   *
   * @remarks
   * 1 = movie
   * 2 = show
   * 3 = season
   * 4 = episode
   * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
   */
  type: GetLibraryItemsQueryParamType;
  /**
   * The unique key of the Plex library.
   *
   * @remarks
   * Note: This is unique in the context of the Plex server.
   */
  sectionKey: number;
  /**
   * Adds the Meta object to the response
   *
   * @remarks
   */
  includeMeta?: GetLibraryItemsQueryParamIncludeMeta | undefined;
  /**
   * The index of the first item to return. If not specified, the first item will be returned.
   *
   * @remarks
   * If the number of items exceeds the limit, the response will be paginated.
   * By default this is 0
   */
  xPlexContainerStart?: number | undefined;
  /**
   * The number of items to return. If not specified, all items will be returned.
   *
   * @remarks
   * If the number of items exceeds the limit, the response will be paginated.
   * By default this is 50
   */
  xPlexContainerSize?: number | undefined;
};

export type GetLibraryItemsFilter = {
  filter: string;
  filterType: string;
  key: string;
  title: string;
  type: string;
  advanced?: boolean | undefined;
};

/**
 * The direction of the sort. Can be either `asc` or `desc`.
 *
 * @remarks
 */
export enum GetLibraryItemsActiveDirection {
  Ascending = "asc",
  Descending = "desc",
}

/**
 * The direction of the sort. Can be either `asc` or `desc`.
 *
 * @remarks
 */
export enum GetLibraryItemsDefaultDirection {
  Ascending = "asc",
  Descending = "desc",
}

export type GetLibraryItemsSort = {
  default?: string | undefined;
  active?: boolean | undefined;
  /**
   * The direction of the sort. Can be either `asc` or `desc`.
   *
   * @remarks
   */
  activeDirection?: GetLibraryItemsActiveDirection | undefined;
  /**
   * The direction of the sort. Can be either `asc` or `desc`.
   *
   * @remarks
   */
  defaultDirection?: GetLibraryItemsDefaultDirection | undefined;
  descKey?: string | undefined;
  firstCharacterKey?: string | undefined;
  key: string;
  title: string;
};

export type GetLibraryItemsField = {
  key: string;
  title: string;
  type: string;
  subType?: string | undefined;
};

export type GetLibraryItemsType = {
  key: string;
  type: string;
  subtype?: string | undefined;
  title: string;
  active: boolean;
  filter?: Array<GetLibraryItemsFilter> | undefined;
  sort?: Array<GetLibraryItemsSort> | undefined;
  field?: Array<GetLibraryItemsField> | undefined;
};

export type GetLibraryItemsOperator = {
  key: string;
  title: string;
};

export type GetLibraryItemsFieldType = {
  type: string;
  operator: Array<GetLibraryItemsOperator>;
};

/**
 * The type of media content
 *
 * @remarks
 */
export enum GetLibraryItemsLibraryType {
  Movie = "movie",
  TvShow = "show",
  Season = "season",
  Episode = "episode",
  Artist = "artist",
  Album = "album",
}

/**
 * Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
 */
export enum FlattenSeasons {
  LibraryDefault = "-1",
  Hide = "0",
  Show = "1",
}

/**
 * Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
 */
export enum EpisodeSort {
  LibraryDefault = "-1",
  OldestFirst = "0",
  NewestFirst = "1",
}

/**
 * Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
 */
export enum EnableCreditsMarkerGeneration {
  LibraryDefault = "-1",
  Disabled = "0",
}

/**
 * Setting that indicates the episode ordering for the show.
 *
 * @remarks
 * None = Library default,
 * tmdbAiring = The Movie Database (Aired),
 * aired = TheTVDB (Aired),
 * dvd = TheTVDB (DVD),
 * absolute = TheTVDB (Absolute)).
 */
export enum ShowOrdering {
  None = "None",
  TmdbAiring = "tmdbAiring",
  TvdbAired = "aired",
  TvdbDvd = "dvd",
  TvdbAbsolute = "absolute",
}

export enum GetLibraryItemsOptimizedForStreaming {
  Disable = 0,
  Enable = 1,
}

export enum GetLibraryItemsHasThumbnail {
  False = "0",
  True = "1",
}

export type GetLibraryItemsStream = {
  id: number;
  /**
   * Type of stream (1 = video, 2 = audio, 3 = subtitle)
   */
  streamType: number;
  /**
   * Indicates if this is the default stream
   */
  default?: boolean | undefined;
  /**
   * Indicates if the stream is selected
   */
  selected?: boolean | undefined;
  /**
   * Codec used by the stream
   */
  codec: string;
  /**
   * The index of the stream
   */
  index: number;
  /**
   * The bitrate of the stream in kbps
   */
  bitrate?: number | undefined;
  /**
   * The color primaries of the video stream
   */
  colorPrimaries?: string | undefined;
  /**
   * The color range of the video stream
   */
  colorRange?: string | undefined;
  /**
   * The color space of the video stream
   */
  colorSpace?: string | undefined;
  /**
   * The transfer characteristics (TRC) of the video stream
   */
  colorTrc?: string | undefined;
  /**
   * The bit depth of the video stream
   */
  bitDepth?: number | undefined;
  /**
   * The chroma location of the video stream
   */
  chromaLocation?: string | undefined;
  /**
   * The identifier of the video stream
   */
  streamIdentifier?: string | undefined;
  /**
   * The chroma subsampling format
   */
  chromaSubsampling?: string | undefined;
  /**
   * The coded height of the video stream
   */
  codedHeight?: number | undefined;
  /**
   * The coded width of the video stream
   */
  codedWidth?: number | undefined;
  /**
   * The frame rate of the video stream
   */
  frameRate?: number | undefined;
  /**
   * Indicates if the stream has a scaling matrix
   */
  hasScalingMatrix?: boolean | undefined;
  hearingImpaired?: boolean | undefined;
  closedCaptions?: boolean | undefined;
  embeddedInVideo?: string | undefined;
  /**
   * The height of the video stream
   */
  height?: number | undefined;
  /**
   * The level of the video codec
   */
  level?: number | undefined;
  /**
   * The profile of the video codec
   */
  profile?: string | undefined;
  /**
   * Number of reference frames
   */
  refFrames?: number | undefined;
  /**
   * The scan type (progressive or interlaced)
   */
  scanType?: string | undefined;
  /**
   * The width of the video stream
   */
  width?: number | undefined;
  /**
   * Display title of the stream
   */
  displayTitle?: string | undefined;
  /**
   * Extended display title of the stream
   */
  extendedDisplayTitle?: string | undefined;
  /**
   * Number of audio channels (for audio streams)
   */
  channels?: number | undefined;
  /**
   * The language of the stream (for audio/subtitle streams)
   */
  language?: string | undefined;
  /**
   * Language tag of the stream
   */
  languageTag?: string | undefined;
  /**
   * Language code of the stream
   */
  languageCode?: string | undefined;
  /**
   * The audio channel layout
   */
  audioChannelLayout?: string | undefined;
  /**
   * Sampling rate of the audio stream in Hz
   */
  samplingRate?: number | undefined;
  /**
   * Title of the subtitle track (for subtitle streams)
   */
  title?: string | undefined;
  /**
   * Indicates if the subtitle stream can auto-sync
   */
  canAutoSync?: boolean | undefined;
};

export type GetLibraryItemsPart = {
  id: number;
  key: string;
  duration?: number | undefined;
  file: string;
  size: number;
  /**
   * The container format of the media file.
   *
   * @remarks
   */
  container: string;
  audioProfile?: string | undefined;
  has64bitOffsets?: boolean | undefined;
  optimizedForStreaming?: boolean | undefined;
  videoProfile?: string | undefined;
  indexes?: string | undefined;
  hasThumbnail?: GetLibraryItemsHasThumbnail | undefined;
  stream?: Array<GetLibraryItemsStream> | undefined;
};

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

export type GetLibraryItemsGenre = {
  tag?: string | undefined;
};

export type GetLibraryItemsCountry = {
  tag?: string | undefined;
};

export type GetLibraryItemsDirector = {
  tag?: string | undefined;
};

export type GetLibraryItemsWriter = {
  tag?: string | undefined;
};

export type GetLibraryItemsCollection = {
  tag?: string | undefined;
};

export type GetLibraryItemsRole = {
  /**
   * The ID of the tag or actor.
   */
  id?: number | undefined;
  /**
   * The filter used to find the actor or tag.
   */
  filter?: string | undefined;
  /**
   * The thumbnail of the actor
   */
  thumb?: string | undefined;
  /**
   * The name of the tag or actor.
   */
  tag?: string | undefined;
  /**
   * Unique identifier for the tag.
   */
  tagKey?: string | undefined;
  /**
   * The role of the actor or tag in the media.
   */
  role?: string | undefined;
};

export type GetLibraryItemsLocation = {
  path?: string | undefined;
};

export type MediaGuid = {
  /**
   * Can be one of the following formats:
   *
   * @remarks
   * imdb://tt13015952, tmdb://2434012, tvdb://7945991
   */
  id: string;
};

export type GetLibraryItemsUltraBlurColors = {
  topLeft: string;
  topRight: string;
  bottomRight: string;
  bottomLeft: string;
};

export type MetaDataRating = {
  /**
   * A URI or path to the rating image.
   */
  image: string;
  /**
   * The value of the rating.
   */
  value: number;
  /**
   * The type of rating (e.g., audience, critic).
   */
  type: string;
};

export enum GetLibraryItemsLibraryResponse200Type {
  CoverPoster = "coverPoster",
  Background = "background",
  Snapshot = "snapshot",
  ClearLogo = "clearLogo",
}

export type GetLibraryItemsImage = {
  alt: string;
  type: GetLibraryItemsLibraryResponse200Type;
  url: string;
};

export type GetLibraryItemsMetadata = {
  /**
   * The rating key (Media ID) of this media item.
   *
   * @remarks
   * Note: This is always an integer, but is represented as a string in the API.
   */
  ratingKey: string;
  key: string;
  guid: string;
  studio?: string | undefined;
  skipChildren?: boolean | undefined;
  librarySectionID?: number | undefined;
  librarySectionTitle?: string | undefined;
  librarySectionKey?: string | undefined;
  /**
   * The type of media content
   *
   * @remarks
   */
  type: GetLibraryItemsLibraryType;
  title: string;
  slug?: string | undefined;
  contentRating?: string | undefined;
  summary: string;
  rating?: number | undefined;
  audienceRating?: number | undefined;
  year?: number | undefined;
  seasonCount?: number | undefined;
  tagline?: string | undefined;
  /**
   * Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
   */
  flattenSeasons?: FlattenSeasons | undefined;
  /**
   * Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
   */
  episodeSort?: EpisodeSort | undefined;
  /**
   * Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
   */
  enableCreditsMarkerGeneration?: EnableCreditsMarkerGeneration | undefined;
  /**
   * Setting that indicates the episode ordering for the show.
   *
   * @remarks
   * None = Library default,
   * tmdbAiring = The Movie Database (Aired),
   * aired = TheTVDB (Aired),
   * dvd = TheTVDB (DVD),
   * absolute = TheTVDB (Absolute)).
   */
  showOrdering?: ShowOrdering | undefined;
  thumb?: string | undefined;
  art?: string | undefined;
  banner?: string | undefined;
  duration?: number | undefined;
  originallyAvailableAt?: RFCDate | undefined;
  /**
   * Unix epoch datetime in seconds
   */
  addedAt: number;
  /**
   * Unix epoch datetime in seconds
   */
  updatedAt?: number | undefined;
  audienceRatingImage?: string | undefined;
  chapterSource?: string | undefined;
  primaryExtraKey?: string | undefined;
  ratingImage?: string | undefined;
  grandparentRatingKey?: string | undefined;
  grandparentGuid?: string | undefined;
  grandparentKey?: string | undefined;
  grandparentTitle?: string | undefined;
  grandparentThumb?: string | undefined;
  parentSlug?: string | undefined;
  grandparentSlug?: string | undefined;
  grandparentArt?: string | undefined;
  grandparentTheme?: string | undefined;
  /**
   * The Media object is only included when type query is `4` or higher.
   *
   * @remarks
   */
  media?: Array<GetLibraryItemsMedia> | undefined;
  genre?: Array<GetLibraryItemsGenre> | undefined;
  country?: Array<GetLibraryItemsCountry> | undefined;
  director?: Array<GetLibraryItemsDirector> | undefined;
  writer?: Array<GetLibraryItemsWriter> | undefined;
  collection?: Array<GetLibraryItemsCollection> | undefined;
  role?: Array<GetLibraryItemsRole> | undefined;
  location?: Array<GetLibraryItemsLocation> | undefined;
  /**
   * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
   *
   * @remarks
   */
  mediaGuid?: Array<MediaGuid> | undefined;
  ultraBlurColors?: GetLibraryItemsUltraBlurColors | undefined;
  metaDataRating?: Array<MetaDataRating> | undefined;
  image?: Array<GetLibraryItemsImage> | undefined;
  titleSort?: string | undefined;
  viewCount?: number | undefined;
  lastViewedAt?: number | undefined;
  originalTitle?: string | undefined;
  viewOffset?: number | undefined;
  skipCount?: number | undefined;
  index?: number | undefined;
  theme?: string | undefined;
  leafCount?: number | undefined;
  viewedLeafCount?: number | undefined;
  childCount?: number | undefined;
  hasPremiumExtras?: string | undefined;
  hasPremiumPrimaryExtra?: string | undefined;
  /**
   * The rating key of the parent item.
   *
   * @remarks
   */
  parentRatingKey?: string | undefined;
  parentGuid?: string | undefined;
  parentStudio?: string | undefined;
  parentKey?: string | undefined;
  parentTitle?: string | undefined;
  parentIndex?: number | undefined;
  parentYear?: number | undefined;
  parentThumb?: string | undefined;
  parentTheme?: string | undefined;
};

export type GetLibraryItemsLibraryFilter = {
  filter: string;
  filterType: string;
  key: string;
  title: string;
  type: string;
};

/**
 * The direction of the sort. Can be either `asc` or `desc`.
 *
 * @remarks
 */
export enum GetLibraryItemsLibraryActiveDirection {
  Ascending = "asc",
  Descending = "desc",
}

/**
 * The direction of the sort. Can be either `asc` or `desc`.
 *
 * @remarks
 */
export enum GetLibraryItemsLibraryDefaultDirection {
  Ascending = "asc",
  Descending = "desc",
}

export type GetLibraryItemsLibrarySort = {
  default?: string | undefined;
  active?: boolean | undefined;
  /**
   * The direction of the sort. Can be either `asc` or `desc`.
   *
   * @remarks
   */
  activeDirection?: GetLibraryItemsLibraryActiveDirection | undefined;
  /**
   * The direction of the sort. Can be either `asc` or `desc`.
   *
   * @remarks
   */
  defaultDirection?: GetLibraryItemsLibraryDefaultDirection | undefined;
  descKey?: string | undefined;
  firstCharacterKey?: string | undefined;
  key: string;
  title: string;
};

export type GetLibraryItemsLibraryField = {
  key: string;
  title: string;
  type: string;
  subType?: string | undefined;
};

export type GetLibraryItemsLibraryResponseType = {
  key: string;
  type: string;
  title: string;
  active: boolean;
  filter?: Array<GetLibraryItemsLibraryFilter> | undefined;
  sort?: Array<GetLibraryItemsLibrarySort> | undefined;
  field?: Array<GetLibraryItemsLibraryField> | undefined;
};

export type GetLibraryItemsLibraryOperator = {
  key: string;
  title: string;
};

export type GetLibraryItemsLibraryFieldType = {
  type: string;
  operator: Array<GetLibraryItemsLibraryOperator>;
};

/**
 * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
 *
 * @remarks
 */
export type GetLibraryItemsMeta = {
  type?: Array<GetLibraryItemsLibraryResponseType> | undefined;
  fieldType?: Array<GetLibraryItemsLibraryFieldType> | undefined;
};

/**
 * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
 *
 * @remarks
 */
export type GetLibraryItemsMediaContainer = {
  type?: Array<GetLibraryItemsType> | undefined;
  fieldType?: Array<GetLibraryItemsFieldType> | undefined;
  size: number;
  totalSize: number;
  offset: number;
  content: string;
  allowSync: boolean;
  nocache?: boolean | undefined;
  art: string;
  identifier: string;
  librarySectionID: number;
  librarySectionTitle: string;
  librarySectionUUID: string;
  mediaTagPrefix: string;
  mediaTagVersion: number;
  thumb: string;
  title1: string;
  title2: string;
  viewGroup: string;
  viewMode?: number | undefined;
  mixedParents?: boolean | undefined;
  metadata?: Array<GetLibraryItemsMetadata> | undefined;
  /**
   * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
   *
   * @remarks
   */
  meta?: GetLibraryItemsMeta | undefined;
};

/**
 * The contents of the library by section and tag
 */
export type GetLibraryItemsResponseBody = {
  mediaContainer?: GetLibraryItemsMediaContainer | undefined;
};

export type GetLibraryItemsResponse = {
  /**
   * 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 contents of the library by section and tag
   */
  object?: GetLibraryItemsResponseBody | undefined;
};

/** @internal */
export const Tag$inboundSchema: z.ZodNativeEnum<typeof Tag> = z.nativeEnum(Tag);

/** @internal */
export const Tag$outboundSchema: z.ZodNativeEnum<typeof Tag> =
  Tag$inboundSchema;

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

/** @internal */
export const IncludeGuids$inboundSchema: z.ZodNativeEnum<typeof IncludeGuids> =
  z.nativeEnum(IncludeGuids);

/** @internal */
export const IncludeGuids$outboundSchema: z.ZodNativeEnum<typeof IncludeGuids> =
  IncludeGuids$inboundSchema;

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

/** @internal */
export const GetLibraryItemsQueryParamType$inboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsQueryParamType
> = z.nativeEnum(GetLibraryItemsQueryParamType);

/** @internal */
export const GetLibraryItemsQueryParamType$outboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsQueryParamType
> = GetLibraryItemsQueryParamType$inboundSchema;

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

/** @internal */
export const GetLibraryItemsQueryParamIncludeMeta$inboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsQueryParamIncludeMeta> = z.nativeEnum(
    GetLibraryItemsQueryParamIncludeMeta,
  );

/** @internal */
export const GetLibraryItemsQueryParamIncludeMeta$outboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsQueryParamIncludeMeta> =
    GetLibraryItemsQueryParamIncludeMeta$inboundSchema;

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

/** @internal */
export const GetLibraryItemsRequest$inboundSchema: z.ZodType<
  GetLibraryItemsRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  tag: Tag$inboundSchema,
  includeGuids: IncludeGuids$inboundSchema,
  type: GetLibraryItemsQueryParamType$inboundSchema,
  sectionKey: z.number().int(),
  includeMeta: GetLibraryItemsQueryParamIncludeMeta$inboundSchema,
  "X-Plex-Container-Start": z.number().int().default(0),
  "X-Plex-Container-Size": z.number().int().default(50),
}).transform((v) => {
  return remap$(v, {
    "X-Plex-Container-Start": "xPlexContainerStart",
    "X-Plex-Container-Size": "xPlexContainerSize",
  });
});

/** @internal */
export type GetLibraryItemsRequest$Outbound = {
  tag: string;
  includeGuids: number;
  type: number;
  sectionKey: number;
  includeMeta: number;
  "X-Plex-Container-Start": number;
  "X-Plex-Container-Size": number;
};

/** @internal */
export const GetLibraryItemsRequest$outboundSchema: z.ZodType<
  GetLibraryItemsRequest$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsRequest
> = z.object({
  tag: Tag$outboundSchema,
  includeGuids: IncludeGuids$outboundSchema.default(IncludeGuids.Disable),
  type: GetLibraryItemsQueryParamType$outboundSchema,
  sectionKey: z.number().int(),
  includeMeta: GetLibraryItemsQueryParamIncludeMeta$outboundSchema.default(
    GetLibraryItemsQueryParamIncludeMeta.Disable,
  ),
  xPlexContainerStart: z.number().int().default(0),
  xPlexContainerSize: z.number().int().default(50),
}).transform((v) => {
  return remap$(v, {
    xPlexContainerStart: "X-Plex-Container-Start",
    xPlexContainerSize: "X-Plex-Container-Size",
  });
});

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

export function getLibraryItemsRequestToJSON(
  getLibraryItemsRequest: GetLibraryItemsRequest,
): string {
  return JSON.stringify(
    GetLibraryItemsRequest$outboundSchema.parse(getLibraryItemsRequest),
  );
}

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

/** @internal */
export const GetLibraryItemsFilter$inboundSchema: z.ZodType<
  GetLibraryItemsFilter,
  z.ZodTypeDef,
  unknown
> = z.object({
  filter: z.string(),
  filterType: z.string(),
  key: z.string(),
  title: z.string(),
  type: z.string(),
  advanced: z.boolean().optional(),
});

/** @internal */
export type GetLibraryItemsFilter$Outbound = {
  filter: string;
  filterType: string;
  key: string;
  title: string;
  type: string;
  advanced?: boolean | undefined;
};

/** @internal */
export const GetLibraryItemsFilter$outboundSchema: z.ZodType<
  GetLibraryItemsFilter$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsFilter
> = z.object({
  filter: z.string(),
  filterType: z.string(),
  key: z.string(),
  title: z.string(),
  type: z.string(),
  advanced: z.boolean().optional(),
});

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

export function getLibraryItemsFilterToJSON(
  getLibraryItemsFilter: GetLibraryItemsFilter,
): string {
  return JSON.stringify(
    GetLibraryItemsFilter$outboundSchema.parse(getLibraryItemsFilter),
  );
}

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

/** @internal */
export const GetLibraryItemsActiveDirection$inboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsActiveDirection
> = z.nativeEnum(GetLibraryItemsActiveDirection);

/** @internal */
export const GetLibraryItemsActiveDirection$outboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsActiveDirection
> = GetLibraryItemsActiveDirection$inboundSchema;

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

/** @internal */
export const GetLibraryItemsDefaultDirection$inboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsDefaultDirection
> = z.nativeEnum(GetLibraryItemsDefaultDirection);

/** @internal */
export const GetLibraryItemsDefaultDirection$outboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsDefaultDirection
> = GetLibraryItemsDefaultDirection$inboundSchema;

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

/** @internal */
export const GetLibraryItemsSort$inboundSchema: z.ZodType<
  GetLibraryItemsSort,
  z.ZodTypeDef,
  unknown
> = z.object({
  default: z.string().optional(),
  active: z.boolean().optional(),
  activeDirection: GetLibraryItemsActiveDirection$inboundSchema.default(
    GetLibraryItemsActiveDirection.Ascending,
  ),
  defaultDirection: GetLibraryItemsDefaultDirection$inboundSchema.default(
    GetLibraryItemsDefaultDirection.Ascending,
  ),
  descKey: z.string().optional(),
  firstCharacterKey: z.string().optional(),
  key: z.string(),
  title: z.string(),
});

/** @internal */
export type GetLibraryItemsSort$Outbound = {
  default?: string | undefined;
  active?: boolean | undefined;
  activeDirection: string;
  defaultDirection: string;
  descKey?: string | undefined;
  firstCharacterKey?: string | undefined;
  key: string;
  title: string;
};

/** @internal */
export const GetLibraryItemsSort$outboundSchema: z.ZodType<
  GetLibraryItemsSort$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsSort
> = z.object({
  default: z.string().optional(),
  active: z.boolean().optional(),
  activeDirection: GetLibraryItemsActiveDirection$outboundSchema.default(
    GetLibraryItemsActiveDirection.Ascending,
  ),
  defaultDirection: GetLibraryItemsDefaultDirection$outboundSchema.default(
    GetLibraryItemsDefaultDirection.Ascending,
  ),
  descKey: z.string().optional(),
  firstCharacterKey: z.string().optional(),
  key: z.string(),
  title: z.string(),
});

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

export function getLibraryItemsSortToJSON(
  getLibraryItemsSort: GetLibraryItemsSort,
): string {
  return JSON.stringify(
    GetLibraryItemsSort$outboundSchema.parse(getLibraryItemsSort),
  );
}

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

/** @internal */
export const GetLibraryItemsField$inboundSchema: z.ZodType<
  GetLibraryItemsField,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: z.string(),
  title: z.string(),
  type: z.string(),
  subType: z.string().optional(),
});

/** @internal */
export type GetLibraryItemsField$Outbound = {
  key: string;
  title: string;
  type: string;
  subType?: string | undefined;
};

/** @internal */
export const GetLibraryItemsField$outboundSchema: z.ZodType<
  GetLibraryItemsField$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsField
> = z.object({
  key: z.string(),
  title: z.string(),
  type: z.string(),
  subType: 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 GetLibraryItemsField$ {
  /** @deprecated use `GetLibraryItemsField$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsField$inboundSchema;
  /** @deprecated use `GetLibraryItemsField$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsField$outboundSchema;
  /** @deprecated use `GetLibraryItemsField$Outbound` instead. */
  export type Outbound = GetLibraryItemsField$Outbound;
}

export function getLibraryItemsFieldToJSON(
  getLibraryItemsField: GetLibraryItemsField,
): string {
  return JSON.stringify(
    GetLibraryItemsField$outboundSchema.parse(getLibraryItemsField),
  );
}

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

/** @internal */
export const GetLibraryItemsType$inboundSchema: z.ZodType<
  GetLibraryItemsType,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: z.string(),
  type: z.string(),
  subtype: z.string().optional(),
  title: z.string(),
  active: z.boolean(),
  Filter: z.array(z.lazy(() => GetLibraryItemsFilter$inboundSchema)).optional(),
  Sort: z.array(z.lazy(() => GetLibraryItemsSort$inboundSchema)).optional(),
  Field: z.array(z.lazy(() => GetLibraryItemsField$inboundSchema)).optional(),
}).transform((v) => {
  return remap$(v, {
    "Filter": "filter",
    "Sort": "sort",
    "Field": "field",
  });
});

/** @internal */
export type GetLibraryItemsType$Outbound = {
  key: string;
  type: string;
  subtype?: string | undefined;
  title: string;
  active: boolean;
  Filter?: Array<GetLibraryItemsFilter$Outbound> | undefined;
  Sort?: Array<GetLibraryItemsSort$Outbound> | undefined;
  Field?: Array<GetLibraryItemsField$Outbound> | undefined;
};

/** @internal */
export const GetLibraryItemsType$outboundSchema: z.ZodType<
  GetLibraryItemsType$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsType
> = z.object({
  key: z.string(),
  type: z.string(),
  subtype: z.string().optional(),
  title: z.string(),
  active: z.boolean(),
  filter: z.array(z.lazy(() => GetLibraryItemsFilter$outboundSchema))
    .optional(),
  sort: z.array(z.lazy(() => GetLibraryItemsSort$outboundSchema)).optional(),
  field: z.array(z.lazy(() => GetLibraryItemsField$outboundSchema)).optional(),
}).transform((v) => {
  return remap$(v, {
    filter: "Filter",
    sort: "Sort",
    field: "Field",
  });
});

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

export function getLibraryItemsTypeToJSON(
  getLibraryItemsType: GetLibraryItemsType,
): string {
  return JSON.stringify(
    GetLibraryItemsType$outboundSchema.parse(getLibraryItemsType),
  );
}

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

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

/** @internal */
export type GetLibraryItemsOperator$Outbound = {
  key: string;
  title: string;
};

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

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

export function getLibraryItemsOperatorToJSON(
  getLibraryItemsOperator: GetLibraryItemsOperator,
): string {
  return JSON.stringify(
    GetLibraryItemsOperator$outboundSchema.parse(getLibraryItemsOperator),
  );
}

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

/** @internal */
export const GetLibraryItemsFieldType$inboundSchema: z.ZodType<
  GetLibraryItemsFieldType,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: z.string(),
  Operator: z.array(z.lazy(() => GetLibraryItemsOperator$inboundSchema)),
}).transform((v) => {
  return remap$(v, {
    "Operator": "operator",
  });
});

/** @internal */
export type GetLibraryItemsFieldType$Outbound = {
  type: string;
  Operator: Array<GetLibraryItemsOperator$Outbound>;
};

/** @internal */
export const GetLibraryItemsFieldType$outboundSchema: z.ZodType<
  GetLibraryItemsFieldType$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsFieldType
> = z.object({
  type: z.string(),
  operator: z.array(z.lazy(() => GetLibraryItemsOperator$outboundSchema)),
}).transform((v) => {
  return remap$(v, {
    operator: "Operator",
  });
});

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

export function getLibraryItemsFieldTypeToJSON(
  getLibraryItemsFieldType: GetLibraryItemsFieldType,
): string {
  return JSON.stringify(
    GetLibraryItemsFieldType$outboundSchema.parse(getLibraryItemsFieldType),
  );
}

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

/** @internal */
export const GetLibraryItemsLibraryType$inboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsLibraryType
> = z.nativeEnum(GetLibraryItemsLibraryType);

/** @internal */
export const GetLibraryItemsLibraryType$outboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsLibraryType
> = GetLibraryItemsLibraryType$inboundSchema;

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

/** @internal */
export const FlattenSeasons$inboundSchema: z.ZodNativeEnum<
  typeof FlattenSeasons
> = z.nativeEnum(FlattenSeasons);

/** @internal */
export const FlattenSeasons$outboundSchema: z.ZodNativeEnum<
  typeof FlattenSeasons
> = FlattenSeasons$inboundSchema;

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

/** @internal */
export const EpisodeSort$inboundSchema: z.ZodNativeEnum<typeof EpisodeSort> = z
  .nativeEnum(EpisodeSort);

/** @internal */
export const EpisodeSort$outboundSchema: z.ZodNativeEnum<typeof EpisodeSort> =
  EpisodeSort$inboundSchema;

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

/** @internal */
export const EnableCreditsMarkerGeneration$inboundSchema: z.ZodNativeEnum<
  typeof EnableCreditsMarkerGeneration
> = z.nativeEnum(EnableCreditsMarkerGeneration);

/** @internal */
export const EnableCreditsMarkerGeneration$outboundSchema: z.ZodNativeEnum<
  typeof EnableCreditsMarkerGeneration
> = EnableCreditsMarkerGeneration$inboundSchema;

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

/** @internal */
export const ShowOrdering$inboundSchema: z.ZodNativeEnum<typeof ShowOrdering> =
  z.nativeEnum(ShowOrdering);

/** @internal */
export const ShowOrdering$outboundSchema: z.ZodNativeEnum<typeof ShowOrdering> =
  ShowOrdering$inboundSchema;

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

/** @internal */
export const GetLibraryItemsOptimizedForStreaming$inboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsOptimizedForStreaming> = z.nativeEnum(
    GetLibraryItemsOptimizedForStreaming,
  );

/** @internal */
export const GetLibraryItemsOptimizedForStreaming$outboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsOptimizedForStreaming> =
    GetLibraryItemsOptimizedForStreaming$inboundSchema;

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

/** @internal */
export const GetLibraryItemsHasThumbnail$inboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsHasThumbnail
> = z.nativeEnum(GetLibraryItemsHasThumbnail);

/** @internal */
export const GetLibraryItemsHasThumbnail$outboundSchema: z.ZodNativeEnum<
  typeof GetLibraryItemsHasThumbnail
> = GetLibraryItemsHasThumbnail$inboundSchema;

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

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

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

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

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

export function getLibraryItemsStreamToJSON(
  getLibraryItemsStream: GetLibraryItemsStream,
): string {
  return JSON.stringify(
    GetLibraryItemsStream$outboundSchema.parse(getLibraryItemsStream),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsPart$outboundSchema: z.ZodType<
  GetLibraryItemsPart$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsPart
> = z.object({
  id: z.number().int(),
  key: z.string(),
  duration: z.number().int().optional(),
  file: z.string(),
  size: z.number().int(),
  container: z.string(),
  audioProfile: z.string().optional(),
  has64bitOffsets: z.boolean().optional(),
  optimizedForStreaming: z.boolean().optional(),
  videoProfile: z.string().optional(),
  indexes: z.string().optional(),
  hasThumbnail: GetLibraryItemsHasThumbnail$outboundSchema.default(
    GetLibraryItemsHasThumbnail.False,
  ),
  stream: z.array(z.lazy(() => GetLibraryItemsStream$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 GetLibraryItemsPart$ {
  /** @deprecated use `GetLibraryItemsPart$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsPart$inboundSchema;
  /** @deprecated use `GetLibraryItemsPart$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsPart$outboundSchema;
  /** @deprecated use `GetLibraryItemsPart$Outbound` instead. */
  export type Outbound = GetLibraryItemsPart$Outbound;
}

export function getLibraryItemsPartToJSON(
  getLibraryItemsPart: GetLibraryItemsPart,
): string {
  return JSON.stringify(
    GetLibraryItemsPart$outboundSchema.parse(getLibraryItemsPart),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsMedia$outboundSchema: z.ZodType<
  GetLibraryItemsMedia$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsMedia
> = z.object({
  id: z.number().int(),
  duration: z.number().int().optional(),
  bitrate: z.number().int().optional(),
  width: z.number().int().optional(),
  height: z.number().int().optional(),
  aspectRatio: z.number().optional(),
  audioProfile: z.string().optional(),
  audioChannels: z.number().int().optional(),
  audioCodec: z.string().optional(),
  videoCodec: z.string().optional(),
  videoResolution: z.string().optional(),
  container: z.string(),
  videoFrameRate: z.string().optional(),
  videoProfile: z.string().optional(),
  hasVoiceActivity: z.boolean().optional(),
  optimizedForStreaming: GetLibraryItemsOptimizedForStreaming$outboundSchema
    .default(GetLibraryItemsOptimizedForStreaming.Disable),
  has64bitOffsets: z.boolean().optional(),
  part: z.array(z.lazy(() => GetLibraryItemsPart$outboundSchema)),
}).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 GetLibraryItemsMedia$ {
  /** @deprecated use `GetLibraryItemsMedia$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsMedia$inboundSchema;
  /** @deprecated use `GetLibraryItemsMedia$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsMedia$outboundSchema;
  /** @deprecated use `GetLibraryItemsMedia$Outbound` instead. */
  export type Outbound = GetLibraryItemsMedia$Outbound;
}

export function getLibraryItemsMediaToJSON(
  getLibraryItemsMedia: GetLibraryItemsMedia,
): string {
  return JSON.stringify(
    GetLibraryItemsMedia$outboundSchema.parse(getLibraryItemsMedia),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsGenre$outboundSchema: z.ZodType<
  GetLibraryItemsGenre$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsGenre
> = z.object({
  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 GetLibraryItemsGenre$ {
  /** @deprecated use `GetLibraryItemsGenre$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsGenre$inboundSchema;
  /** @deprecated use `GetLibraryItemsGenre$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsGenre$outboundSchema;
  /** @deprecated use `GetLibraryItemsGenre$Outbound` instead. */
  export type Outbound = GetLibraryItemsGenre$Outbound;
}

export function getLibraryItemsGenreToJSON(
  getLibraryItemsGenre: GetLibraryItemsGenre,
): string {
  return JSON.stringify(
    GetLibraryItemsGenre$outboundSchema.parse(getLibraryItemsGenre),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsCountry$outboundSchema: z.ZodType<
  GetLibraryItemsCountry$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsCountry
> = z.object({
  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 GetLibraryItemsCountry$ {
  /** @deprecated use `GetLibraryItemsCountry$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsCountry$inboundSchema;
  /** @deprecated use `GetLibraryItemsCountry$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsCountry$outboundSchema;
  /** @deprecated use `GetLibraryItemsCountry$Outbound` instead. */
  export type Outbound = GetLibraryItemsCountry$Outbound;
}

export function getLibraryItemsCountryToJSON(
  getLibraryItemsCountry: GetLibraryItemsCountry,
): string {
  return JSON.stringify(
    GetLibraryItemsCountry$outboundSchema.parse(getLibraryItemsCountry),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsDirector$outboundSchema: z.ZodType<
  GetLibraryItemsDirector$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsDirector
> = z.object({
  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 GetLibraryItemsDirector$ {
  /** @deprecated use `GetLibraryItemsDirector$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsDirector$inboundSchema;
  /** @deprecated use `GetLibraryItemsDirector$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsDirector$outboundSchema;
  /** @deprecated use `GetLibraryItemsDirector$Outbound` instead. */
  export type Outbound = GetLibraryItemsDirector$Outbound;
}

export function getLibraryItemsDirectorToJSON(
  getLibraryItemsDirector: GetLibraryItemsDirector,
): string {
  return JSON.stringify(
    GetLibraryItemsDirector$outboundSchema.parse(getLibraryItemsDirector),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsWriter$outboundSchema: z.ZodType<
  GetLibraryItemsWriter$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsWriter
> = z.object({
  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 GetLibraryItemsWriter$ {
  /** @deprecated use `GetLibraryItemsWriter$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsWriter$inboundSchema;
  /** @deprecated use `GetLibraryItemsWriter$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsWriter$outboundSchema;
  /** @deprecated use `GetLibraryItemsWriter$Outbound` instead. */
  export type Outbound = GetLibraryItemsWriter$Outbound;
}

export function getLibraryItemsWriterToJSON(
  getLibraryItemsWriter: GetLibraryItemsWriter,
): string {
  return JSON.stringify(
    GetLibraryItemsWriter$outboundSchema.parse(getLibraryItemsWriter),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsCollection$outboundSchema: z.ZodType<
  GetLibraryItemsCollection$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsCollection
> = z.object({
  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 GetLibraryItemsCollection$ {
  /** @deprecated use `GetLibraryItemsCollection$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsCollection$inboundSchema;
  /** @deprecated use `GetLibraryItemsCollection$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsCollection$outboundSchema;
  /** @deprecated use `GetLibraryItemsCollection$Outbound` instead. */
  export type Outbound = GetLibraryItemsCollection$Outbound;
}

export function getLibraryItemsCollectionToJSON(
  getLibraryItemsCollection: GetLibraryItemsCollection,
): string {
  return JSON.stringify(
    GetLibraryItemsCollection$outboundSchema.parse(getLibraryItemsCollection),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsRole$outboundSchema: z.ZodType<
  GetLibraryItemsRole$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsRole
> = z.object({
  id: z.number().int().optional(),
  filter: z.string().optional(),
  thumb: z.string().optional(),
  tag: z.string().optional(),
  tagKey: z.string().optional(),
  role: 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 GetLibraryItemsRole$ {
  /** @deprecated use `GetLibraryItemsRole$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsRole$inboundSchema;
  /** @deprecated use `GetLibraryItemsRole$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsRole$outboundSchema;
  /** @deprecated use `GetLibraryItemsRole$Outbound` instead. */
  export type Outbound = GetLibraryItemsRole$Outbound;
}

export function getLibraryItemsRoleToJSON(
  getLibraryItemsRole: GetLibraryItemsRole,
): string {
  return JSON.stringify(
    GetLibraryItemsRole$outboundSchema.parse(getLibraryItemsRole),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsLocation$outboundSchema: z.ZodType<
  GetLibraryItemsLocation$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsLocation
> = z.object({
  path: 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 GetLibraryItemsLocation$ {
  /** @deprecated use `GetLibraryItemsLocation$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsLocation$inboundSchema;
  /** @deprecated use `GetLibraryItemsLocation$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsLocation$outboundSchema;
  /** @deprecated use `GetLibraryItemsLocation$Outbound` instead. */
  export type Outbound = GetLibraryItemsLocation$Outbound;
}

export function getLibraryItemsLocationToJSON(
  getLibraryItemsLocation: GetLibraryItemsLocation,
): string {
  return JSON.stringify(
    GetLibraryItemsLocation$outboundSchema.parse(getLibraryItemsLocation),
  );
}

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

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

/** @internal */
export type MediaGuid$Outbound = {
  id: string;
};

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

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

export function mediaGuidToJSON(mediaGuid: MediaGuid): string {
  return JSON.stringify(MediaGuid$outboundSchema.parse(mediaGuid));
}

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

/** @internal */
export const GetLibraryItemsUltraBlurColors$inboundSchema: z.ZodType<
  GetLibraryItemsUltraBlurColors,
  z.ZodTypeDef,
  unknown
> = z.object({
  topLeft: z.string(),
  topRight: z.string(),
  bottomRight: z.string(),
  bottomLeft: z.string(),
});

/** @internal */
export type GetLibraryItemsUltraBlurColors$Outbound = {
  topLeft: string;
  topRight: string;
  bottomRight: string;
  bottomLeft: string;
};

/** @internal */
export const GetLibraryItemsUltraBlurColors$outboundSchema: z.ZodType<
  GetLibraryItemsUltraBlurColors$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsUltraBlurColors
> = z.object({
  topLeft: z.string(),
  topRight: z.string(),
  bottomRight: z.string(),
  bottomLeft: z.string(),
});

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

export function getLibraryItemsUltraBlurColorsToJSON(
  getLibraryItemsUltraBlurColors: GetLibraryItemsUltraBlurColors,
): string {
  return JSON.stringify(
    GetLibraryItemsUltraBlurColors$outboundSchema.parse(
      getLibraryItemsUltraBlurColors,
    ),
  );
}

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

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

/** @internal */
export type MetaDataRating$Outbound = {
  image: string;
  value: number;
  type: string;
};

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

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

export function metaDataRatingToJSON(metaDataRating: MetaDataRating): string {
  return JSON.stringify(MetaDataRating$outboundSchema.parse(metaDataRating));
}

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

/** @internal */
export const GetLibraryItemsLibraryResponse200Type$inboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsLibraryResponse200Type> = z.nativeEnum(
    GetLibraryItemsLibraryResponse200Type,
  );

/** @internal */
export const GetLibraryItemsLibraryResponse200Type$outboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsLibraryResponse200Type> =
    GetLibraryItemsLibraryResponse200Type$inboundSchema;

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

/** @internal */
export const GetLibraryItemsImage$inboundSchema: z.ZodType<
  GetLibraryItemsImage,
  z.ZodTypeDef,
  unknown
> = z.object({
  alt: z.string(),
  type: GetLibraryItemsLibraryResponse200Type$inboundSchema,
  url: z.string(),
});

/** @internal */
export type GetLibraryItemsImage$Outbound = {
  alt: string;
  type: string;
  url: string;
};

/** @internal */
export const GetLibraryItemsImage$outboundSchema: z.ZodType<
  GetLibraryItemsImage$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsImage
> = z.object({
  alt: z.string(),
  type: GetLibraryItemsLibraryResponse200Type$outboundSchema,
  url: z.string(),
});

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

export function getLibraryItemsImageToJSON(
  getLibraryItemsImage: GetLibraryItemsImage,
): string {
  return JSON.stringify(
    GetLibraryItemsImage$outboundSchema.parse(getLibraryItemsImage),
  );
}

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

/** @internal */
export const GetLibraryItemsMetadata$inboundSchema: z.ZodType<
  GetLibraryItemsMetadata,
  z.ZodTypeDef,
  unknown
> = z.object({
  ratingKey: z.string(),
  key: z.string(),
  guid: z.string(),
  studio: z.string().optional(),
  skipChildren: z.boolean().optional(),
  librarySectionID: z.number().int().optional(),
  librarySectionTitle: z.string().optional(),
  librarySectionKey: z.string().optional(),
  type: GetLibraryItemsLibraryType$inboundSchema,
  title: z.string(),
  slug: z.string().optional(),
  contentRating: z.string().optional(),
  summary: z.string(),
  rating: z.number().optional(),
  audienceRating: z.number().optional(),
  year: z.number().int().optional(),
  seasonCount: z.number().int().optional(),
  tagline: z.string().optional(),
  flattenSeasons: FlattenSeasons$inboundSchema.optional(),
  episodeSort: EpisodeSort$inboundSchema.optional(),
  enableCreditsMarkerGeneration: EnableCreditsMarkerGeneration$inboundSchema
    .optional(),
  showOrdering: ShowOrdering$inboundSchema.optional(),
  thumb: z.string().optional(),
  art: z.string().optional(),
  banner: z.string().optional(),
  duration: z.number().int().optional(),
  originallyAvailableAt: z.string().transform(v => new RFCDate(v)).optional(),
  addedAt: z.number().int(),
  updatedAt: z.number().int().optional(),
  audienceRatingImage: z.string().optional(),
  chapterSource: z.string().optional(),
  primaryExtraKey: z.string().optional(),
  ratingImage: z.string().optional(),
  grandparentRatingKey: z.string().optional(),
  grandparentGuid: z.string().optional(),
  grandparentKey: z.string().optional(),
  grandparentTitle: z.string().optional(),
  grandparentThumb: z.string().optional(),
  parentSlug: z.string().optional(),
  grandparentSlug: z.string().optional(),
  grandparentArt: z.string().optional(),
  grandparentTheme: z.string().optional(),
  Media: z.array(z.lazy(() => GetLibraryItemsMedia$inboundSchema)).optional(),
  Genre: z.array(z.lazy(() => GetLibraryItemsGenre$inboundSchema)).optional(),
  Country: z.array(z.lazy(() => GetLibraryItemsCountry$inboundSchema))
    .optional(),
  Director: z.array(z.lazy(() => GetLibraryItemsDirector$inboundSchema))
    .optional(),
  Writer: z.array(z.lazy(() => GetLibraryItemsWriter$inboundSchema)).optional(),
  Collection: z.array(z.lazy(() => GetLibraryItemsCollection$inboundSchema))
    .optional(),
  Role: z.array(z.lazy(() => GetLibraryItemsRole$inboundSchema)).optional(),
  Location: z.array(z.lazy(() => GetLibraryItemsLocation$inboundSchema))
    .optional(),
  Guid: z.array(z.lazy(() => MediaGuid$inboundSchema)).optional(),
  UltraBlurColors: z.lazy(() => GetLibraryItemsUltraBlurColors$inboundSchema)
    .optional(),
  Rating: z.array(z.lazy(() => MetaDataRating$inboundSchema)).optional(),
  Image: z.array(z.lazy(() => GetLibraryItemsImage$inboundSchema)).optional(),
  titleSort: z.string().optional(),
  viewCount: z.number().int().optional(),
  lastViewedAt: z.number().int().optional(),
  originalTitle: z.string().optional(),
  viewOffset: z.number().int().optional(),
  skipCount: z.number().int().optional(),
  index: z.number().int().optional(),
  theme: z.string().optional(),
  leafCount: z.number().int().optional(),
  viewedLeafCount: z.number().int().optional(),
  childCount: z.number().int().optional(),
  hasPremiumExtras: z.string().optional(),
  hasPremiumPrimaryExtra: z.string().optional(),
  parentRatingKey: z.string().optional(),
  parentGuid: z.string().optional(),
  parentStudio: z.string().optional(),
  parentKey: z.string().optional(),
  parentTitle: z.string().optional(),
  parentIndex: z.number().int().optional(),
  parentYear: z.number().int().optional(),
  parentThumb: z.string().optional(),
  parentTheme: z.string().optional(),
}).transform((v) => {
  return remap$(v, {
    "Media": "media",
    "Genre": "genre",
    "Country": "country",
    "Director": "director",
    "Writer": "writer",
    "Collection": "collection",
    "Role": "role",
    "Location": "location",
    "Guid": "mediaGuid",
    "UltraBlurColors": "ultraBlurColors",
    "Rating": "metaDataRating",
    "Image": "image",
  });
});

/** @internal */
export type GetLibraryItemsMetadata$Outbound = {
  ratingKey: string;
  key: string;
  guid: string;
  studio?: string | undefined;
  skipChildren?: boolean | undefined;
  librarySectionID?: number | undefined;
  librarySectionTitle?: string | undefined;
  librarySectionKey?: string | undefined;
  type: string;
  title: string;
  slug?: string | undefined;
  contentRating?: string | undefined;
  summary: string;
  rating?: number | undefined;
  audienceRating?: number | undefined;
  year?: number | undefined;
  seasonCount?: number | undefined;
  tagline?: string | undefined;
  flattenSeasons?: string | undefined;
  episodeSort?: string | undefined;
  enableCreditsMarkerGeneration?: string | undefined;
  showOrdering?: string | undefined;
  thumb?: string | undefined;
  art?: string | undefined;
  banner?: string | undefined;
  duration?: number | undefined;
  originallyAvailableAt?: string | undefined;
  addedAt: number;
  updatedAt?: number | undefined;
  audienceRatingImage?: string | undefined;
  chapterSource?: string | undefined;
  primaryExtraKey?: string | undefined;
  ratingImage?: string | undefined;
  grandparentRatingKey?: string | undefined;
  grandparentGuid?: string | undefined;
  grandparentKey?: string | undefined;
  grandparentTitle?: string | undefined;
  grandparentThumb?: string | undefined;
  parentSlug?: string | undefined;
  grandparentSlug?: string | undefined;
  grandparentArt?: string | undefined;
  grandparentTheme?: string | undefined;
  Media?: Array<GetLibraryItemsMedia$Outbound> | undefined;
  Genre?: Array<GetLibraryItemsGenre$Outbound> | undefined;
  Country?: Array<GetLibraryItemsCountry$Outbound> | undefined;
  Director?: Array<GetLibraryItemsDirector$Outbound> | undefined;
  Writer?: Array<GetLibraryItemsWriter$Outbound> | undefined;
  Collection?: Array<GetLibraryItemsCollection$Outbound> | undefined;
  Role?: Array<GetLibraryItemsRole$Outbound> | undefined;
  Location?: Array<GetLibraryItemsLocation$Outbound> | undefined;
  Guid?: Array<MediaGuid$Outbound> | undefined;
  UltraBlurColors?: GetLibraryItemsUltraBlurColors$Outbound | undefined;
  Rating?: Array<MetaDataRating$Outbound> | undefined;
  Image?: Array<GetLibraryItemsImage$Outbound> | undefined;
  titleSort?: string | undefined;
  viewCount?: number | undefined;
  lastViewedAt?: number | undefined;
  originalTitle?: string | undefined;
  viewOffset?: number | undefined;
  skipCount?: number | undefined;
  index?: number | undefined;
  theme?: string | undefined;
  leafCount?: number | undefined;
  viewedLeafCount?: number | undefined;
  childCount?: number | undefined;
  hasPremiumExtras?: string | undefined;
  hasPremiumPrimaryExtra?: string | undefined;
  parentRatingKey?: string | undefined;
  parentGuid?: string | undefined;
  parentStudio?: string | undefined;
  parentKey?: string | undefined;
  parentTitle?: string | undefined;
  parentIndex?: number | undefined;
  parentYear?: number | undefined;
  parentThumb?: string | undefined;
  parentTheme?: string | undefined;
};

/** @internal */
export const GetLibraryItemsMetadata$outboundSchema: z.ZodType<
  GetLibraryItemsMetadata$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsMetadata
> = z.object({
  ratingKey: z.string(),
  key: z.string(),
  guid: z.string(),
  studio: z.string().optional(),
  skipChildren: z.boolean().optional(),
  librarySectionID: z.number().int().optional(),
  librarySectionTitle: z.string().optional(),
  librarySectionKey: z.string().optional(),
  type: GetLibraryItemsLibraryType$outboundSchema,
  title: z.string(),
  slug: z.string().optional(),
  contentRating: z.string().optional(),
  summary: z.string(),
  rating: z.number().optional(),
  audienceRating: z.number().optional(),
  year: z.number().int().optional(),
  seasonCount: z.number().int().optional(),
  tagline: z.string().optional(),
  flattenSeasons: FlattenSeasons$outboundSchema.optional(),
  episodeSort: EpisodeSort$outboundSchema.optional(),
  enableCreditsMarkerGeneration: EnableCreditsMarkerGeneration$outboundSchema
    .optional(),
  showOrdering: ShowOrdering$outboundSchema.optional(),
  thumb: z.string().optional(),
  art: z.string().optional(),
  banner: z.string().optional(),
  duration: z.number().int().optional(),
  originallyAvailableAt: z.instanceof(RFCDate).transform(v => v.toString())
    .optional(),
  addedAt: z.number().int(),
  updatedAt: z.number().int().optional(),
  audienceRatingImage: z.string().optional(),
  chapterSource: z.string().optional(),
  primaryExtraKey: z.string().optional(),
  ratingImage: z.string().optional(),
  grandparentRatingKey: z.string().optional(),
  grandparentGuid: z.string().optional(),
  grandparentKey: z.string().optional(),
  grandparentTitle: z.string().optional(),
  grandparentThumb: z.string().optional(),
  parentSlug: z.string().optional(),
  grandparentSlug: z.string().optional(),
  grandparentArt: z.string().optional(),
  grandparentTheme: z.string().optional(),
  media: z.array(z.lazy(() => GetLibraryItemsMedia$outboundSchema)).optional(),
  genre: z.array(z.lazy(() => GetLibraryItemsGenre$outboundSchema)).optional(),
  country: z.array(z.lazy(() => GetLibraryItemsCountry$outboundSchema))
    .optional(),
  director: z.array(z.lazy(() => GetLibraryItemsDirector$outboundSchema))
    .optional(),
  writer: z.array(z.lazy(() => GetLibraryItemsWriter$outboundSchema))
    .optional(),
  collection: z.array(z.lazy(() => GetLibraryItemsCollection$outboundSchema))
    .optional(),
  role: z.array(z.lazy(() => GetLibraryItemsRole$outboundSchema)).optional(),
  location: z.array(z.lazy(() => GetLibraryItemsLocation$outboundSchema))
    .optional(),
  mediaGuid: z.array(z.lazy(() => MediaGuid$outboundSchema)).optional(),
  ultraBlurColors: z.lazy(() => GetLibraryItemsUltraBlurColors$outboundSchema)
    .optional(),
  metaDataRating: z.array(z.lazy(() => MetaDataRating$outboundSchema))
    .optional(),
  image: z.array(z.lazy(() => GetLibraryItemsImage$outboundSchema)).optional(),
  titleSort: z.string().optional(),
  viewCount: z.number().int().optional(),
  lastViewedAt: z.number().int().optional(),
  originalTitle: z.string().optional(),
  viewOffset: z.number().int().optional(),
  skipCount: z.number().int().optional(),
  index: z.number().int().optional(),
  theme: z.string().optional(),
  leafCount: z.number().int().optional(),
  viewedLeafCount: z.number().int().optional(),
  childCount: z.number().int().optional(),
  hasPremiumExtras: z.string().optional(),
  hasPremiumPrimaryExtra: z.string().optional(),
  parentRatingKey: z.string().optional(),
  parentGuid: z.string().optional(),
  parentStudio: z.string().optional(),
  parentKey: z.string().optional(),
  parentTitle: z.string().optional(),
  parentIndex: z.number().int().optional(),
  parentYear: z.number().int().optional(),
  parentThumb: z.string().optional(),
  parentTheme: z.string().optional(),
}).transform((v) => {
  return remap$(v, {
    media: "Media",
    genre: "Genre",
    country: "Country",
    director: "Director",
    writer: "Writer",
    collection: "Collection",
    role: "Role",
    location: "Location",
    mediaGuid: "Guid",
    ultraBlurColors: "UltraBlurColors",
    metaDataRating: "Rating",
    image: "Image",
  });
});

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

export function getLibraryItemsMetadataToJSON(
  getLibraryItemsMetadata: GetLibraryItemsMetadata,
): string {
  return JSON.stringify(
    GetLibraryItemsMetadata$outboundSchema.parse(getLibraryItemsMetadata),
  );
}

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

/** @internal */
export const GetLibraryItemsLibraryFilter$inboundSchema: z.ZodType<
  GetLibraryItemsLibraryFilter,
  z.ZodTypeDef,
  unknown
> = z.object({
  filter: z.string(),
  filterType: z.string(),
  key: z.string(),
  title: z.string(),
  type: z.string(),
});

/** @internal */
export type GetLibraryItemsLibraryFilter$Outbound = {
  filter: string;
  filterType: string;
  key: string;
  title: string;
  type: string;
};

/** @internal */
export const GetLibraryItemsLibraryFilter$outboundSchema: z.ZodType<
  GetLibraryItemsLibraryFilter$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsLibraryFilter
> = z.object({
  filter: z.string(),
  filterType: z.string(),
  key: z.string(),
  title: z.string(),
  type: z.string(),
});

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

export function getLibraryItemsLibraryFilterToJSON(
  getLibraryItemsLibraryFilter: GetLibraryItemsLibraryFilter,
): string {
  return JSON.stringify(
    GetLibraryItemsLibraryFilter$outboundSchema.parse(
      getLibraryItemsLibraryFilter,
    ),
  );
}

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

/** @internal */
export const GetLibraryItemsLibraryActiveDirection$inboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsLibraryActiveDirection> = z.nativeEnum(
    GetLibraryItemsLibraryActiveDirection,
  );

/** @internal */
export const GetLibraryItemsLibraryActiveDirection$outboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsLibraryActiveDirection> =
    GetLibraryItemsLibraryActiveDirection$inboundSchema;

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

/** @internal */
export const GetLibraryItemsLibraryDefaultDirection$inboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsLibraryDefaultDirection> = z.nativeEnum(
    GetLibraryItemsLibraryDefaultDirection,
  );

/** @internal */
export const GetLibraryItemsLibraryDefaultDirection$outboundSchema:
  z.ZodNativeEnum<typeof GetLibraryItemsLibraryDefaultDirection> =
    GetLibraryItemsLibraryDefaultDirection$inboundSchema;

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

/** @internal */
export const GetLibraryItemsLibrarySort$inboundSchema: z.ZodType<
  GetLibraryItemsLibrarySort,
  z.ZodTypeDef,
  unknown
> = z.object({
  default: z.string().optional(),
  active: z.boolean().optional(),
  activeDirection: GetLibraryItemsLibraryActiveDirection$inboundSchema.default(
    GetLibraryItemsLibraryActiveDirection.Ascending,
  ),
  defaultDirection: GetLibraryItemsLibraryDefaultDirection$inboundSchema
    .default(GetLibraryItemsLibraryDefaultDirection.Ascending),
  descKey: z.string().optional(),
  firstCharacterKey: z.string().optional(),
  key: z.string(),
  title: z.string(),
});

/** @internal */
export type GetLibraryItemsLibrarySort$Outbound = {
  default?: string | undefined;
  active?: boolean | undefined;
  activeDirection: string;
  defaultDirection: string;
  descKey?: string | undefined;
  firstCharacterKey?: string | undefined;
  key: string;
  title: string;
};

/** @internal */
export const GetLibraryItemsLibrarySort$outboundSchema: z.ZodType<
  GetLibraryItemsLibrarySort$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsLibrarySort
> = z.object({
  default: z.string().optional(),
  active: z.boolean().optional(),
  activeDirection: GetLibraryItemsLibraryActiveDirection$outboundSchema.default(
    GetLibraryItemsLibraryActiveDirection.Ascending,
  ),
  defaultDirection: GetLibraryItemsLibraryDefaultDirection$outboundSchema
    .default(GetLibraryItemsLibraryDefaultDirection.Ascending),
  descKey: z.string().optional(),
  firstCharacterKey: z.string().optional(),
  key: z.string(),
  title: z.string(),
});

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

export function getLibraryItemsLibrarySortToJSON(
  getLibraryItemsLibrarySort: GetLibraryItemsLibrarySort,
): string {
  return JSON.stringify(
    GetLibraryItemsLibrarySort$outboundSchema.parse(getLibraryItemsLibrarySort),
  );
}

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

/** @internal */
export const GetLibraryItemsLibraryField$inboundSchema: z.ZodType<
  GetLibraryItemsLibraryField,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: z.string(),
  title: z.string(),
  type: z.string(),
  subType: z.string().optional(),
});

/** @internal */
export type GetLibraryItemsLibraryField$Outbound = {
  key: string;
  title: string;
  type: string;
  subType?: string | undefined;
};

/** @internal */
export const GetLibraryItemsLibraryField$outboundSchema: z.ZodType<
  GetLibraryItemsLibraryField$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsLibraryField
> = z.object({
  key: z.string(),
  title: z.string(),
  type: z.string(),
  subType: 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 GetLibraryItemsLibraryField$ {
  /** @deprecated use `GetLibraryItemsLibraryField$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsLibraryField$inboundSchema;
  /** @deprecated use `GetLibraryItemsLibraryField$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsLibraryField$outboundSchema;
  /** @deprecated use `GetLibraryItemsLibraryField$Outbound` instead. */
  export type Outbound = GetLibraryItemsLibraryField$Outbound;
}

export function getLibraryItemsLibraryFieldToJSON(
  getLibraryItemsLibraryField: GetLibraryItemsLibraryField,
): string {
  return JSON.stringify(
    GetLibraryItemsLibraryField$outboundSchema.parse(
      getLibraryItemsLibraryField,
    ),
  );
}

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

/** @internal */
export const GetLibraryItemsLibraryResponseType$inboundSchema: z.ZodType<
  GetLibraryItemsLibraryResponseType,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: z.string(),
  type: z.string(),
  title: z.string(),
  active: z.boolean(),
  Filter: z.array(z.lazy(() => GetLibraryItemsLibraryFilter$inboundSchema))
    .optional(),
  Sort: z.array(z.lazy(() => GetLibraryItemsLibrarySort$inboundSchema))
    .optional(),
  Field: z.array(z.lazy(() => GetLibraryItemsLibraryField$inboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    "Filter": "filter",
    "Sort": "sort",
    "Field": "field",
  });
});

/** @internal */
export type GetLibraryItemsLibraryResponseType$Outbound = {
  key: string;
  type: string;
  title: string;
  active: boolean;
  Filter?: Array<GetLibraryItemsLibraryFilter$Outbound> | undefined;
  Sort?: Array<GetLibraryItemsLibrarySort$Outbound> | undefined;
  Field?: Array<GetLibraryItemsLibraryField$Outbound> | undefined;
};

/** @internal */
export const GetLibraryItemsLibraryResponseType$outboundSchema: z.ZodType<
  GetLibraryItemsLibraryResponseType$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsLibraryResponseType
> = z.object({
  key: z.string(),
  type: z.string(),
  title: z.string(),
  active: z.boolean(),
  filter: z.array(z.lazy(() => GetLibraryItemsLibraryFilter$outboundSchema))
    .optional(),
  sort: z.array(z.lazy(() => GetLibraryItemsLibrarySort$outboundSchema))
    .optional(),
  field: z.array(z.lazy(() => GetLibraryItemsLibraryField$outboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    filter: "Filter",
    sort: "Sort",
    field: "Field",
  });
});

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

export function getLibraryItemsLibraryResponseTypeToJSON(
  getLibraryItemsLibraryResponseType: GetLibraryItemsLibraryResponseType,
): string {
  return JSON.stringify(
    GetLibraryItemsLibraryResponseType$outboundSchema.parse(
      getLibraryItemsLibraryResponseType,
    ),
  );
}

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

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

/** @internal */
export type GetLibraryItemsLibraryOperator$Outbound = {
  key: string;
  title: string;
};

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

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

export function getLibraryItemsLibraryOperatorToJSON(
  getLibraryItemsLibraryOperator: GetLibraryItemsLibraryOperator,
): string {
  return JSON.stringify(
    GetLibraryItemsLibraryOperator$outboundSchema.parse(
      getLibraryItemsLibraryOperator,
    ),
  );
}

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

/** @internal */
export const GetLibraryItemsLibraryFieldType$inboundSchema: z.ZodType<
  GetLibraryItemsLibraryFieldType,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: z.string(),
  Operator: z.array(z.lazy(() => GetLibraryItemsLibraryOperator$inboundSchema)),
}).transform((v) => {
  return remap$(v, {
    "Operator": "operator",
  });
});

/** @internal */
export type GetLibraryItemsLibraryFieldType$Outbound = {
  type: string;
  Operator: Array<GetLibraryItemsLibraryOperator$Outbound>;
};

/** @internal */
export const GetLibraryItemsLibraryFieldType$outboundSchema: z.ZodType<
  GetLibraryItemsLibraryFieldType$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsLibraryFieldType
> = z.object({
  type: z.string(),
  operator: z.array(
    z.lazy(() => GetLibraryItemsLibraryOperator$outboundSchema),
  ),
}).transform((v) => {
  return remap$(v, {
    operator: "Operator",
  });
});

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

export function getLibraryItemsLibraryFieldTypeToJSON(
  getLibraryItemsLibraryFieldType: GetLibraryItemsLibraryFieldType,
): string {
  return JSON.stringify(
    GetLibraryItemsLibraryFieldType$outboundSchema.parse(
      getLibraryItemsLibraryFieldType,
    ),
  );
}

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

/** @internal */
export const GetLibraryItemsMeta$inboundSchema: z.ZodType<
  GetLibraryItemsMeta,
  z.ZodTypeDef,
  unknown
> = z.object({
  Type: z.array(z.lazy(() => GetLibraryItemsLibraryResponseType$inboundSchema))
    .optional(),
  FieldType: z.array(
    z.lazy(() => GetLibraryItemsLibraryFieldType$inboundSchema),
  ).optional(),
}).transform((v) => {
  return remap$(v, {
    "Type": "type",
    "FieldType": "fieldType",
  });
});

/** @internal */
export type GetLibraryItemsMeta$Outbound = {
  Type?: Array<GetLibraryItemsLibraryResponseType$Outbound> | undefined;
  FieldType?: Array<GetLibraryItemsLibraryFieldType$Outbound> | undefined;
};

/** @internal */
export const GetLibraryItemsMeta$outboundSchema: z.ZodType<
  GetLibraryItemsMeta$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsMeta
> = z.object({
  type: z.array(z.lazy(() => GetLibraryItemsLibraryResponseType$outboundSchema))
    .optional(),
  fieldType: z.array(
    z.lazy(() => GetLibraryItemsLibraryFieldType$outboundSchema),
  ).optional(),
}).transform((v) => {
  return remap$(v, {
    type: "Type",
    fieldType: "FieldType",
  });
});

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

export function getLibraryItemsMetaToJSON(
  getLibraryItemsMeta: GetLibraryItemsMeta,
): string {
  return JSON.stringify(
    GetLibraryItemsMeta$outboundSchema.parse(getLibraryItemsMeta),
  );
}

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

/** @internal */
export const GetLibraryItemsMediaContainer$inboundSchema: z.ZodType<
  GetLibraryItemsMediaContainer,
  z.ZodTypeDef,
  unknown
> = z.object({
  Type: z.array(z.lazy(() => GetLibraryItemsType$inboundSchema)).optional(),
  FieldType: z.array(z.lazy(() => GetLibraryItemsFieldType$inboundSchema))
    .optional(),
  size: z.number().int(),
  totalSize: z.number().int(),
  offset: z.number().int(),
  content: z.string(),
  allowSync: z.boolean(),
  nocache: z.boolean().optional(),
  art: z.string(),
  identifier: z.string(),
  librarySectionID: z.number().int(),
  librarySectionTitle: z.string(),
  librarySectionUUID: z.string(),
  mediaTagPrefix: z.string(),
  mediaTagVersion: z.number().int(),
  thumb: z.string(),
  title1: z.string(),
  title2: z.string(),
  viewGroup: z.string(),
  viewMode: z.number().int().optional(),
  mixedParents: z.boolean().optional(),
  Metadata: z.array(z.lazy(() => GetLibraryItemsMetadata$inboundSchema))
    .optional(),
  Meta: z.lazy(() => GetLibraryItemsMeta$inboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    "Type": "type",
    "FieldType": "fieldType",
    "Metadata": "metadata",
    "Meta": "meta",
  });
});

/** @internal */
export type GetLibraryItemsMediaContainer$Outbound = {
  Type?: Array<GetLibraryItemsType$Outbound> | undefined;
  FieldType?: Array<GetLibraryItemsFieldType$Outbound> | undefined;
  size: number;
  totalSize: number;
  offset: number;
  content: string;
  allowSync: boolean;
  nocache?: boolean | undefined;
  art: string;
  identifier: string;
  librarySectionID: number;
  librarySectionTitle: string;
  librarySectionUUID: string;
  mediaTagPrefix: string;
  mediaTagVersion: number;
  thumb: string;
  title1: string;
  title2: string;
  viewGroup: string;
  viewMode?: number | undefined;
  mixedParents?: boolean | undefined;
  Metadata?: Array<GetLibraryItemsMetadata$Outbound> | undefined;
  Meta?: GetLibraryItemsMeta$Outbound | undefined;
};

/** @internal */
export const GetLibraryItemsMediaContainer$outboundSchema: z.ZodType<
  GetLibraryItemsMediaContainer$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsMediaContainer
> = z.object({
  type: z.array(z.lazy(() => GetLibraryItemsType$outboundSchema)).optional(),
  fieldType: z.array(z.lazy(() => GetLibraryItemsFieldType$outboundSchema))
    .optional(),
  size: z.number().int(),
  totalSize: z.number().int(),
  offset: z.number().int(),
  content: z.string(),
  allowSync: z.boolean(),
  nocache: z.boolean().optional(),
  art: z.string(),
  identifier: z.string(),
  librarySectionID: z.number().int(),
  librarySectionTitle: z.string(),
  librarySectionUUID: z.string(),
  mediaTagPrefix: z.string(),
  mediaTagVersion: z.number().int(),
  thumb: z.string(),
  title1: z.string(),
  title2: z.string(),
  viewGroup: z.string(),
  viewMode: z.number().int().optional(),
  mixedParents: z.boolean().optional(),
  metadata: z.array(z.lazy(() => GetLibraryItemsMetadata$outboundSchema))
    .optional(),
  meta: z.lazy(() => GetLibraryItemsMeta$outboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    type: "Type",
    fieldType: "FieldType",
    metadata: "Metadata",
    meta: "Meta",
  });
});

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

export function getLibraryItemsMediaContainerToJSON(
  getLibraryItemsMediaContainer: GetLibraryItemsMediaContainer,
): string {
  return JSON.stringify(
    GetLibraryItemsMediaContainer$outboundSchema.parse(
      getLibraryItemsMediaContainer,
    ),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsResponseBody$outboundSchema: z.ZodType<
  GetLibraryItemsResponseBody$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsResponseBody
> = z.object({
  mediaContainer: z.lazy(() => GetLibraryItemsMediaContainer$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 GetLibraryItemsResponseBody$ {
  /** @deprecated use `GetLibraryItemsResponseBody$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsResponseBody$inboundSchema;
  /** @deprecated use `GetLibraryItemsResponseBody$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsResponseBody$outboundSchema;
  /** @deprecated use `GetLibraryItemsResponseBody$Outbound` instead. */
  export type Outbound = GetLibraryItemsResponseBody$Outbound;
}

export function getLibraryItemsResponseBodyToJSON(
  getLibraryItemsResponseBody: GetLibraryItemsResponseBody,
): string {
  return JSON.stringify(
    GetLibraryItemsResponseBody$outboundSchema.parse(
      getLibraryItemsResponseBody,
    ),
  );
}

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

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

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

/** @internal */
export const GetLibraryItemsResponse$outboundSchema: z.ZodType<
  GetLibraryItemsResponse$Outbound,
  z.ZodTypeDef,
  GetLibraryItemsResponse
> = z.object({
  contentType: z.string(),
  statusCode: z.number().int(),
  rawResponse: z.instanceof(Response).transform(() => {
    throw new Error("Response cannot be serialized");
  }),
  object: z.lazy(() => GetLibraryItemsResponseBody$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 GetLibraryItemsResponse$ {
  /** @deprecated use `GetLibraryItemsResponse$inboundSchema` instead. */
  export const inboundSchema = GetLibraryItemsResponse$inboundSchema;
  /** @deprecated use `GetLibraryItemsResponse$outboundSchema` instead. */
  export const outboundSchema = GetLibraryItemsResponse$outboundSchema;
  /** @deprecated use `GetLibraryItemsResponse$Outbound` instead. */
  export type Outbound = GetLibraryItemsResponse$Outbound;
}

export function getLibraryItemsResponseToJSON(
  getLibraryItemsResponse: GetLibraryItemsResponse,
): string {
  return JSON.stringify(
    GetLibraryItemsResponse$outboundSchema.parse(getLibraryItemsResponse),
  );
}

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