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

package components

import (
	"encoding/json"
	"fmt"
	"github.com/LukeHagar/plexgo/internal/utils"
)

type MediaContainerWithDecisionDecision string

const (
	MediaContainerWithDecisionDecisionCopy        MediaContainerWithDecisionDecision = "copy"
	MediaContainerWithDecisionDecisionTranscode   MediaContainerWithDecisionDecision = "transcode"
	MediaContainerWithDecisionDecisionBurn        MediaContainerWithDecisionDecision = "burn"
	MediaContainerWithDecisionDecisionUnavailable MediaContainerWithDecisionDecision = "unavailable"
	MediaContainerWithDecisionDecisionIgnore      MediaContainerWithDecisionDecision = "ignore"
	MediaContainerWithDecisionDecisionNone        MediaContainerWithDecisionDecision = "none"
)

func (e MediaContainerWithDecisionDecision) ToPointer() *MediaContainerWithDecisionDecision {
	return &e
}
func (e *MediaContainerWithDecisionDecision) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "copy":
		fallthrough
	case "transcode":
		fallthrough
	case "burn":
		fallthrough
	case "unavailable":
		fallthrough
	case "ignore":
		fallthrough
	case "none":
		*e = MediaContainerWithDecisionDecision(v)
		return nil
	default:
		return fmt.Errorf("invalid value for MediaContainerWithDecisionDecision: %v", v)
	}
}

type MediaContainerWithDecisionLocation string

const (
	MediaContainerWithDecisionLocationDirect        MediaContainerWithDecisionLocation = "direct"
	MediaContainerWithDecisionLocationSidecarSubs   MediaContainerWithDecisionLocation = "sidecar-subs"
	MediaContainerWithDecisionLocationSegmentsVideo MediaContainerWithDecisionLocation = "segments-video"
	MediaContainerWithDecisionLocationSegmentsAudio MediaContainerWithDecisionLocation = "segments-audio"
	MediaContainerWithDecisionLocationSegmentsAv    MediaContainerWithDecisionLocation = "segments-av"
	MediaContainerWithDecisionLocationSegmentsSubs  MediaContainerWithDecisionLocation = "segments-subs"
	MediaContainerWithDecisionLocationEmbedded      MediaContainerWithDecisionLocation = "embedded"
	MediaContainerWithDecisionLocationSidecar       MediaContainerWithDecisionLocation = "sidecar"
)

func (e MediaContainerWithDecisionLocation) ToPointer() *MediaContainerWithDecisionLocation {
	return &e
}
func (e *MediaContainerWithDecisionLocation) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "direct":
		fallthrough
	case "sidecar-subs":
		fallthrough
	case "segments-video":
		fallthrough
	case "segments-audio":
		fallthrough
	case "segments-av":
		fallthrough
	case "segments-subs":
		fallthrough
	case "embedded":
		fallthrough
	case "sidecar":
		*e = MediaContainerWithDecisionLocation(v)
		return nil
	default:
		return fmt.Errorf("invalid value for MediaContainerWithDecisionLocation: %v", v)
	}
}

// MediaContainerWithDecisionStream - `Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream.  Note that photos do not have streams (mostly as an optimization).
type MediaContainerWithDecisionStream struct {
	Default            *bool  `json:"default,omitempty"`
	AudioChannelLayout any    `json:"audioChannelLayout,omitempty"`
	BitDepth           *int64 `json:"bitDepth,omitempty"`
	Bitrate            *int64 `json:"bitrate,omitempty"`
	// For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video.
	CanAutoSync       *bool `json:"canAutoSync,omitempty"`
	ChromaLocation    any   `json:"chromaLocation,omitempty"`
	ChromaSubsampling any   `json:"chromaSubsampling,omitempty"`
	// The codec of the stream, such as `h264` or `aac`
	Codec          any `json:"codec,omitempty"`
	ColorPrimaries any `json:"colorPrimaries,omitempty"`
	ColorRange     any `json:"colorRange,omitempty"`
	ColorSpace     any `json:"colorSpace,omitempty"`
	ColorTrc       any `json:"colorTrc,omitempty"`
	// A friendly name for the stream, often comprised of the language and codec information
	DisplayTitle     any      `json:"displayTitle,omitempty"`
	FrameRate        *float64 `json:"frameRate,omitempty"`
	HasScalingMatrix any      `json:"hasScalingMatrix,omitempty"`
	Height           *int64   `json:"height,omitempty"`
	ID               *int64   `json:"id,omitempty"`
	// If the stream is part of the `Part` and not an external resource, the index of the stream within that part
	Index *int64 `json:"index,omitempty"`
	// If the stream is independently streamable, the key from which it can be streamed
	Key      any `json:"key,omitempty"`
	Language any `json:"language,omitempty"`
	// The three character language code for the stream contents
	LanguageCode     any    `json:"languageCode,omitempty"`
	Level            *int64 `json:"level,omitempty"`
	Profile          any    `json:"profile,omitempty"`
	RefFrames        *int64 `json:"refFrames,omitempty"`
	SamplingRate     *int64 `json:"samplingRate,omitempty"`
	Selected         *bool  `json:"selected,omitempty"`
	StreamIdentifier *int64 `json:"streamIdentifier,omitempty"`
	// A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics
	StreamType           *int64                              `json:"streamType,omitempty"`
	Width                *int64                              `json:"width,omitempty"`
	Decision             *MediaContainerWithDecisionDecision `json:"decision,omitempty"`
	Location             *MediaContainerWithDecisionLocation `json:"location,omitempty"`
	AdditionalProperties map[string]any                      `additionalProperties:"true" json:"-"`
}

