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

package components

import (
	"github.com/LukeHagar/plexgo/internal/utils"
	"github.com/LukeHagar/plexgo/types"
)

type MediaContainerWithNestedMetadataGuids struct {
	// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
	//
	ID string `json:"id"`
}

func (m *MediaContainerWithNestedMetadataGuids) GetID() string {
	if m == nil {
		return ""
	}
	return m.ID
}

// MetadataItem - 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 MetadataItem struct {
	// The title of the item (e.g. “300” or “The Simpsons”)
	Title string `json:"title"`
	// The type of the video item, such as `movie`, `episode`, or `clip`.
	Type string `json:"type"`
	// When present, contains the disc number for a track on multi-disc albums.
	AbsoluteIndex *int `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"`
	// When present, the URL for the background artwork for the item.
	Art *string `json:"art,omitempty"`
	// Some rating systems separate reviewer ratings from audience ratings
	AudienceRating *float32 `json:"audienceRating,omitempty"`
	// A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled).
	AudienceRatingImage *string `json:"audienceRatingImage,omitempty"`
	Autotag             []Tag   `json:"Autotag,omitempty"`
	// When present, the URL for a banner graphic for the item.
	Banner *string `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 *string `json:"chapterSource,omitempty"`
	// The number of child items associated with this media item.
	ChildCount *int `json:"childCount,omitempty"`
	// When present, the URL for a composite image for descendent items (e.g. photo albums or playlists).
	Composite *string `json:"composite,omitempty"`
	// If known, the content rating (e.g. MPAA) for an item.
	ContentRating *string `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 *int `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 GUID of the grandparent media item.
	GrandparentGUID *string `json:"grandparentGuid,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"`
	// The globally unique identifier for the media item.
	GUID  *string                                 `json:"guid,omitempty"`
	Guids []MediaContainerWithNestedMetadataGuids `json:"Guid,omitempty"`
	// When present, the URL for a hero image for the item.
	Hero  *string `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 *int `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          string `json:"key"`
	LastViewedAt *int64 `json:"lastViewedAt,omitempty"`
	// For shows and seasons, contains the number of total episodes.
	LeafCount *int    `json:"leafCount,omitempty"`
	Media     []Media `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 *types.Date `json:"originallyAvailableAt,omitempty"`
	// When present, used to indicate an item's original title, e.g. a movie's foreign title.
	OriginalTitle *string `json:"originalTitle,omitempty"`
	// The GUID of the parent media item.
	ParentGUID *string `json:"parentGuid,omitempty"`
	// The `hero` of the parent
	ParentHero *string `json:"parentHero,omitempty"`
	// The `index` of the parent
	ParentIndex *int `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 *string `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      *float32 `json:"rating,omitempty"`
	RatingArray []Tag    `json:"Rating,omitempty"`
	// Number of ratings under this metadata
	RatingCount *int `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 *string `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 *string `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 *string `json:"studio,omitempty"`
	// The subtype of the video item, such as `photo` when the video item is in a photo library
	Subtype *string `json:"subtype,omitempty"`
	// When present, the extended textual information about the item (e.g. movie plot, artist biography, album review).
	Summary *string `json:"summary,omitempty"`
	// When present, a pithy one-liner about the item (usually only seen for movies).
	Tagline *string `json:"tagline,omitempty"`
	// When present, the URL for theme music for the item (usually only for TV shows).
	Theme *string `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 *string `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 *string `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 *float32 `json:"userRating,omitempty"`
	// When a users has completed watched or listened to an item, this attribute contains the number of consumptions.
	ViewCount *int `json:"viewCount,omitempty"`
	// For shows and seasons, contains the number of viewed episodes.
	ViewedLeafCount *int `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 *int  `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                 *int           `json:"year,omitempty"`
	MetadataItem         []Items        `json:"MetadataItem,omitempty"`
	AdditionalProperties map[string]any `additionalProperties:"true" json:"-"`
}

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

func (m *MetadataItem) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &m, "", false, []string{"title", "type", "addedAt", "key"}); err != nil {
		return err
	}
	return nil
}

func (m *MetadataItem) GetTitle() string {
	if m == nil {
		return ""
	}
	return m.Title
}

func (m *MetadataItem) GetType() string {
	if m == nil {
		return ""
	}
	return m.Type
}

func (m *MetadataItem) GetAbsoluteIndex() *int {
	if m == nil {
		return nil
	}
	return m.AbsoluteIndex
}

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

func (m *MetadataItem) GetArt() *string {
	if m == nil {
		return nil
	}
	return m.Art
}

func (m *MetadataItem) GetAudienceRating() *float32 {
	if m == nil {
		return nil
	}
	return m.AudienceRating
}

func (m *MetadataItem) GetAudienceRatingImage() *string {
	if m == nil {
		return nil
	}
	return m.AudienceRatingImage
}

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

func (m *MetadataItem) GetBanner() *string {
	if m == nil {
		return nil
	}
	return m.Banner
}

func (m *MetadataItem) GetChapterSource() *string {
	if m == nil {
		return nil
	}
	return m.ChapterSource
}

