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

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

export type AddPlaylistContentsRequest = {
  /**
   * the ID of the playlist
   */
  playlistID: number;
  /**
   * the content URI for the playlist
   */
  uri: string;
  /**
   * the play queue to add to a playlist
   */
  playQueueID?: number | undefined;
};

export type AddPlaylistContentsMetadata = {
  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;
  duration?: number | undefined;
  leafCount?: number | undefined;
  addedAt?: number | undefined;
  updatedAt?: number | undefined;
};

export type AddPlaylistContentsMediaContainer = {
  size?: number | undefined;
  leafCountAdded?: number | undefined;
  leafCountRequested?: number | undefined;
  metadata?: Array<AddPlaylistContentsMetadata> | undefined;
};

/**
 * Playlist Updated
 */
export type AddPlaylistContentsResponseBody = {
  mediaContainer?: AddPlaylistContentsMediaContainer | undefined;
};

export type AddPlaylistContentsResponse = {
  /**
   * 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;
  /**
   * Playlist Updated
   */
  object?: AddPlaylistContentsResponseBody | undefined;
};

/** @internal */
export const AddPlaylistContentsRequest$inboundSchema: z.ZodType<
  AddPlaylistContentsRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  playlistID: z.number(),
  uri: z.string(),
  playQueueID: z.number().optional(),
});

/** @internal */
export type AddPlaylistContentsRequest$Outbound = {
  playlistID: number;
  uri: string;
  playQueueID?: number | undefined;
};

/** @internal */
export const AddPlaylistContentsRequest$outboundSchema: z.ZodType<
  AddPlaylistContentsRequest$Outbound,
  z.ZodTypeDef,
  AddPlaylistContentsRequest
> = z.object({
  playlistID: z.number(),
  uri: z.string(),
  playQueueID: z.number().optional(),
});

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

/** @internal */
export const AddPlaylistContentsMetadata$inboundSchema: z.ZodType<
  AddPlaylistContentsMetadata,
  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(),
  duration: z.number().int().optional(),
  leafCount: z.number().int().optional(),
  addedAt: z.number().int().optional(),
  updatedAt: z.number().int().optional(),
});

/** @internal */
export type AddPlaylistContentsMetadata$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;
  duration?: number | undefined;
  leafCount?: number | undefined;
  addedAt?: number | undefined;
  updatedAt?: number | undefined;
};

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

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

/** @internal */
export type AddPlaylistContentsMediaContainer$Outbound = {
  size?: number | undefined;
  leafCountAdded?: number | undefined;
  leafCountRequested?: number | undefined;
  Metadata?: Array<AddPlaylistContentsMetadata$Outbound> | undefined;
};

/** @internal */
export const AddPlaylistContentsMediaContainer$outboundSchema: z.ZodType<
  AddPlaylistContentsMediaContainer$Outbound,
  z.ZodTypeDef,
  AddPlaylistContentsMediaContainer
> = z.object({
  size: z.number().int().optional(),
  leafCountAdded: z.number().int().optional(),
  leafCountRequested: z.number().int().optional(),
  metadata: z.array(z.lazy(() => AddPlaylistContentsMetadata$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 AddPlaylistContentsMediaContainer$ {
  /** @deprecated use `AddPlaylistContentsMediaContainer$inboundSchema` instead. */
  export const inboundSchema = AddPlaylistContentsMediaContainer$inboundSchema;
  /** @deprecated use `AddPlaylistContentsMediaContainer$outboundSchema` instead. */
  export const outboundSchema =
    AddPlaylistContentsMediaContainer$outboundSchema;
  /** @deprecated use `AddPlaylistContentsMediaContainer$Outbound` instead. */
  export type Outbound = AddPlaylistContentsMediaContainer$Outbound;
}

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

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

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

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

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

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