func (m MediaContainerWithDecisionStream) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(m, "", false)
}

func (m *MediaContainerWithDecisionStream) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (m *MediaContainerWithDecisionStream) GetDefault() *bool {
	if m == nil {
		return nil
	}
	return m.Default
}

func (m *MediaContainerWithDecisionStream) GetAudioChannelLayout() any {
	if m == nil {
		return nil
	}
	return m.AudioChannelLayout
}

func (m *MediaContainerWithDecisionStream) GetBitDepth() *int64 {
	if m == nil {
		return nil
	}
	return m.BitDepth
}

func (m *MediaContainerWithDecisionStream) GetBitrate() *int64 {
	if m == nil {
		return nil
	}
	return m.Bitrate
}

func (m *MediaContainerWithDecisionStream) GetCanAutoSync() *bool {
	if m == nil {
		return nil
	}
	return m.CanAutoSync
}

func (m *MediaContainerWithDecisionStream) GetChromaLocation() any {
	if m == nil {
		return nil
	}
	return m.ChromaLocation
}

func (m *MediaContainerWithDecisionStream) GetChromaSubsampling() any {
	if m == nil {
		return nil
	}
	return m.ChromaSubsampling
}

func (m *MediaContainerWithDecisionStream) GetCodec() any {
	if m == nil {
		return nil
	}
	return m.Codec
}

func (m *MediaContainerWithDecisionStream) GetColorPrimaries() any {
	if m == nil {
		return nil
	}
	return m.ColorPrimaries
}

func (m *MediaContainerWithDecisionStream) GetColorRange() any {
	if m == nil {
		return nil
	}
	return m.ColorRange
}

func (m *MediaContainerWithDecisionStream) GetColorSpace() any {
	if m == nil {
		return nil
	}
	return m.ColorSpace
}

func (m *MediaContainerWithDecisionStream) GetColorTrc() any {
	if m == nil {
		return nil
	}
	return m.ColorTrc
}

func (m *MediaContainerWithDecisionStream) GetDisplayTitle() any {
	if m == nil {
		return nil
	}
	return m.DisplayTitle
}

func (m *MediaContainerWithDecisionStream) GetFrameRate() *float64 {
	if m == nil {
		return nil
	}
	return m.FrameRate
}

func (m *MediaContainerWithDecisionStream) GetHasScalingMatrix() any {
	if m == nil {
		return nil
	}
	return m.HasScalingMatrix
}

func (m *MediaContainerWithDecisionStream) GetHeight() *int64 {
	if m == nil {
		return nil
	}
	return m.Height
}

func (m *MediaContainerWithDecisionStream) GetID() *int64 {
	if m == nil {
		return nil
	}
	return m.ID
}

func (m *MediaContainerWithDecisionStream) GetIndex() *int64 {
	if m == nil {
		return nil
	}
	return m.Index
}

func (m *MediaContainerWithDecisionStream) GetKey() any {
	if m == nil {
		return nil
	}
	return m.Key
}

func (m *MediaContainerWithDecisionStream) GetLanguage() any {
	if m == nil {
		return nil
	}
	return m.Language
}

func (m *MediaContainerWithDecisionStream) GetLanguageCode() any {
	if m == nil {
		return nil
	}
	return m.LanguageCode
}

func (m *MediaContainerWithDecisionStream) GetLevel() *int64 {
	if m == nil {
		return nil
	}
	return m.Level
}

func (m *MediaContainerWithDecisionStream) GetProfile() any {
	if m == nil {
		return nil
	}
	return m.Profile
}

func (m *MediaContainerWithDecisionStream) GetRefFrames() *int64 {
	if m == nil {
		return nil
	}
	return m.RefFrames
}

func (m *MediaContainerWithDecisionStream) GetSamplingRate() *int64 {
	if m == nil {
		return nil
	}
	return m.SamplingRate
}

func (m *MediaContainerWithDecisionStream) GetSelected() *bool {
	if m == nil {
		return nil
	}
	return m.Selected
}

func (m *MediaContainerWithDecisionStream) GetStreamIdentifier() *int64 {
	if m == nil {
		return nil
	}
	return m.StreamIdentifier
}

func (m *MediaContainerWithDecisionStream) GetStreamType() *int64 {
	if m == nil {
		return nil
	}
	return m.StreamType
}

func (m *MediaContainerWithDecisionStream) GetWidth() *int64 {
	if m == nil {
		return nil
	}
	return m.Width
}

func (m *MediaContainerWithDecisionStream) GetDecision() *MediaContainerWithDecisionDecision {
	if m == nil {
		return nil
	}
	return m.Decision
}

func (m *MediaContainerWithDecisionStream) GetLocation() *MediaContainerWithDecisionLocation {
	if m == nil {
		return nil
	}
	return m.Location
}

func (m *MediaContainerWithDecisionStream) GetAdditionalProperties() map[string]any {
	if m == nil {
		return nil
	}
	return m.AdditionalProperties
}

