Files
plexgo/models/operations/getlibraryitems.go

1999 lines
43 KiB
Go

// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
package operations
import (
"encoding/json"
"errors"
"fmt"
"github.com/LukeHagar/plexgo/internal/utils"
"github.com/LukeHagar/plexgo/types"
"net/http"
)
// Tag - A key representing a specific tag within the section.
type Tag string
const (
TagAll Tag = "all"
TagUnwatched Tag = "unwatched"
TagNewest Tag = "newest"
TagRecentlyAdded Tag = "recentlyAdded"
TagRecentlyViewed Tag = "recentlyViewed"
TagOnDeck Tag = "onDeck"
TagCollection Tag = "collection"
TagEdition Tag = "edition"
TagGenre Tag = "genre"
TagYear Tag = "year"
TagDecade Tag = "decade"
TagDirector Tag = "director"
TagActor Tag = "actor"
TagCountry Tag = "country"
TagContentRating Tag = "contentRating"
TagRating Tag = "rating"
TagResolution Tag = "resolution"
TagFirstCharacter Tag = "firstCharacter"
TagFolder Tag = "folder"
)
func (e Tag) ToPointer() *Tag {
return &e
}
func (e *Tag) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "all":
fallthrough
case "unwatched":
fallthrough
case "newest":
fallthrough
case "recentlyAdded":
fallthrough
case "recentlyViewed":
fallthrough
case "onDeck":
fallthrough
case "collection":
fallthrough
case "edition":
fallthrough
case "genre":
fallthrough
case "year":
fallthrough
case "decade":
fallthrough
case "director":
fallthrough
case "actor":
fallthrough
case "country":
fallthrough
case "contentRating":
fallthrough
case "rating":
fallthrough
case "resolution":
fallthrough
case "firstCharacter":
fallthrough
case "folder":
*e = Tag(v)
return nil
default:
return fmt.Errorf("invalid value for Tag: %v", v)
}
}
// IncludeGuids - Adds the Guids object to the response
type IncludeGuids int
const (
IncludeGuidsDisable IncludeGuids = 0
IncludeGuidsEnable IncludeGuids = 1
)
func (e IncludeGuids) ToPointer() *IncludeGuids {
return &e
}
func (e *IncludeGuids) UnmarshalJSON(data []byte) error {
var v int
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case 0:
fallthrough
case 1:
*e = IncludeGuids(v)
return nil
default:
return fmt.Errorf("invalid value for IncludeGuids: %v", v)
}
}
// IncludeMeta - Adds the Meta object to the response
type IncludeMeta int
const (
IncludeMetaDisable IncludeMeta = 0
IncludeMetaEnable IncludeMeta = 1
)
func (e IncludeMeta) ToPointer() *IncludeMeta {
return &e
}
func (e *IncludeMeta) UnmarshalJSON(data []byte) error {
var v int
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case 0:
fallthrough
case 1:
*e = IncludeMeta(v)
return nil
default:
return fmt.Errorf("invalid value for IncludeMeta: %v", v)
}
}
// Type - The type of media to retrieve.
// 1 = movie
// 2 = show
// 3 = season
// 4 = episode
// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
type Type int64
const (
TypeMovie Type = 1
TypeTvShow Type = 2
TypeSeason Type = 3
TypeEpisode Type = 4
)
func (e Type) ToPointer() *Type {
return &e
}
func (e *Type) UnmarshalJSON(data []byte) error {
var v int64
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case 1:
fallthrough
case 2:
fallthrough
case 3:
fallthrough
case 4:
*e = Type(v)
return nil
default:
return fmt.Errorf("invalid value for Type: %v", v)
}
}
type GetLibraryItemsRequest struct {
// The unique key of the Plex library.
// Note: This is unique in the context of the Plex server.
//
SectionKey int `pathParam:"style=simple,explode=false,name=sectionKey"`
// A key representing a specific tag within the section.
Tag Tag `pathParam:"style=simple,explode=false,name=tag"`
// Adds the Guids object to the response
//
IncludeGuids *IncludeGuids `default:"0" queryParam:"style=form,explode=true,name=includeGuids"`
// Adds the Meta object to the response
//
IncludeMeta *IncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"`
// The type of media to retrieve.
// 1 = movie
// 2 = show
// 3 = season
// 4 = episode
// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
//
Type *Type `queryParam:"style=form,explode=true,name=type"`
// The index of the first item to return. If not specified, the first item will be returned.
// If the number of items exceeds the limit, the response will be paginated.
// By default this is 0
//
XPlexContainerStart *int `default:"0" queryParam:"style=form,explode=true,name=X-Plex-Container-Start"`
// The number of items to return. If not specified, all items will be returned.
// If the number of items exceeds the limit, the response will be paginated.
// By default this is 50
//
XPlexContainerSize *int `default:"50" queryParam:"style=form,explode=true,name=X-Plex-Container-Size"`
}
func (g GetLibraryItemsRequest) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetLibraryItemsRequest) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetLibraryItemsRequest) GetSectionKey() int {
if o == nil {
return 0
}
return o.SectionKey
}
func (o *GetLibraryItemsRequest) GetTag() Tag {
if o == nil {
return Tag("")
}
return o.Tag
}
func (o *GetLibraryItemsRequest) GetIncludeGuids() *IncludeGuids {
if o == nil {
return nil
}
return o.IncludeGuids
}
func (o *GetLibraryItemsRequest) GetIncludeMeta() *IncludeMeta {
if o == nil {
return nil
}
return o.IncludeMeta
}
func (o *GetLibraryItemsRequest) GetType() *Type {
if o == nil {
return nil
}
return o.Type
}
func (o *GetLibraryItemsRequest) GetXPlexContainerStart() *int {
if o == nil {
return nil
}
return o.XPlexContainerStart
}
func (o *GetLibraryItemsRequest) GetXPlexContainerSize() *int {
if o == nil {
return nil
}
return o.XPlexContainerSize
}
type LibrarySectionIDType string
const (
LibrarySectionIDTypeInteger LibrarySectionIDType = "integer"
LibrarySectionIDTypeStr LibrarySectionIDType = "str"
)
type LibrarySectionID struct {
Integer *int64
Str *string
Type LibrarySectionIDType
}
func CreateLibrarySectionIDInteger(integer int64) LibrarySectionID {
typ := LibrarySectionIDTypeInteger
return LibrarySectionID{
Integer: &integer,
Type: typ,
}
}
func CreateLibrarySectionIDStr(str string) LibrarySectionID {
typ := LibrarySectionIDTypeStr
return LibrarySectionID{
Str: &str,
Type: typ,
}
}
func (u *LibrarySectionID) UnmarshalJSON(data []byte) error {
var integer int64 = int64(0)
if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil {
u.Integer = &integer
u.Type = LibrarySectionIDTypeInteger
return nil
}
var str string = ""
if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil {
u.Str = &str
u.Type = LibrarySectionIDTypeStr
return nil
}
return fmt.Errorf("could not unmarshal `%s` into any supported union types for LibrarySectionID", string(data))
}
func (u LibrarySectionID) MarshalJSON() ([]byte, error) {
if u.Integer != nil {
return utils.MarshalJSON(u.Integer, "", true)
}
if u.Str != nil {
return utils.MarshalJSON(u.Str, "", true)
}
return nil, errors.New("could not marshal union type LibrarySectionID: all fields are null")
}
// GetLibraryItemsType - The type of media content
type GetLibraryItemsType string
const (
GetLibraryItemsTypeMovie GetLibraryItemsType = "movie"
GetLibraryItemsTypeTvShow GetLibraryItemsType = "show"
GetLibraryItemsTypeSeason GetLibraryItemsType = "season"
GetLibraryItemsTypeEpisode GetLibraryItemsType = "episode"
)
func (e GetLibraryItemsType) ToPointer() *GetLibraryItemsType {
return &e
}
func (e *GetLibraryItemsType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "movie":
fallthrough
case "show":
fallthrough
case "season":
fallthrough
case "episode":
*e = GetLibraryItemsType(v)
return nil
default:
return fmt.Errorf("invalid value for GetLibraryItemsType: %v", v)
}
}
type FlattenSeasons string
const (
FlattenSeasonsFalse FlattenSeasons = "0"
FlattenSeasonsTrue FlattenSeasons = "1"
)
func (e FlattenSeasons) ToPointer() *FlattenSeasons {
return &e
}
func (e *FlattenSeasons) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "0":
fallthrough
case "1":
*e = FlattenSeasons(v)
return nil
default:
return fmt.Errorf("invalid value for FlattenSeasons: %v", v)
}
}
// ShowOrdering - Setting that indicates the episode ordering for the show
// None = Library default,
// tmdbAiring = The Movie Database (Aired),
// aired = TheTVDB (Aired),
// dvd = TheTVDB (DVD),
// absolute = TheTVDB (Absolute)).
type ShowOrdering string
const (
ShowOrderingNone ShowOrdering = "None"
ShowOrderingTmdbAiring ShowOrdering = "tmdbAiring"
ShowOrderingAired ShowOrdering = "aired"
ShowOrderingDvd ShowOrdering = "dvd"
ShowOrderingAbsolute ShowOrdering = "absolute"
)
func (e ShowOrdering) ToPointer() *ShowOrdering {
return &e
}
func (e *ShowOrdering) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "None":
fallthrough
case "tmdbAiring":
fallthrough
case "aired":
fallthrough
case "dvd":
fallthrough
case "absolute":
*e = ShowOrdering(v)
return nil
default:
return fmt.Errorf("invalid value for ShowOrdering: %v", v)
}
}
type HasThumbnail string
const (
HasThumbnailFalse HasThumbnail = "0"
HasThumbnailTrue HasThumbnail = "1"
)
func (e HasThumbnail) ToPointer() *HasThumbnail {
return &e
}
func (e *HasThumbnail) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "0":
fallthrough
case "1":
*e = HasThumbnail(v)
return nil
default:
return fmt.Errorf("invalid value for HasThumbnail: %v", v)
}
}
type GetLibraryItemsPart struct {
ID int `json:"id"`
Key string `json:"key"`
Duration int `json:"duration"`
File string `json:"file"`
Size int64 `json:"size"`
// The container format of the media file.
//
Container string `json:"container"`
AudioProfile *string `json:"audioProfile,omitempty"`
VideoProfile string `json:"videoProfile"`
Indexes *string `json:"indexes,omitempty"`
HasThumbnail *HasThumbnail `default:"0" json:"hasThumbnail"`
}
func (g GetLibraryItemsPart) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetLibraryItemsPart) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetLibraryItemsPart) GetID() int {
if o == nil {
return 0
}
return o.ID
}
func (o *GetLibraryItemsPart) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsPart) GetDuration() int {
if o == nil {
return 0
}
return o.Duration
}
func (o *GetLibraryItemsPart) GetFile() string {
if o == nil {
return ""
}
return o.File
}
func (o *GetLibraryItemsPart) GetSize() int64 {
if o == nil {
return 0
}
return o.Size
}
func (o *GetLibraryItemsPart) GetContainer() string {
if o == nil {
return ""
}
return o.Container
}
func (o *GetLibraryItemsPart) GetAudioProfile() *string {
if o == nil {
return nil
}
return o.AudioProfile
}
func (o *GetLibraryItemsPart) GetVideoProfile() string {
if o == nil {
return ""
}
return o.VideoProfile
}
func (o *GetLibraryItemsPart) GetIndexes() *string {
if o == nil {
return nil
}
return o.Indexes
}
func (o *GetLibraryItemsPart) GetHasThumbnail() *HasThumbnail {
if o == nil {
return nil
}
return o.HasThumbnail
}
type GetLibraryItemsMedia struct {
ID int `json:"id"`
Duration int `json:"duration"`
Bitrate int `json:"bitrate"`
Width int `json:"width"`
Height int `json:"height"`
AspectRatio float64 `json:"aspectRatio"`
AudioProfile *string `json:"audioProfile,omitempty"`
AudioChannels int `json:"audioChannels"`
AudioCodec string `json:"audioCodec"`
VideoCodec string `json:"videoCodec"`
VideoResolution string `json:"videoResolution"`
Container string `json:"container"`
VideoFrameRate string `json:"videoFrameRate"`
VideoProfile string `json:"videoProfile"`
HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"`
Part []GetLibraryItemsPart `json:"Part"`
}
func (o *GetLibraryItemsMedia) GetID() int {
if o == nil {
return 0
}
return o.ID
}
func (o *GetLibraryItemsMedia) GetDuration() int {
if o == nil {
return 0
}
return o.Duration
}
func (o *GetLibraryItemsMedia) GetBitrate() int {
if o == nil {
return 0
}
return o.Bitrate
}
func (o *GetLibraryItemsMedia) GetWidth() int {
if o == nil {
return 0
}
return o.Width
}
func (o *GetLibraryItemsMedia) GetHeight() int {
if o == nil {
return 0
}
return o.Height
}
func (o *GetLibraryItemsMedia) GetAspectRatio() float64 {
if o == nil {
return 0.0
}
return o.AspectRatio
}
func (o *GetLibraryItemsMedia) GetAudioProfile() *string {
if o == nil {
return nil
}
return o.AudioProfile
}
func (o *GetLibraryItemsMedia) GetAudioChannels() int {
if o == nil {
return 0
}
return o.AudioChannels
}
func (o *GetLibraryItemsMedia) GetAudioCodec() string {
if o == nil {
return ""
}
return o.AudioCodec
}
func (o *GetLibraryItemsMedia) GetVideoCodec() string {
if o == nil {
return ""
}
return o.VideoCodec
}
func (o *GetLibraryItemsMedia) GetVideoResolution() string {
if o == nil {
return ""
}
return o.VideoResolution
}
func (o *GetLibraryItemsMedia) GetContainer() string {
if o == nil {
return ""
}
return o.Container
}
func (o *GetLibraryItemsMedia) GetVideoFrameRate() string {
if o == nil {
return ""
}
return o.VideoFrameRate
}
func (o *GetLibraryItemsMedia) GetVideoProfile() string {
if o == nil {
return ""
}
return o.VideoProfile
}
func (o *GetLibraryItemsMedia) GetHasVoiceActivity() *bool {
if o == nil {
return nil
}
return o.HasVoiceActivity
}
func (o *GetLibraryItemsMedia) GetPart() []GetLibraryItemsPart {
if o == nil {
return []GetLibraryItemsPart{}
}
return o.Part
}
type GetLibraryItemsGenre struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsGenre) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsCountry struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsCountry) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsDirector struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsDirector) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsWriter struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsWriter) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type Collection struct {
Tag *string `json:"tag,omitempty"`
}
func (o *Collection) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type GetLibraryItemsRole struct {
Tag *string `json:"tag,omitempty"`
}
func (o *GetLibraryItemsRole) GetTag() *string {
if o == nil {
return nil
}
return o.Tag
}
type MediaGUID struct {
// Can be one of the following formats:
// imdb://tt13015952, tmdb://2434012, tvdb://7945991
//
ID string `json:"id"`
}
func (o *MediaGUID) GetID() string {
if o == nil {
return ""
}
return o.ID
}
type UltraBlurColors struct {
TopLeft string `json:"topLeft"`
TopRight string `json:"topRight"`
BottomRight string `json:"bottomRight"`
BottomLeft string `json:"bottomLeft"`
}
func (o *UltraBlurColors) GetTopLeft() string {
if o == nil {
return ""
}
return o.TopLeft
}
func (o *UltraBlurColors) GetTopRight() string {
if o == nil {
return ""
}
return o.TopRight
}
func (o *UltraBlurColors) GetBottomRight() string {
if o == nil {
return ""
}
return o.BottomRight
}
func (o *UltraBlurColors) GetBottomLeft() string {
if o == nil {
return ""
}
return o.BottomLeft
}
type GetLibraryItemsLibraryResponseType string
const (
GetLibraryItemsLibraryResponseTypeCoverPoster GetLibraryItemsLibraryResponseType = "coverPoster"
GetLibraryItemsLibraryResponseTypeBackground GetLibraryItemsLibraryResponseType = "background"
GetLibraryItemsLibraryResponseTypeSnapshot GetLibraryItemsLibraryResponseType = "snapshot"
GetLibraryItemsLibraryResponseTypeClearLogo GetLibraryItemsLibraryResponseType = "clearLogo"
)
func (e GetLibraryItemsLibraryResponseType) ToPointer() *GetLibraryItemsLibraryResponseType {
return &e
}
func (e *GetLibraryItemsLibraryResponseType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "coverPoster":
fallthrough
case "background":
fallthrough
case "snapshot":
fallthrough
case "clearLogo":
*e = GetLibraryItemsLibraryResponseType(v)
return nil
default:
return fmt.Errorf("invalid value for GetLibraryItemsLibraryResponseType: %v", v)
}
}
type GetLibraryItemsImage struct {
Alt string `json:"alt"`
Type GetLibraryItemsLibraryResponseType `json:"type"`
URL string `json:"url"`
}
func (o *GetLibraryItemsImage) GetAlt() string {
if o == nil {
return ""
}
return o.Alt
}
func (o *GetLibraryItemsImage) GetType() GetLibraryItemsLibraryResponseType {
if o == nil {
return GetLibraryItemsLibraryResponseType("")
}
return o.Type
}
func (o *GetLibraryItemsImage) GetURL() string {
if o == nil {
return ""
}
return o.URL
}
type GetLibraryItemsMetadata struct {
// The rating key (Media ID) of this media item.
// Note: This is always an integer, but is represented as a string in the API.
//
RatingKey string `json:"ratingKey"`
Key string `json:"key"`
GUID string `json:"guid"`
Studio *string `json:"studio,omitempty"`
SkipChildren *bool `json:"skipChildren,omitempty"`
// The type of media content
//
Type GetLibraryItemsType `json:"type"`
Title string `json:"title"`
Slug *string `json:"slug,omitempty"`
ContentRating *string `json:"contentRating,omitempty"`
Summary string `json:"summary"`
Rating *float64 `json:"rating,omitempty"`
AudienceRating *float64 `json:"audienceRating,omitempty"`
Year *int `json:"year,omitempty"`
SeasonCount *int `json:"seasonCount,omitempty"`
Tagline *string `json:"tagline,omitempty"`
FlattenSeasons *FlattenSeasons `default:"0" json:"flattenSeasons"`
// Setting that indicates the episode ordering for the show
// None = Library default,
// tmdbAiring = The Movie Database (Aired),
// aired = TheTVDB (Aired),
// dvd = TheTVDB (DVD),
// absolute = TheTVDB (Absolute)).
//
ShowOrdering *ShowOrdering `json:"showOrdering,omitempty"`
Thumb *string `json:"thumb,omitempty"`
Art *string `json:"art,omitempty"`
Banner *string `json:"banner,omitempty"`
Duration *int `json:"duration,omitempty"`
OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"`
// Unix epoch datetime in seconds
AddedAt int64 `json:"addedAt"`
// Unix epoch datetime in seconds
UpdatedAt *int64 `json:"updatedAt,omitempty"`
AudienceRatingImage *string `json:"audienceRatingImage,omitempty"`
ChapterSource *string `json:"chapterSource,omitempty"`
PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"`
RatingImage *string `json:"ratingImage,omitempty"`
GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"`
GrandparentGUID *string `json:"grandparentGuid,omitempty"`
GrandparentKey *string `json:"grandparentKey,omitempty"`
GrandparentTitle *string `json:"grandparentTitle,omitempty"`
GrandparentThumb *string `json:"grandparentThumb,omitempty"`
GrandparentSlug *string `json:"grandparentSlug,omitempty"`
GrandparentArt *string `json:"grandparentArt,omitempty"`
GrandparentTheme *string `json:"grandparentTheme,omitempty"`
// The Media object is only included when type query is `4` or higher.
//
Media []GetLibraryItemsMedia `json:"Media,omitempty"`
Genre []GetLibraryItemsGenre `json:"Genre,omitempty"`
Country []GetLibraryItemsCountry `json:"Country,omitempty"`
Director []GetLibraryItemsDirector `json:"Director,omitempty"`
Writer []GetLibraryItemsWriter `json:"Writer,omitempty"`
Collection []Collection `json:"Collection,omitempty"`
Role []GetLibraryItemsRole `json:"Role,omitempty"`
// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
//
MediaGUID []MediaGUID `json:"Guid,omitempty"`
UltraBlurColors *UltraBlurColors `json:"UltraBlurColors,omitempty"`
Image []GetLibraryItemsImage `json:"Image,omitempty"`
TitleSort *string `json:"titleSort,omitempty"`
ViewCount *int `json:"viewCount,omitempty"`
LastViewedAt *int `json:"lastViewedAt,omitempty"`
OriginalTitle *string `json:"originalTitle,omitempty"`
ViewOffset *int `json:"viewOffset,omitempty"`
SkipCount *int `json:"skipCount,omitempty"`
Index *int `json:"index,omitempty"`
Theme *string `json:"theme,omitempty"`
LeafCount *int `json:"leafCount,omitempty"`
ViewedLeafCount *int `json:"viewedLeafCount,omitempty"`
ChildCount *int `json:"childCount,omitempty"`
HasPremiumExtras *string `json:"hasPremiumExtras,omitempty"`
HasPremiumPrimaryExtra *string `json:"hasPremiumPrimaryExtra,omitempty"`
// The rating key of the parent item.
//
ParentRatingKey *string `json:"parentRatingKey,omitempty"`
ParentGUID *string `json:"parentGuid,omitempty"`
ParentStudio *string `json:"parentStudio,omitempty"`
ParentKey *string `json:"parentKey,omitempty"`
ParentTitle *string `json:"parentTitle,omitempty"`
ParentIndex *int `json:"parentIndex,omitempty"`
ParentYear *int `json:"parentYear,omitempty"`
ParentThumb *string `json:"parentThumb,omitempty"`
ParentTheme *string `json:"parentTheme,omitempty"`
}
func (g GetLibraryItemsMetadata) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetLibraryItemsMetadata) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetLibraryItemsMetadata) GetRatingKey() string {
if o == nil {
return ""
}
return o.RatingKey
}
func (o *GetLibraryItemsMetadata) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsMetadata) GetGUID() string {
if o == nil {
return ""
}
return o.GUID
}
func (o *GetLibraryItemsMetadata) GetStudio() *string {
if o == nil {
return nil
}
return o.Studio
}
func (o *GetLibraryItemsMetadata) GetSkipChildren() *bool {
if o == nil {
return nil
}
return o.SkipChildren
}
func (o *GetLibraryItemsMetadata) GetType() GetLibraryItemsType {
if o == nil {
return GetLibraryItemsType("")
}
return o.Type
}
func (o *GetLibraryItemsMetadata) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
func (o *GetLibraryItemsMetadata) GetSlug() *string {
if o == nil {
return nil
}
return o.Slug
}
func (o *GetLibraryItemsMetadata) GetContentRating() *string {
if o == nil {
return nil
}
return o.ContentRating
}
func (o *GetLibraryItemsMetadata) GetSummary() string {
if o == nil {
return ""
}
return o.Summary
}
func (o *GetLibraryItemsMetadata) GetRating() *float64 {
if o == nil {
return nil
}
return o.Rating
}
func (o *GetLibraryItemsMetadata) GetAudienceRating() *float64 {
if o == nil {
return nil
}
return o.AudienceRating
}
func (o *GetLibraryItemsMetadata) GetYear() *int {
if o == nil {
return nil
}
return o.Year
}
func (o *GetLibraryItemsMetadata) GetSeasonCount() *int {
if o == nil {
return nil
}
return o.SeasonCount
}
func (o *GetLibraryItemsMetadata) GetTagline() *string {
if o == nil {
return nil
}
return o.Tagline
}
func (o *GetLibraryItemsMetadata) GetFlattenSeasons() *FlattenSeasons {
if o == nil {
return nil
}
return o.FlattenSeasons
}
func (o *GetLibraryItemsMetadata) GetShowOrdering() *ShowOrdering {
if o == nil {
return nil
}
return o.ShowOrdering
}
func (o *GetLibraryItemsMetadata) GetThumb() *string {
if o == nil {
return nil
}
return o.Thumb
}
func (o *GetLibraryItemsMetadata) GetArt() *string {
if o == nil {
return nil
}
return o.Art
}
func (o *GetLibraryItemsMetadata) GetBanner() *string {
if o == nil {
return nil
}
return o.Banner
}
func (o *GetLibraryItemsMetadata) GetDuration() *int {
if o == nil {
return nil
}
return o.Duration
}
func (o *GetLibraryItemsMetadata) GetOriginallyAvailableAt() *types.Date {
if o == nil {
return nil
}
return o.OriginallyAvailableAt
}
func (o *GetLibraryItemsMetadata) GetAddedAt() int64 {
if o == nil {
return 0
}
return o.AddedAt
}
func (o *GetLibraryItemsMetadata) GetUpdatedAt() *int64 {
if o == nil {
return nil
}
return o.UpdatedAt
}
func (o *GetLibraryItemsMetadata) GetAudienceRatingImage() *string {
if o == nil {
return nil
}
return o.AudienceRatingImage
}
func (o *GetLibraryItemsMetadata) GetChapterSource() *string {
if o == nil {
return nil
}
return o.ChapterSource
}
func (o *GetLibraryItemsMetadata) GetPrimaryExtraKey() *string {
if o == nil {
return nil
}
return o.PrimaryExtraKey
}
func (o *GetLibraryItemsMetadata) GetRatingImage() *string {
if o == nil {
return nil
}
return o.RatingImage
}
func (o *GetLibraryItemsMetadata) GetGrandparentRatingKey() *string {
if o == nil {
return nil
}
return o.GrandparentRatingKey
}
func (o *GetLibraryItemsMetadata) GetGrandparentGUID() *string {
if o == nil {
return nil
}
return o.GrandparentGUID
}
func (o *GetLibraryItemsMetadata) GetGrandparentKey() *string {
if o == nil {
return nil
}
return o.GrandparentKey
}
func (o *GetLibraryItemsMetadata) GetGrandparentTitle() *string {
if o == nil {
return nil
}
return o.GrandparentTitle
}
func (o *GetLibraryItemsMetadata) GetGrandparentThumb() *string {
if o == nil {
return nil
}
return o.GrandparentThumb
}
func (o *GetLibraryItemsMetadata) GetGrandparentSlug() *string {
if o == nil {
return nil
}
return o.GrandparentSlug
}
func (o *GetLibraryItemsMetadata) GetGrandparentArt() *string {
if o == nil {
return nil
}
return o.GrandparentArt
}
func (o *GetLibraryItemsMetadata) GetGrandparentTheme() *string {
if o == nil {
return nil
}
return o.GrandparentTheme
}
func (o *GetLibraryItemsMetadata) GetMedia() []GetLibraryItemsMedia {
if o == nil {
return nil
}
return o.Media
}
func (o *GetLibraryItemsMetadata) GetGenre() []GetLibraryItemsGenre {
if o == nil {
return nil
}
return o.Genre
}
func (o *GetLibraryItemsMetadata) GetCountry() []GetLibraryItemsCountry {
if o == nil {
return nil
}
return o.Country
}
func (o *GetLibraryItemsMetadata) GetDirector() []GetLibraryItemsDirector {
if o == nil {
return nil
}
return o.Director
}
func (o *GetLibraryItemsMetadata) GetWriter() []GetLibraryItemsWriter {
if o == nil {
return nil
}
return o.Writer
}
func (o *GetLibraryItemsMetadata) GetCollection() []Collection {
if o == nil {
return nil
}
return o.Collection
}
func (o *GetLibraryItemsMetadata) GetRole() []GetLibraryItemsRole {
if o == nil {
return nil
}
return o.Role
}
func (o *GetLibraryItemsMetadata) GetMediaGUID() []MediaGUID {
if o == nil {
return nil
}
return o.MediaGUID
}
func (o *GetLibraryItemsMetadata) GetUltraBlurColors() *UltraBlurColors {
if o == nil {
return nil
}
return o.UltraBlurColors
}
func (o *GetLibraryItemsMetadata) GetImage() []GetLibraryItemsImage {
if o == nil {
return nil
}
return o.Image
}
func (o *GetLibraryItemsMetadata) GetTitleSort() *string {
if o == nil {
return nil
}
return o.TitleSort
}
func (o *GetLibraryItemsMetadata) GetViewCount() *int {
if o == nil {
return nil
}
return o.ViewCount
}
func (o *GetLibraryItemsMetadata) GetLastViewedAt() *int {
if o == nil {
return nil
}
return o.LastViewedAt
}
func (o *GetLibraryItemsMetadata) GetOriginalTitle() *string {
if o == nil {
return nil
}
return o.OriginalTitle
}
func (o *GetLibraryItemsMetadata) GetViewOffset() *int {
if o == nil {
return nil
}
return o.ViewOffset
}
func (o *GetLibraryItemsMetadata) GetSkipCount() *int {
if o == nil {
return nil
}
return o.SkipCount
}
func (o *GetLibraryItemsMetadata) GetIndex() *int {
if o == nil {
return nil
}
return o.Index
}
func (o *GetLibraryItemsMetadata) GetTheme() *string {
if o == nil {
return nil
}
return o.Theme
}
func (o *GetLibraryItemsMetadata) GetLeafCount() *int {
if o == nil {
return nil
}
return o.LeafCount
}
func (o *GetLibraryItemsMetadata) GetViewedLeafCount() *int {
if o == nil {
return nil
}
return o.ViewedLeafCount
}
func (o *GetLibraryItemsMetadata) GetChildCount() *int {
if o == nil {
return nil
}
return o.ChildCount
}
func (o *GetLibraryItemsMetadata) GetHasPremiumExtras() *string {
if o == nil {
return nil
}
return o.HasPremiumExtras
}
func (o *GetLibraryItemsMetadata) GetHasPremiumPrimaryExtra() *string {
if o == nil {
return nil
}
return o.HasPremiumPrimaryExtra
}
func (o *GetLibraryItemsMetadata) GetParentRatingKey() *string {
if o == nil {
return nil
}
return o.ParentRatingKey
}
func (o *GetLibraryItemsMetadata) GetParentGUID() *string {
if o == nil {
return nil
}
return o.ParentGUID
}
func (o *GetLibraryItemsMetadata) GetParentStudio() *string {
if o == nil {
return nil
}
return o.ParentStudio
}
func (o *GetLibraryItemsMetadata) GetParentKey() *string {
if o == nil {
return nil
}
return o.ParentKey
}
func (o *GetLibraryItemsMetadata) GetParentTitle() *string {
if o == nil {
return nil
}
return o.ParentTitle
}
func (o *GetLibraryItemsMetadata) GetParentIndex() *int {
if o == nil {
return nil
}
return o.ParentIndex
}
func (o *GetLibraryItemsMetadata) GetParentYear() *int {
if o == nil {
return nil
}
return o.ParentYear
}
func (o *GetLibraryItemsMetadata) GetParentThumb() *string {
if o == nil {
return nil
}
return o.ParentThumb
}
func (o *GetLibraryItemsMetadata) GetParentTheme() *string {
if o == nil {
return nil
}
return o.ParentTheme
}
type GetLibraryItemsFilter struct {
Filter string `json:"filter"`
FilterType string `json:"filterType"`
Key string `json:"key"`
Title string `json:"title"`
Type string `json:"type"`
}
func (o *GetLibraryItemsFilter) GetFilter() string {
if o == nil {
return ""
}
return o.Filter
}
func (o *GetLibraryItemsFilter) GetFilterType() string {
if o == nil {
return ""
}
return o.FilterType
}
func (o *GetLibraryItemsFilter) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsFilter) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
func (o *GetLibraryItemsFilter) GetType() string {
if o == nil {
return ""
}
return o.Type
}
// ActiveDirection - The direction of the sort. Can be either `asc` or `desc`.
type ActiveDirection string
const (
ActiveDirectionAscending ActiveDirection = "asc"
ActiveDirectionDescending ActiveDirection = "desc"
)
func (e ActiveDirection) ToPointer() *ActiveDirection {
return &e
}
func (e *ActiveDirection) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "asc":
fallthrough
case "desc":
*e = ActiveDirection(v)
return nil
default:
return fmt.Errorf("invalid value for ActiveDirection: %v", v)
}
}
// DefaultDirection - The direction of the sort. Can be either `asc` or `desc`.
type DefaultDirection string
const (
DefaultDirectionAscending DefaultDirection = "asc"
DefaultDirectionDescending DefaultDirection = "desc"
)
func (e DefaultDirection) ToPointer() *DefaultDirection {
return &e
}
func (e *DefaultDirection) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "asc":
fallthrough
case "desc":
*e = DefaultDirection(v)
return nil
default:
return fmt.Errorf("invalid value for DefaultDirection: %v", v)
}
}
type GetLibraryItemsSort struct {
Default *string `json:"default,omitempty"`
Active *bool `json:"active,omitempty"`
// The direction of the sort. Can be either `asc` or `desc`.
//
ActiveDirection *ActiveDirection `default:"asc" json:"activeDirection"`
// The direction of the sort. Can be either `asc` or `desc`.
//
DefaultDirection *DefaultDirection `default:"asc" json:"defaultDirection"`
DescKey *string `json:"descKey,omitempty"`
FirstCharacterKey *string `json:"firstCharacterKey,omitempty"`
Key string `json:"key"`
Title string `json:"title"`
}
func (g GetLibraryItemsSort) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetLibraryItemsSort) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetLibraryItemsSort) GetDefault() *string {
if o == nil {
return nil
}
return o.Default
}
func (o *GetLibraryItemsSort) GetActive() *bool {
if o == nil {
return nil
}
return o.Active
}
func (o *GetLibraryItemsSort) GetActiveDirection() *ActiveDirection {
if o == nil {
return nil
}
return o.ActiveDirection
}
func (o *GetLibraryItemsSort) GetDefaultDirection() *DefaultDirection {
if o == nil {
return nil
}
return o.DefaultDirection
}
func (o *GetLibraryItemsSort) GetDescKey() *string {
if o == nil {
return nil
}
return o.DescKey
}
func (o *GetLibraryItemsSort) GetFirstCharacterKey() *string {
if o == nil {
return nil
}
return o.FirstCharacterKey
}
func (o *GetLibraryItemsSort) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsSort) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
type GetLibraryItemsField struct {
Key string `json:"key"`
Title string `json:"title"`
Type string `json:"type"`
SubType *string `json:"subType,omitempty"`
}
func (o *GetLibraryItemsField) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsField) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
func (o *GetLibraryItemsField) GetType() string {
if o == nil {
return ""
}
return o.Type
}
func (o *GetLibraryItemsField) GetSubType() *string {
if o == nil {
return nil
}
return o.SubType
}
type GetLibraryItemsLibraryType struct {
Key string `json:"key"`
Type string `json:"type"`
Title string `json:"title"`
Active bool `json:"active"`
Filter []GetLibraryItemsFilter `json:"Filter,omitempty"`
Sort []GetLibraryItemsSort `json:"Sort,omitempty"`
Field []GetLibraryItemsField `json:"Field,omitempty"`
}
func (o *GetLibraryItemsLibraryType) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsLibraryType) GetType() string {
if o == nil {
return ""
}
return o.Type
}
func (o *GetLibraryItemsLibraryType) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
func (o *GetLibraryItemsLibraryType) GetActive() bool {
if o == nil {
return false
}
return o.Active
}
func (o *GetLibraryItemsLibraryType) GetFilter() []GetLibraryItemsFilter {
if o == nil {
return nil
}
return o.Filter
}
func (o *GetLibraryItemsLibraryType) GetSort() []GetLibraryItemsSort {
if o == nil {
return nil
}
return o.Sort
}
func (o *GetLibraryItemsLibraryType) GetField() []GetLibraryItemsField {
if o == nil {
return nil
}
return o.Field
}
type GetLibraryItemsOperator struct {
Key string `json:"key"`
Title string `json:"title"`
}
func (o *GetLibraryItemsOperator) GetKey() string {
if o == nil {
return ""
}
return o.Key
}
func (o *GetLibraryItemsOperator) GetTitle() string {
if o == nil {
return ""
}
return o.Title
}
type GetLibraryItemsFieldType struct {
Type string `json:"type"`
Operator []GetLibraryItemsOperator `json:"Operator"`
}
func (o *GetLibraryItemsFieldType) GetType() string {
if o == nil {
return ""
}
return o.Type
}
func (o *GetLibraryItemsFieldType) GetOperator() []GetLibraryItemsOperator {
if o == nil {
return []GetLibraryItemsOperator{}
}
return o.Operator
}
// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
type Meta struct {
Type []GetLibraryItemsLibraryType `json:"Type,omitempty"`
FieldType []GetLibraryItemsFieldType `json:"FieldType,omitempty"`
}
func (o *Meta) GetType() []GetLibraryItemsLibraryType {
if o == nil {
return nil
}
return o.Type
}
func (o *Meta) GetFieldType() []GetLibraryItemsFieldType {
if o == nil {
return nil
}
return o.FieldType
}
type GetLibraryItemsMediaContainer struct {
Size int `json:"size"`
TotalSize int `json:"totalSize"`
Offset int `json:"offset"`
Content string `json:"content"`
AllowSync bool `json:"allowSync"`
Nocache *bool `json:"nocache,omitempty"`
Art string `json:"art"`
Identifier string `json:"identifier"`
LibrarySectionID LibrarySectionID `json:"librarySectionID"`
LibrarySectionTitle string `json:"librarySectionTitle"`
LibrarySectionUUID string `json:"librarySectionUUID"`
MediaTagPrefix string `json:"mediaTagPrefix"`
MediaTagVersion int `json:"mediaTagVersion"`
Thumb string `json:"thumb"`
Title1 string `json:"title1"`
Title2 string `json:"title2"`
ViewGroup string `json:"viewGroup"`
ViewMode *int `json:"viewMode,omitempty"`
MixedParents *bool `json:"mixedParents,omitempty"`
Metadata []GetLibraryItemsMetadata `json:"Metadata"`
// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
//
Meta *Meta `json:"Meta,omitempty"`
}
func (o *GetLibraryItemsMediaContainer) GetSize() int {
if o == nil {
return 0
}
return o.Size
}
func (o *GetLibraryItemsMediaContainer) GetTotalSize() int {
if o == nil {
return 0
}
return o.TotalSize
}
func (o *GetLibraryItemsMediaContainer) GetOffset() int {
if o == nil {
return 0
}
return o.Offset
}
func (o *GetLibraryItemsMediaContainer) GetContent() string {
if o == nil {
return ""
}
return o.Content
}
func (o *GetLibraryItemsMediaContainer) GetAllowSync() bool {
if o == nil {
return false
}
return o.AllowSync
}
func (o *GetLibraryItemsMediaContainer) GetNocache() *bool {
if o == nil {
return nil
}
return o.Nocache
}
func (o *GetLibraryItemsMediaContainer) GetArt() string {
if o == nil {
return ""
}
return o.Art
}
func (o *GetLibraryItemsMediaContainer) GetIdentifier() string {
if o == nil {
return ""
}
return o.Identifier
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionID() LibrarySectionID {
if o == nil {
return LibrarySectionID{}
}
return o.LibrarySectionID
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionTitle() string {
if o == nil {
return ""
}
return o.LibrarySectionTitle
}
func (o *GetLibraryItemsMediaContainer) GetLibrarySectionUUID() string {
if o == nil {
return ""
}
return o.LibrarySectionUUID
}
func (o *GetLibraryItemsMediaContainer) GetMediaTagPrefix() string {
if o == nil {
return ""
}
return o.MediaTagPrefix
}
func (o *GetLibraryItemsMediaContainer) GetMediaTagVersion() int {
if o == nil {
return 0
}
return o.MediaTagVersion
}
func (o *GetLibraryItemsMediaContainer) GetThumb() string {
if o == nil {
return ""
}
return o.Thumb
}
func (o *GetLibraryItemsMediaContainer) GetTitle1() string {
if o == nil {
return ""
}
return o.Title1
}
func (o *GetLibraryItemsMediaContainer) GetTitle2() string {
if o == nil {
return ""
}
return o.Title2
}
func (o *GetLibraryItemsMediaContainer) GetViewGroup() string {
if o == nil {
return ""
}
return o.ViewGroup
}
func (o *GetLibraryItemsMediaContainer) GetViewMode() *int {
if o == nil {
return nil
}
return o.ViewMode
}
func (o *GetLibraryItemsMediaContainer) GetMixedParents() *bool {
if o == nil {
return nil
}
return o.MixedParents
}
func (o *GetLibraryItemsMediaContainer) GetMetadata() []GetLibraryItemsMetadata {
if o == nil {
return []GetLibraryItemsMetadata{}
}
return o.Metadata
}
func (o *GetLibraryItemsMediaContainer) GetMeta() *Meta {
if o == nil {
return nil
}
return o.Meta
}
// GetLibraryItemsResponseBody - The contents of the library by section and tag
type GetLibraryItemsResponseBody struct {
MediaContainer *GetLibraryItemsMediaContainer `json:"MediaContainer,omitempty"`
}
func (o *GetLibraryItemsResponseBody) GetMediaContainer() *GetLibraryItemsMediaContainer {
if o == nil {
return nil
}
return o.MediaContainer
}
type GetLibraryItemsResponse struct {
// HTTP response content type for this operation
ContentType string
// HTTP response status code for this operation
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
// The contents of the library by section and tag
Object *GetLibraryItemsResponseBody
}
func (o *GetLibraryItemsResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetLibraryItemsResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetLibraryItemsResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetLibraryItemsResponse) GetObject() *GetLibraryItemsResponseBody {
if o == nil {
return nil
}
return o.Object
}