func (m *MetadataItem) GetChildCount() *int {
	if m == nil {
		return nil
	}
	return m.ChildCount
}

func (m *MetadataItem) GetComposite() *string {
	if m == nil {
		return nil
	}
	return m.Composite
}

func (m *MetadataItem) GetContentRating() *string {
	if m == nil {
		return nil
	}
	return m.ContentRating
}

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

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

func (m *MetadataItem) GetDuration() *int {
	if m == nil {
		return nil
	}
	return m.Duration
}

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

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

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

func (m *MetadataItem) GetGrandparentGUID() *string {
	if m == nil {
		return nil
	}
	return m.GrandparentGUID
}

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

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

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

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

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

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

func (m *MetadataItem) GetGUID() *string {
	if m == nil {
		return nil
	}
	return m.GUID
}

func (m *MetadataItem) GetGuids() []MediaContainerWithNestedMetadataGuids {
	if m == nil {
		return nil
	}
	return m.Guids
}

func (m *MetadataItem) GetHero() *string {
	if m == nil {
		return nil
	}
	return m.Hero
}

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

func (m *MetadataItem) GetIndex() *int {
	if m == nil {
		return nil
	}
	return m.Index
}

func (m *MetadataItem) GetKey() string {
	if m == nil {
		return ""
	}
	return m.Key
}

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

func (m *MetadataItem) GetLeafCount() *int {
	if m == nil {
		return nil
	}
	return m.LeafCount
}

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

func (m *MetadataItem) GetOriginallyAvailableAt() *types.Date {
	if m == nil {
		return nil
	}
	return m.OriginallyAvailableAt
}

func (m *MetadataItem) GetOriginalTitle() *string {
	if m == nil {
		return nil
	}
	return m.OriginalTitle
}

func (m *MetadataItem) GetParentGUID() *string {
	if m == nil {
		return nil
	}
	return m.ParentGUID
}

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

func (m *MetadataItem) GetParentIndex() *int {
	if m == nil {
		return nil
	}
	return m.ParentIndex
}

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

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

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

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

func (m *MetadataItem) GetPrimaryExtraKey() *string {
	if m == nil {
		return nil
	}
	return m.PrimaryExtraKey
}

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

func (m *MetadataItem) GetRating() *float32 {
	if m == nil {
		return nil
	}
	return m.Rating
}

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

func (m *MetadataItem) GetRatingCount() *int {
	if m == nil {
		return nil
	}
	return m.RatingCount
}

func (m *MetadataItem) GetRatingImage() *string {
	if m == nil {
		return nil
	}
	return m.RatingImage
}

func (m *MetadataItem) GetRatingKey() *string {
	if m == nil {
		return nil
	}
	return m.RatingKey
}

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

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

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

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

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

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

func (m *MetadataItem) GetStudio() *string {
	if m == nil {
		return nil
	}
	return m.Studio
}

func (m *MetadataItem) GetSubtype() *string {
	if m == nil {
		return nil
	}
	return m.Subtype
}

func (m *MetadataItem) GetSummary() *string {
	if m == nil {
		return nil
	}
	return m.Summary
}

func (m *MetadataItem) GetTagline() *string {
	if m == nil {
		return nil
	}
	return m.Tagline
}

func (m *MetadataItem) GetTheme() *string {
	if m == nil {
		return nil
	}
	return m.Theme
}

func (m *MetadataItem) GetThumb() *string {
	if m == nil {
		return nil
	}
	return m.Thumb
}

func (m *MetadataItem) GetTitleSort() *string {
	if m == nil {
		return nil
	}
	return m.TitleSort
}

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

func (m *MetadataItem) GetUserRating() *float32 {
	if m == nil {
		return nil
	}
	return m.UserRating
}

func (m *MetadataItem) GetViewCount() *int {
	if m == nil {
		return nil
	}
	return m.ViewCount
}

func (m *MetadataItem) GetViewedLeafCount() *int {
	if m == nil {
		return nil
	}
	return m.ViewedLeafCount
}

func (m *MetadataItem) GetViewOffset() *int {
	if m == nil {
		return nil
	}
	return m.ViewOffset
}

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

func (m *MetadataItem) GetYear() *int {
	if m == nil {
		return nil
	}
	return m.Year
}

func (m *MetadataItem) GetMetadataItem() []Items {
	if m == nil {
		return nil
	}
	return m.MetadataItem
}

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

// MediaContainerWithNestedMetadataMediaContainer - `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 MediaContainerWithNestedMetadataMediaContainer 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"`
	MetadataItem []MetadataItem `json:"MetadataItem,omitempty"`
}

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

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

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

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

func (m *MediaContainerWithNestedMetadataMediaContainer) GetMetadataItem() []MetadataItem {
	if m == nil {
		return nil
	}
	return m.MetadataItem
}

type MediaContainerWithNestedMetadata struct {
	MediaContainer *MediaContainerWithNestedMetadataMediaContainer `json:"MediaContainer,omitempty"`
}

func (m *MediaContainerWithNestedMetadata) GetMediaContainer() *MediaContainerWithNestedMetadataMediaContainer {
	if m == nil {
		return nil
	}
	return m.MediaContainer
}