type Decision string

const (
	DecisionDirectplay Decision = "directplay"
	DecisionTranscode  Decision = "transcode"
	DecisionNone       Decision = "none"
)

func (e Decision) ToPointer() *Decision {
	return &e
}
func (e *Decision) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "directplay":
		fallthrough
	case "transcode":
		fallthrough
	case "none":
		*e = Decision(v)
		return nil
	default:
		return fmt.Errorf("invalid value for Decision: %v", v)
	}
}

// MediaContainerWithDecisionPart - `Part` represents a particular file or "part" of a media item. The part is the playable unit of the media hierarchy. Suppose that a movie library contains a movie that is broken up into files, reminiscent of a movie split across two BDs. The metadata item represents information about the movie, the media item represents this instance of the movie at this resolution and quality, and the part items represent the two playable files.  If another media were added which contained the joining of these two parts transcoded down to a lower resolution, then this metadata would contain 2 medias, one with 2 parts and one with 1 part.
type MediaContainerWithDecisionPart struct {
	AudioProfile any `json:"audioProfile,omitempty"`
	// The container of the media file, such as `mp4` or `mkv`
	Container any `json:"container,omitempty"`
	// The duration of the media item, in milliseconds
	Duration *int64 `json:"duration,omitempty"`
	// The local file path at which the part is stored on the server
	File            any    `json:"file,omitempty"`
	Has64bitOffsets *bool  `json:"has64bitOffsets,omitempty"`
	ID              *int64 `json:"id,omitempty"`
	// The key from which the media can be streamed
	Key                   any   `json:"key,omitempty"`
	OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"`
	// The size of the media, in bytes
	Size                 *int64                             `json:"size,omitempty"`
	Stream               []MediaContainerWithDecisionStream `json:"Stream,omitempty"`
	VideoProfile         any                                `json:"videoProfile,omitempty"`
	Decision             *Decision                          `json:"decision,omitempty"`
	Selected             *bool                              `json:"selected,omitempty"`
	AdditionalProperties map[string]any                     `additionalProperties:"true" json:"-"`
}

func (m MediaContainerWithDecisionPart) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(m, "", false)
}

func (m *MediaContainerWithDecisionPart) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (m *MediaContainerWithDecisionPart) GetAudioProfile() any {
	if m == nil {
		return nil
	}
	return m.AudioProfile
}

func (m *MediaContainerWithDecisionPart) GetContainer() any {
	if m == nil {
		return nil
	}
	return m.Container
}

func (m *MediaContainerWithDecisionPart) GetDuration() *int64 {
	if m == nil {
		return nil
	}
	return m.Duration
}

func (m *MediaContainerWithDecisionPart) GetFile() any {
	if m == nil {
		return nil
	}
	return m.File
}

func (m *MediaContainerWithDecisionPart) GetHas64bitOffsets() *bool {
	if m == nil {
		return nil
	}
	return m.Has64bitOffsets
}

func (m *MediaContainerWithDecisionPart) GetID() *int64 {
	if m == nil {
		return nil
	}
	return m.ID
}

func (m *MediaContainerWithDecisionPart) GetKey() any {
	if m == nil {
		return nil
	}
	return m.Key
}

func (m *MediaContainerWithDecisionPart) GetOptimizedForStreaming() *bool {
	if m == nil {
		return nil
	}
	return m.OptimizedForStreaming
}

func (m *MediaContainerWithDecisionPart) GetSize() *int64 {
	if m == nil {
		return nil
	}
	return m.Size
}

func (m *MediaContainerWithDecisionPart) GetStream() []MediaContainerWithDecisionStream {
	if m == nil {
		return nil
	}
	return m.Stream
}

func (m *MediaContainerWithDecisionPart) GetVideoProfile() any {
	if m == nil {
		return nil
	}
	return m.VideoProfile
}

func (m *MediaContainerWithDecisionPart) GetDecision() *Decision {
	if m == nil {
		return nil
	}
	return m.Decision
}

func (m *MediaContainerWithDecisionPart) GetSelected() *bool {
	if m == nil {
		return nil
	}
	return m.Selected
}

func (m *MediaContainerWithDecisionPart) GetAdditionalProperties() map[string]any {
	if m == nil {
		return nil
	}
	return m.AdditionalProperties
}

// MediaContainerWithDecisionMedia - `Media` represents an one or more media files (parts) and is a child of a metadata item. There aren't necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element.
type MediaContainerWithDecisionMedia struct {
	AspectRatio           *float64                         `json:"aspectRatio,omitempty"`
	AudioChannels         *int64                           `json:"audioChannels,omitempty"`
	AudioCodec            any                              `json:"audioCodec,omitempty"`
	AudioProfile          any                              `json:"audioProfile,omitempty"`
	Bitrate               *int64                           `json:"bitrate,omitempty"`
	Container             any                              `json:"container,omitempty"`
	Duration              *int64                           `json:"duration,omitempty"`
	Has64bitOffsets       *bool                            `json:"has64bitOffsets,omitempty"`
	HasVoiceActivity      *bool                            `json:"hasVoiceActivity,omitempty"`
	Height                *int64                           `json:"height,omitempty"`
	ID                    *int64                           `json:"id,omitempty"`
	OptimizedForStreaming *bool                            `json:"optimizedForStreaming,omitempty"`
	Part                  []MediaContainerWithDecisionPart `json:"Part,omitempty"`
	VideoCodec            any                              `json:"videoCodec,omitempty"`
	VideoFrameRate        any                              `json:"videoFrameRate,omitempty"`
	VideoProfile          any                              `json:"videoProfile,omitempty"`
	VideoResolution       any                              `json:"videoResolution,omitempty"`
	Width                 *int64                           `json:"width,omitempty"`
	Abr                   *bool                            `json:"abr,omitempty"`
	ResourceSession       *string                          `json:"resourceSession,omitempty"`
	Selected              *bool                            `json:"selected,omitempty"`
	AdditionalProperties  map[string]any                   `additionalProperties:"true" json:"-"`
}

