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

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

/**
 * limit to a type of playlist.
 */
export enum PlaylistType {
  Audio = "audio",
  Video = "video",
  Photo = "photo",
}

/**
 * type of playlists to return (default is all).
 */
export enum QueryParamSmart {
  Zero = 0,
  One = 1,
}

export type GetPlaylistsRequest = {
  /**
   * limit to a type of playlist.
   */
  playlistType?: PlaylistType | undefined;
  /**
   * type of playlists to return (default is all).
   */
  smart?: QueryParamSmart | undefined;
};

export type GetPlaylistsMetadata = {
  ratingKey?: string | undefined;
  key?: string | undefined;
  guid?: string | undefined;
  type?: string | undefined;
  title?: string | undefined;
  summary?: string | undefined;
  smart?: boolean | undefined;
  playlistType?: string | undefined;
  composite?: string | undefined;
  icon?: string | undefined;
  viewCount?: number | undefined;
  lastViewedAt?: number | undefined;
  duration?: number | undefined;
  leafCount?: number | undefined;
  addedAt?: number | undefined;
  updatedAt?: number | undefined;
};

export type GetPlaylistsMediaContainer = {
  size?: number | undefined;
  metadata?: Array<GetPlaylistsMetadata> | undefined;
};

/**
 * returns all playlists
 */
export type GetPlaylistsResponseBody = {
  mediaContainer?: GetPlaylistsMediaContainer | undefined;
};

export type GetPlaylistsResponse = {
  /**
   * 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;
  /**
   * returns all playlists
   */
  object?: GetPlaylistsResponseBody | undefined;
};

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

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

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

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

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

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

/** @internal */
export const GetPlaylistsRequest$inboundSchema: z.ZodType<
  GetPlaylistsRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  playlistType: PlaylistType$inboundSchema.optional(),
  smart: QueryParamSmart$inboundSchema.optional(),
});

/** @internal */
export type GetPlaylistsRequest$Outbound = {
  playlistType?: string | undefined;
  smart?: number | undefined;
};

/** @internal */
export const GetPlaylistsRequest$outboundSchema: z.ZodType<
  GetPlaylistsRequest$Outbound,
  z.ZodTypeDef,
  GetPlaylistsRequest
> = z.object({
  playlistType: PlaylistType$outboundSchema.optional(),
  smart: QueryParamSmart$outboundSchema.optional(),
});

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

/** @internal */
export const GetPlaylistsMetadata$inboundSchema: z.ZodType<
  GetPlaylistsMetadata,
  z.ZodTypeDef,
  unknown
> = z.object({
  ratingKey: z.string().optional(),
  key: z.string().optional(),
  guid: z.string().optional(),
  type: z.string().optional(),
  title: z.string().optional(),
  summary: z.string().optional(),
  smart: z.boolean().optional(),
  playlistType: z.string().optional(),
  composite: z.string().optional(),
  icon: z.string().optional(),
  viewCount: z.number().int().optional(),
  lastViewedAt: z.number().int().optional(),
  duration: z.number().int().optional(),
  leafCount: z.number().int().optional(),
  addedAt: z.number().int().optional(),
  updatedAt: z.number().int().optional(),
});

/** @internal */
export type GetPlaylistsMetadata$Outbound = {
  ratingKey?: string | undefined;
  key?: string | undefined;
  guid?: string | undefined;
  type?: string | undefined;
  title?: string | undefined;
  summary?: string | undefined;
  smart?: boolean | undefined;
  playlistType?: string | undefined;
  composite?: string | undefined;
  icon?: string | undefined;
  viewCount?: number | undefined;
  lastViewedAt?: number | undefined;
  duration?: number | undefined;
  leafCount?: number | undefined;
  addedAt?: number | undefined;
  updatedAt?: number | undefined;
};

/** @internal */
export const GetPlaylistsMetadata$outboundSchema: z.ZodType<
  GetPlaylistsMetadata$Outbound,
  z.ZodTypeDef,
  GetPlaylistsMetadata
> = z.object({
  ratingKey: z.string().optional(),
  key: z.string().optional(),
  guid: z.string().optional(),
  type: z.string().optional(),
  title: z.string().optional(),
  summary: z.string().optional(),
  smart: z.boolean().optional(),
  playlistType: z.string().optional(),
  composite: z.string().optional(),
  icon: z.string().optional(),
  viewCount: z.number().int().optional(),
  lastViewedAt: z.number().int().optional(),
  duration: z.number().int().optional(),
  leafCount: z.number().int().optional(),
  addedAt: z.number().int().optional(),
  updatedAt: z.number().int().optional(),
});

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

/** @internal */
export const GetPlaylistsMediaContainer$inboundSchema: z.ZodType<
  GetPlaylistsMediaContainer,
  z.ZodTypeDef,
  unknown
> = z.object({
  size: z.number().int().optional(),
  Metadata: z.array(z.lazy(() => GetPlaylistsMetadata$inboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    "Metadata": "metadata",
  });
});

/** @internal */
export type GetPlaylistsMediaContainer$Outbound = {
  size?: number | undefined;
  Metadata?: Array<GetPlaylistsMetadata$Outbound> | undefined;
};

/** @internal */
export const GetPlaylistsMediaContainer$outboundSchema: z.ZodType<
  GetPlaylistsMediaContainer$Outbound,
  z.ZodTypeDef,
  GetPlaylistsMediaContainer
> = z.object({
  size: z.number().int().optional(),
  metadata: z.array(z.lazy(() => GetPlaylistsMetadata$outboundSchema))
    .optional(),
}).transform((v) => {
  return remap$(v, {
    metadata: "Metadata",
  });
});

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

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

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

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

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

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

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