// 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 ItemsGuids struct {
	// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
	//
	ID string `json:"id"`
}

func (i *ItemsGuids) GetID() string {
	if i == nil {
		return ""
	}
	return i.ID
}

// 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 Items 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 []ItemsGuids `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 (i Items) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(i, "", false)
}

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

func (i *Items) GetTitle() string {
	if i == nil {
		return ""
	}
	return i.Title
}

func (i *Items) GetType() string {
	if i == nil {
		return ""
	}
	return i.Type
}

func (i *Items) GetAbsoluteIndex() *int {
	if i == nil {
		return nil
	}
	return i.AbsoluteIndex
}

func (i *Items) GetAddedAt() int64 {
	if i == nil {
		return 0
	}
	return i.AddedAt
}

func (i *Items) GetArt() *string {
	if i == nil {
		return nil
	}
	return i.Art
}

func (i *Items) GetAudienceRating() *float32 {
	if i == nil {
		return nil
	}
	return i.AudienceRating
}

func (i *Items) GetAudienceRatingImage() *string {
	if i == nil {
		return nil
	}
	return i.AudienceRatingImage
}

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

func (i *Items) GetBanner() *string {
	if i == nil {
		return nil
	}
	return i.Banner
}

func (i *Items) GetChapterSource() *string {
	if i == nil {
		return nil
	}
	return i.ChapterSource
}

func (i *Items) GetChildCount() *int {
	if i == nil {
		return nil
	}
	return i.ChildCount
}

func (i *Items) GetComposite() *string {
	if i == nil {
		return nil
	}
	return i.Composite
}

func (i *Items) GetContentRating() *string {
	if i == nil {
		return nil
	}
	return i.ContentRating
}

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

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

func (i *Items) GetDuration() *int {
	if i == nil {
		return nil
	}
	return i.Duration
}

func (i *Items) GetFilter() []Filter {
	if i == nil {
		return nil
	}
	return i.Filter
}

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

func (i *Items) GetGrandparentArt() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentArt
}

func (i *Items) GetGrandparentGUID() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentGUID
}

func (i *Items) GetGrandparentHero() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentHero
}

func (i *Items) GetGrandparentKey() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentKey
}

func (i *Items) GetGrandparentRatingKey() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentRatingKey
}

func (i *Items) GetGrandparentTheme() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentTheme
}

func (i *Items) GetGrandparentThumb() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentThumb
}

func (i *Items) GetGrandparentTitle() *string {
	if i == nil {
		return nil
	}
	return i.GrandparentTitle
}

func (i *Items) GetGUID() *string {
	if i == nil {
		return nil
	}
	return i.GUID
}

func (i *Items) GetGuids() []ItemsGuids {
	if i == nil {
		return nil
	}
	return i.Guids
}

func (i *Items) GetHero() *string {
	if i == nil {
		return nil
	}
	return i.Hero
}

func (i *Items) GetImage() []Image {
	if i == nil {
		return nil
	}
	return i.Image
}

func (i *Items) GetIndex() *int {
	if i == nil {
		return nil
	}
	return i.Index
}

func (i *Items) GetKey() string {
	if i == nil {
		return ""
	}
	return i.Key
}

func (i *Items) GetLastViewedAt() *int64 {
	if i == nil {
		return nil
	}
	return i.LastViewedAt
}

func (i *Items) GetLeafCount() *int {
	if i == nil {
		return nil
	}
	return i.LeafCount
}

func (i *Items) GetMedia() []Media {
	if i == nil {
		return nil
	}
	return i.Media
}

func (i *Items) GetOriginallyAvailableAt() *types.Date {
	if i == nil {
		return nil
	}
	return i.OriginallyAvailableAt
}

func (i *Items) GetOriginalTitle() *string {
	if i == nil {
		return nil
	}
	return i.OriginalTitle
}

func (i *Items) GetParentGUID() *string {
	if i == nil {
		return nil
	}
	return i.ParentGUID
}

func (i *Items) GetParentHero() *string {
	if i == nil {
		return nil
	}
	return i.ParentHero
}

func (i *Items) GetParentIndex() *int {
	if i == nil {
		return nil
	}
	return i.ParentIndex
}

func (i *Items) GetParentKey() *string {
	if i == nil {
		return nil
	}
	return i.ParentKey
}

func (i *Items) GetParentRatingKey() *string {
	if i == nil {
		return nil
	}
	return i.ParentRatingKey
}

func (i *Items) GetParentThumb() *string {
	if i == nil {
		return nil
	}
	return i.ParentThumb
}

func (i *Items) GetParentTitle() *string {
	if i == nil {
		return nil
	}
	return i.ParentTitle
}

func (i *Items) GetPrimaryExtraKey() *string {
	if i == nil {
		return nil
	}
	return i.PrimaryExtraKey
}

func (i *Items) GetPrompt() *string {
	if i == nil {
		return nil
	}
	return i.Prompt
}

func (i *Items) GetRating() *float32 {
	if i == nil {
		return nil
	}
	return i.Rating
}

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

func (i *Items) GetRatingCount() *int {
	if i == nil {
		return nil
	}
	return i.RatingCount
}

func (i *Items) GetRatingImage() *string {
	if i == nil {
		return nil
	}
	return i.RatingImage
}

func (i *Items) GetRatingKey() *string {
	if i == nil {
		return nil
	}
	return i.RatingKey
}

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

func (i *Items) GetSearch() *bool {
	if i == nil {
		return nil
	}
	return i.Search
}

func (i *Items) GetSecondary() *bool {
	if i == nil {
		return nil
	}
	return i.Secondary
}

func (i *Items) GetSkipChildren() *bool {
	if i == nil {
		return nil
	}
	return i.SkipChildren
}

func (i *Items) GetSkipParent() *bool {
	if i == nil {
		return nil
	}
	return i.SkipParent
}

func (i *Items) GetSort() []Sort {
	if i == nil {
		return nil
	}
	return i.Sort
}

func (i *Items) GetStudio() *string {
	if i == nil {
		return nil
	}
	return i.Studio
}

func (i *Items) GetSubtype() *string {
	if i == nil {
		return nil
	}
	return i.Subtype
}

func (i *Items) GetSummary() *string {
	if i == nil {
		return nil
	}
	return i.Summary
}

func (i *Items) GetTagline() *string {
	if i == nil {
		return nil
	}
	return i.Tagline
}

func (i *Items) GetTheme() *string {
	if i == nil {
		return nil
	}
	return i.Theme
}

func (i *Items) GetThumb() *string {
	if i == nil {
		return nil
	}
	return i.Thumb
}

func (i *Items) GetTitleSort() *string {
	if i == nil {
		return nil
	}
	return i.TitleSort
}

func (i *Items) GetUpdatedAt() *int64 {
	if i == nil {
		return nil
	}
	return i.UpdatedAt
}

func (i *Items) GetUserRating() *float32 {
	if i == nil {
		return nil
	}
	return i.UserRating
}

func (i *Items) GetViewCount() *int {
	if i == nil {
		return nil
	}
	return i.ViewCount
}

func (i *Items) GetViewedLeafCount() *int {
	if i == nil {
		return nil
	}
	return i.ViewedLeafCount
}

func (i *Items) GetViewOffset() *int {
	if i == nil {
		return nil
	}
	return i.ViewOffset
}

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

func (i *Items) GetYear() *int {
	if i == nil {
		return nil
	}
	return i.Year
}

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

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