func (m MediaContainerWithDecisionMedia) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(m, "", false)
}

func (m *MediaContainerWithDecisionMedia) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (m *MediaContainerWithDecisionMedia) GetAspectRatio() *float64 {
	if m == nil {
		return nil
	}
	return m.AspectRatio
}

func (m *MediaContainerWithDecisionMedia) GetAudioChannels() *int64 {
	if m == nil {
		return nil
	}
	return m.AudioChannels
}

func (m *MediaContainerWithDecisionMedia) GetAudioCodec() any {
	if m == nil {
		return nil
	}
	return m.AudioCodec
}

func (m *MediaContainerWithDecisionMedia) GetAudioProfile() any {
	if m == nil {
		return nil
	}
	return m.AudioProfile
}

func (m *MediaContainerWithDecisionMedia) GetBitrate() *int64 {
	if m == nil {
		return nil
	}
	return m.Bitrate
}

func (m *MediaContainerWithDecisionMedia) GetContainer() any {
	if m == nil {
		return nil
	}
	return m.Container
}

func (m *MediaContainerWithDecisionMedia) GetDuration() *int64 {
	if m == nil {
		return nil
	}
	return m.Duration
}

func (m *MediaContainerWithDecisionMedia) GetHas64bitOffsets() *bool {
	if m == nil {
		return nil
	}
	return m.Has64bitOffsets
}

func (m *MediaContainerWithDecisionMedia) GetHasVoiceActivity() *bool {
	if m == nil {
		return nil
	}
	return m.HasVoiceActivity
}

func (m *MediaContainerWithDecisionMedia) GetHeight() *int64 {
	if m == nil {
		return nil
	}
	return m.Height
}

func (m *MediaContainerWithDecisionMedia) GetID() *int64 {
	if m == nil {
		return nil
	}
	return m.ID
}

func (m *MediaContainerWithDecisionMedia) GetOptimizedForStreaming() *bool {
	if m == nil {
		return nil
	}
	return m.OptimizedForStreaming
}

func (m *MediaContainerWithDecisionMedia) GetPart() []MediaContainerWithDecisionPart {
	if m == nil {
		return nil
	}
	return m.Part
}

func (m *MediaContainerWithDecisionMedia) GetVideoCodec() any {
	if m == nil {
		return nil
	}
	return m.VideoCodec
}

func (m *MediaContainerWithDecisionMedia) GetVideoFrameRate() any {
	if m == nil {
		return nil
	}
	return m.VideoFrameRate
}

func (m *MediaContainerWithDecisionMedia) GetVideoProfile() any {
	if m == nil {
		return nil
	}
	return m.VideoProfile
}

func (m *MediaContainerWithDecisionMedia) GetVideoResolution() any {
	if m == nil {
		return nil
	}
	return m.VideoResolution
}

func (m *MediaContainerWithDecisionMedia) GetWidth() *int64 {
	if m == nil {
		return nil
	}
	return m.Width
}

func (m *MediaContainerWithDecisionMedia) GetAbr() *bool {
	if m == nil {
		return nil
	}
	return m.Abr
}

func (m *MediaContainerWithDecisionMedia) GetResourceSession() *string {
	if m == nil {
		return nil
	}
	return m.ResourceSession
}

func (m *MediaContainerWithDecisionMedia) GetSelected() *bool {
	if m == nil {
		return nil
	}
	return m.Selected
}

func (m *MediaContainerWithDecisionMedia) GetAdditionalProperties() map[string]any {
	if m == nil {
		return nil
	}
	return m.AdditionalProperties
}

// MediaContainerWithDecisionMetadata - Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a "media item" will have one or more "media parts" where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie.
//
// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director's cut vs. unrated version on the other hand would be separate metadata items.
//
// Metadata items can often live in a hierarchy with relationships between them.  For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item.  A similar hierarchy exists with track, album, and artist and photos and photo album.  The relationships may be expressed via relative terms and absolute terms.  For example, "leaves" refer to metadata items which has associated media (there is no media for a season nor show).  A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show.  Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show.
type MediaContainerWithDecisionMetadata struct {
	// The title of the item (e.g. “300” or “The Simpsons”)
	Title any `json:"title,omitempty"`
	// The type of the video item, such as `movie`, `episode`, or `clip`.
	Type any `json:"type,omitempty"`
	// When present, contains the disc number for a track on multi-disc albums.
	AbsoluteIndex *int64 `json:"absoluteIndex,omitempty"`
	// In units of seconds since the epoch, returns the time at which the item was added to the library.
	AddedAt *int64 `json:"addedAt,omitempty"`
	// When present, the URL for the background artwork for the item.
	Art any `json:"art,omitempty"`
	// Some rating systems separate reviewer ratings from audience ratings
	AudienceRating *float64 `json:"audienceRating,omitempty"`
	// A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled).
	AudienceRatingImage any   `json:"audienceRatingImage,omitempty"`
	Autotag             []Tag `json:"Autotag,omitempty"`
	// When present, the URL for a banner graphic for the item.
	Banner any `json:"banner,omitempty"`
	// When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two).
	ChapterSource any `json:"chapterSource,omitempty"`
	// When present, the URL for a composite image for descendent items (e.g. photo albums or playlists).
	Composite any `json:"composite,omitempty"`
	// If known, the content rating (e.g. MPAA) for an item.
	ContentRating any   `json:"contentRating,omitempty"`
	Country       []Tag `json:"Country,omitempty"`
	Director      []Tag `json:"Director,omitempty"`
	// When present, the duration for the item, in units of milliseconds.
	Duration *int64 `json:"duration,omitempty"`
	// Typically only seen in metadata at a library's top level
	Filter []Filter `json:"Filter,omitempty"`
	Genre  []Tag    `json:"Genre,omitempty"`
	// The `art` of the grandparent
	GrandparentArt *string `json:"grandparentArt,omitempty"`
	// The `hero` of the grandparent
	GrandparentHero *string `json:"grandparentHero,omitempty"`
	// The `key` of the grandparent
	GrandparentKey *string `json:"grandparentKey,omitempty"`
	// The `ratingKey` of the grandparent
	GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"`
	// The `theme` of the grandparent
	GrandparentTheme *string `json:"grandparentTheme,omitempty"`
	// The `thumb` of the grandparent
	GrandparentThumb *string `json:"grandparentThumb,omitempty"`
	// The `title` of the grandparent
	GrandparentTitle *string `json:"grandparentTitle,omitempty"`
	GUID             []Tag   `json:"Guid,omitempty"`
	// When present, the URL for a hero image for the item.
	Hero  any     `json:"hero,omitempty"`
	Image []Image `json:"Image,omitempty"`
	// When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks.
	Index *int64 `json:"index,omitempty"`
	// The key at which the item's details can be fetched.  In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details.
	Key any `json:"key,omitempty"`
	// When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time.
	LastViewedAt *int64 `json:"lastViewedAt,omitempty"`
	// For shows and seasons, contains the number of total episodes.
	LeafCount *int64                            `json:"leafCount,omitempty"`
	Media     []MediaContainerWithDecisionMedia `json:"Media,omitempty"`
	// When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don't use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well.
	OriginallyAvailableAt any `json:"originallyAvailableAt,omitempty"`
	// When present, used to indicate an item's original title, e.g. a movie's foreign title.
	OriginalTitle any `json:"originalTitle,omitempty"`
	// The `hero` of the parent
	ParentHero *string `json:"parentHero,omitempty"`
	// The `index` of the parent
	ParentIndex *int64 `json:"parentIndex,omitempty"`
	// The `key` of the parent
	ParentKey *string `json:"parentKey,omitempty"`
	// The `ratingKey` of the parent
	ParentRatingKey *string `json:"parentRatingKey,omitempty"`
	// The `thumb` of the parent
	ParentThumb *string `json:"parentThumb,omitempty"`
	// The `title` of the parent
	ParentTitle *string `json:"parentTitle,omitempty"`
	// Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item.
	PrimaryExtraKey any `json:"primaryExtraKey,omitempty"`
	// Prompt to give the user for this directory (such as `Search Movies`)
	Prompt *string `json:"prompt,omitempty"`
	// When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from.
	Rating      *float64 `json:"rating,omitempty"`
	RatingArray []Tag    `json:"Rating,omitempty"`
	// Number of ratings under this metadata
	RatingCount *int64 `json:"ratingCount,omitempty"`
	// When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten.
	RatingImage any `json:"ratingImage,omitempty"`
	// This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them.  While it often appears to be numeric, this is not guaranteed.
	RatingKey any   `json:"ratingKey,omitempty"`
	Role      []Tag `json:"Role,omitempty"`
	// Indicates this is a search directory
	Search *bool `json:"search,omitempty"`
	// Used by old clients to provide nested menus allowing for primative (but structured) navigation.
	Secondary *bool `json:"secondary,omitempty"`
	// When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc.
	SkipChildren *bool `json:"skipChildren,omitempty"`
	// When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show).
	SkipParent *bool `json:"skipParent,omitempty"`
	// Typically only seen in metadata at a library's top level
	Sort []Sort `json:"Sort,omitempty"`
	// When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums).
	Studio any `json:"studio,omitempty"`
	// The subtype of the video item, such as `photo` when the video item is in a photo library
	Subtype any `json:"subtype,omitempty"`
	// When present, the extended textual information about the item (e.g. movie plot, artist biography, album review).
	Summary any `json:"summary,omitempty"`
	// When present, a pithy one-liner about the item (usually only seen for movies).
	Tagline any `json:"tagline,omitempty"`
	// When present, the URL for theme music for the item (usually only for TV shows).
	Theme any `json:"theme,omitempty"`
	// When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail.
	Thumb any `json:"thumb,omitempty"`
	// Whene present, this is the string used for sorting the item. It's usually the title with any leading articles removed (e.g. “Simpsons”).
	TitleSort any `json:"titleSort,omitempty"`
	// In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated).
	UpdatedAt *int64 `json:"updatedAt,omitempty"`
	// When the user has rated an item, this contains the user rating
	UserRating *float64 `json:"userRating,omitempty"`
	// When a users has completed watched or listened to an item, this attribute contains the number of consumptions.
	ViewCount *int64 `json:"viewCount,omitempty"`
	// For shows and seasons, contains the number of viewed episodes.
	ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"`
	// When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds.
	ViewOffset *int64 `json:"viewOffset,omitempty"`
	Writer     []Tag  `json:"Writer,omitempty"`
	// When present, the year associated with the item's release (e.g. release year for a movie).
	Year                 *int64         `json:"year,omitempty"`
	AdditionalProperties map[string]any `additionalProperties:"true" json:"-"`
}

func (m MediaContainerWithDecisionMetadata) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(m, "", false)
}

func (m *MediaContainerWithDecisionMetadata) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil {
		return err
	}
	return nil
}

func (m *MediaContainerWithDecisionMetadata) GetTitle() any {
	if m == nil {
		return nil
	}
	return m.Title
}

func (m *MediaContainerWithDecisionMetadata) GetType() any {
	if m == nil {
		return nil
	}
	return m.Type
}

func (m *MediaContainerWithDecisionMetadata) GetAbsoluteIndex() *int64 {
	if m == nil {
		return nil
	}
	return m.AbsoluteIndex
}

func (m *MediaContainerWithDecisionMetadata) GetAddedAt() *int64 {
	if m == nil {
		return nil
	}
	return m.AddedAt
}

func (m *MediaContainerWithDecisionMetadata) GetArt() any {
	if m == nil {
		return nil
	}
	return m.Art
}

func (m *MediaContainerWithDecisionMetadata) GetAudienceRating() *float64 {
	if m == nil {
		return nil
	}
	return m.AudienceRating
}

func (m *MediaContainerWithDecisionMetadata) GetAudienceRatingImage() any {
	if m == nil {
		return nil
	}
	return m.AudienceRatingImage
}

func (m *MediaContainerWithDecisionMetadata) GetAutotag() []Tag {
	if m == nil {
		return nil
	}
	return m.Autotag
}

func (m *MediaContainerWithDecisionMetadata) GetBanner() any {
	if m == nil {
		return nil
	}
	return m.Banner
}

func (m *MediaContainerWithDecisionMetadata) GetChapterSource() any {
	if m == nil {
		return nil
	}
	return m.ChapterSource
}

func (m *MediaContainerWithDecisionMetadata) GetComposite() any {
	if m == nil {
		return nil
	}
	return m.Composite
}

func (m *MediaContainerWithDecisionMetadata) GetContentRating() any {
	if m == nil {
		return nil
	}
	return m.ContentRating
}

func (m *MediaContainerWithDecisionMetadata) GetCountry() []Tag {
	if m == nil {
		return nil
	}
	return m.Country
}

func (m *MediaContainerWithDecisionMetadata) GetDirector() []Tag {
	if m == nil {
		return nil
	}
	return m.Director
}

func (m *MediaContainerWithDecisionMetadata) GetDuration() *int64 {
	if m == nil {
		return nil
	}
	return m.Duration
}

func (m *MediaContainerWithDecisionMetadata) GetFilter() []Filter {
	if m == nil {
		return nil
	}
	return m.Filter
}

func (m *MediaContainerWithDecisionMetadata) GetGenre() []Tag {
	if m == nil {
		return nil
	}
	return m.Genre
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentArt() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentArt
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentHero() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentHero
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentKey() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentKey
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentRatingKey() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentRatingKey
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentTheme() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentTheme
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentThumb() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentThumb
}

func (m *MediaContainerWithDecisionMetadata) GetGrandparentTitle() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentTitle
}

func (m *MediaContainerWithDecisionMetadata) GetGUID() []Tag {
	if m == nil {
		return nil
	}
	return m.GUID
}

func (m *MediaContainerWithDecisionMetadata) GetHero() any {
	if m == nil {
		return nil
	}
	return m.Hero
}

func (m *MediaContainerWithDecisionMetadata) GetImage() []Image {
	if m == nil {
		return nil
	}
	return m.Image
}

func (m *MediaContainerWithDecisionMetadata) GetIndex() *int64 {
	if m == nil {
		return nil
	}
	return m.Index
}

func (m *MediaContainerWithDecisionMetadata) GetKey() any {
	if m == nil {
		return nil
	}
	return m.Key
}

func (m *MediaContainerWithDecisionMetadata) GetLastViewedAt() *int64 {
	if m == nil {
		return nil
	}
	return m.LastViewedAt
}

func (m *MediaContainerWithDecisionMetadata) GetLeafCount() *int64 {
	if m == nil {
		return nil
	}
	return m.LeafCount
}

func (m *MediaContainerWithDecisionMetadata) GetMedia() []MediaContainerWithDecisionMedia {
	if m == nil {
		return nil
	}
	return m.Media
}

func (m *MediaContainerWithDecisionMetadata) GetOriginallyAvailableAt() any {
	if m == nil {
		return nil
	}
	return m.OriginallyAvailableAt
}

func (m *MediaContainerWithDecisionMetadata) GetOriginalTitle() any {
	if m == nil {
		return nil
	}
	return m.OriginalTitle
}

func (m *MediaContainerWithDecisionMetadata) GetParentHero() *string {
	if m == nil {
		return nil
	}
	return m.ParentHero
}

func (m *MediaContainerWithDecisionMetadata) GetParentIndex() *int64 {
	if m == nil {
		return nil
	}
	return m.ParentIndex
}

func (m *MediaContainerWithDecisionMetadata) GetParentKey() *string {
	if m == nil {
		return nil
	}
	return m.ParentKey
}

func (m *MediaContainerWithDecisionMetadata) GetParentRatingKey() *string {
	if m == nil {
		return nil
	}
	return m.ParentRatingKey
}

func (m *MediaContainerWithDecisionMetadata) GetParentThumb() *string {
	if m == nil {
		return nil
	}
	return m.ParentThumb
}

func (m *MediaContainerWithDecisionMetadata) GetParentTitle() *string {
	if m == nil {
		return nil
	}
	return m.ParentTitle
}

func (m *MediaContainerWithDecisionMetadata) GetPrimaryExtraKey() any {
	if m == nil {
		return nil
	}
	return m.PrimaryExtraKey
}

func (m *MediaContainerWithDecisionMetadata) GetPrompt() *string {
	if m == nil {
		return nil
	}
	return m.Prompt
}

func (m *MediaContainerWithDecisionMetadata) GetRating() *float64 {
	if m == nil {
		return nil
	}
	return m.Rating
}

func (m *MediaContainerWithDecisionMetadata) GetRatingArray() []Tag {
	if m == nil {
		return nil
	}
	return m.RatingArray
}

func (m *MediaContainerWithDecisionMetadata) GetRatingCount() *int64 {
	if m == nil {
		return nil
	}
	return m.RatingCount
}

func (m *MediaContainerWithDecisionMetadata) GetRatingImage() any {
	if m == nil {
		return nil
	}
	return m.RatingImage
}

func (m *MediaContainerWithDecisionMetadata) GetRatingKey() any {
	if m == nil {
		return nil
	}
	return m.RatingKey
}

func (m *MediaContainerWithDecisionMetadata) GetRole() []Tag {
	if m == nil {
		return nil
	}
	return m.Role
}

func (m *MediaContainerWithDecisionMetadata) GetSearch() *bool {
	if m == nil {
		return nil
	}
	return m.Search
}

func (m *MediaContainerWithDecisionMetadata) GetSecondary() *bool {
	if m == nil {
		return nil
	}
	return m.Secondary
}

func (m *MediaContainerWithDecisionMetadata) GetSkipChildren() *bool {
	if m == nil {
		return nil
	}
	return m.SkipChildren
}

func (m *MediaContainerWithDecisionMetadata) GetSkipParent() *bool {
	if m == nil {
		return nil
	}
	return m.SkipParent
}

func (m *MediaContainerWithDecisionMetadata) GetSort() []Sort {
	if m == nil {
		return nil
	}
	return m.Sort
}

func (m *MediaContainerWithDecisionMetadata) GetStudio() any {
	if m == nil {
		return nil
	}
	return m.Studio
}

func (m *MediaContainerWithDecisionMetadata) GetSubtype() any {
	if m == nil {
		return nil
	}
	return m.Subtype
}

func (m *MediaContainerWithDecisionMetadata) GetSummary() any {
	if m == nil {
		return nil
	}
	return m.Summary
}

func (m *MediaContainerWithDecisionMetadata) GetTagline() any {
	if m == nil {
		return nil
	}
	return m.Tagline
}

func (m *MediaContainerWithDecisionMetadata) GetTheme() any {
	if m == nil {
		return nil
	}
	return m.Theme
}

func (m *MediaContainerWithDecisionMetadata) GetThumb() any {
	if m == nil {
		return nil
	}
	return m.Thumb
}

func (m *MediaContainerWithDecisionMetadata) GetTitleSort() any {
	if m == nil {
		return nil
	}
	return m.TitleSort
}

func (m *MediaContainerWithDecisionMetadata) GetUpdatedAt() *int64 {
	if m == nil {
		return nil
	}
	return m.UpdatedAt
}

func (m *MediaContainerWithDecisionMetadata) GetUserRating() *float64 {
	if m == nil {
		return nil
	}
	return m.UserRating
}

func (m *MediaContainerWithDecisionMetadata) GetViewCount() *int64 {
	if m == nil {
		return nil
	}
	return m.ViewCount
}

func (m *MediaContainerWithDecisionMetadata) GetViewedLeafCount() *int64 {
	if m == nil {
		return nil
	}
	return m.ViewedLeafCount
}

func (m *MediaContainerWithDecisionMetadata) GetViewOffset() *int64 {
	if m == nil {
		return nil
	}
	return m.ViewOffset
}

func (m *MediaContainerWithDecisionMetadata) GetWriter() []Tag {
	if m == nil {
		return nil
	}
	return m.Writer
}

func (m *MediaContainerWithDecisionMetadata) GetYear() *int64 {
	if m == nil {
		return nil
	}
	return m.Year
}

func (m *MediaContainerWithDecisionMetadata) GetAdditionalProperties() map[string]any {
	if m == nil {
		return nil
	}
	return m.AdditionalProperties
}

// MediaContainerWithDecisionMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.
type MediaContainerWithDecisionMediaContainer struct {
	Identifier *string `json:"identifier,omitempty"`
	// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
	//
	Offset *int64 `json:"offset,omitempty"`
	Size   *int64 `json:"size,omitempty"`
	// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
	//
	TotalSize *int64 `json:"totalSize,omitempty"`
	// The maximum available bitrate when the decision was rendered.
	AvailableBandwidth     *int64  `json:"availableBandwidth,omitempty"`
	DirectPlayDecisionCode *int64  `json:"directPlayDecisionCode,omitempty"`
	DirectPlayDecisionText *string `json:"directPlayDecisionText,omitempty"`
	// The overall decision. 1xxx are playback can succeed, 2xxx are a general error (such as insufficient bandwidth), 3xxx are errors in direct play, and 4xxx are errors in transcodes. Same codes are used in all.
	GeneralDecisionCode *int64  `json:"generalDecisionCode,omitempty"`
	GeneralDecisionText *string `json:"generalDecisionText,omitempty"`
	// The code indicating the status of evaluation of playback when client indicates `hasMDE=1`
	MdeDecisionCode *int64 `json:"mdeDecisionCode,omitempty"`
	// Descriptive text for the above code
	MdeDecisionText       *string                              `json:"mdeDecisionText,omitempty"`
	Metadata              []MediaContainerWithDecisionMetadata `json:"Metadata,omitempty"`
	TranscodeDecisionCode *int64                               `json:"transcodeDecisionCode,omitempty"`
	TranscodeDecisionText *string                              `json:"transcodeDecisionText,omitempty"`
}

func (m *MediaContainerWithDecisionMediaContainer) GetIdentifier() *string {
	if m == nil {
		return nil
	}
	return m.Identifier
}

func (m *MediaContainerWithDecisionMediaContainer) GetOffset() *int64 {
	if m == nil {
		return nil
	}
	return m.Offset
}

func (m *MediaContainerWithDecisionMediaContainer) GetSize() *int64 {
	if m == nil {
		return nil
	}
	return m.Size
}

func (m *MediaContainerWithDecisionMediaContainer) GetTotalSize() *int64 {
	if m == nil {
		return nil
	}
	return m.TotalSize
}

func (m *MediaContainerWithDecisionMediaContainer) GetAvailableBandwidth() *int64 {
	if m == nil {
		return nil
	}
	return m.AvailableBandwidth
}

func (m *MediaContainerWithDecisionMediaContainer) GetDirectPlayDecisionCode() *int64 {
	if m == nil {
		return nil
	}
	return m.DirectPlayDecisionCode
}

func (m *MediaContainerWithDecisionMediaContainer) GetDirectPlayDecisionText() *string {
	if m == nil {
		return nil
	}
	return m.DirectPlayDecisionText
}

func (m *MediaContainerWithDecisionMediaContainer) GetGeneralDecisionCode() *int64 {
	if m == nil {
		return nil
	}
	return m.GeneralDecisionCode
}

func (m *MediaContainerWithDecisionMediaContainer) GetGeneralDecisionText() *string {
	if m == nil {
		return nil
	}
	return m.GeneralDecisionText
}

func (m *MediaContainerWithDecisionMediaContainer) GetMdeDecisionCode() *int64 {
	if m == nil {
		return nil
	}
	return m.MdeDecisionCode
}

func (m *MediaContainerWithDecisionMediaContainer) GetMdeDecisionText() *string {
	if m == nil {
		return nil
	}
	return m.MdeDecisionText
}

func (m *MediaContainerWithDecisionMediaContainer) GetMetadata() []MediaContainerWithDecisionMetadata {
	if m == nil {
		return nil
	}
	return m.Metadata
}

func (m *MediaContainerWithDecisionMediaContainer) GetTranscodeDecisionCode() *int64 {
	if m == nil {
		return nil
	}
	return m.TranscodeDecisionCode
}

func (m *MediaContainerWithDecisionMediaContainer) GetTranscodeDecisionText() *string {
	if m == nil {
		return nil
	}
	return m.TranscodeDecisionText
}

// MediaContainerWithDecision - `MediaContainer` is commonly found as the root of a response and is a pretty generic container. Common attributes include `identifier` and things related to paging (`offset`, `size`, `totalSize`).
//
// It is also common for a `MediaContainer` to contain attributes "hoisted" from its children. If every element in the container would have had the same attribute, then that attribute can be present on the container instead of being repeated on every element. For example, an album's list of tracks might include `parentTitle` on the container since all of the tracks have the same album title. A container may have a `source` attribute when all of the items came from the same source. Generally speaking, when looking for an attribute on an item, if the attribute wasn't found then the container should be checked for that attribute as well.
type MediaContainerWithDecision struct {
	MediaContainer *MediaContainerWithDecisionMediaContainer `json:"MediaContainer,omitempty"`
}

func (m *MediaContainerWithDecision) GetMediaContainer() *MediaContainerWithDecisionMediaContainer {
	if m == nil {
		return nil
	}
	return m.MediaContainer
}
