// 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" ) // GetLibrarySectionsAllQueryParamType - The type of media to retrieve or filter by. // 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 GetLibrarySectionsAllQueryParamType int64 const ( GetLibrarySectionsAllQueryParamTypeMovie GetLibrarySectionsAllQueryParamType = 1 GetLibrarySectionsAllQueryParamTypeTvShow GetLibrarySectionsAllQueryParamType = 2 GetLibrarySectionsAllQueryParamTypeSeason GetLibrarySectionsAllQueryParamType = 3 GetLibrarySectionsAllQueryParamTypeEpisode GetLibrarySectionsAllQueryParamType = 4 GetLibrarySectionsAllQueryParamTypeArtist GetLibrarySectionsAllQueryParamType = 5 GetLibrarySectionsAllQueryParamTypeAlbum GetLibrarySectionsAllQueryParamType = 6 GetLibrarySectionsAllQueryParamTypeTrack GetLibrarySectionsAllQueryParamType = 7 GetLibrarySectionsAllQueryParamTypePhotoAlbum GetLibrarySectionsAllQueryParamType = 8 GetLibrarySectionsAllQueryParamTypePhoto GetLibrarySectionsAllQueryParamType = 9 ) func (e GetLibrarySectionsAllQueryParamType) ToPointer() *GetLibrarySectionsAllQueryParamType { return &e } // GetLibrarySectionsAllQueryParamIncludeMeta - Adds the Meta object to the response type GetLibrarySectionsAllQueryParamIncludeMeta int const ( GetLibrarySectionsAllQueryParamIncludeMetaDisable GetLibrarySectionsAllQueryParamIncludeMeta = 0 GetLibrarySectionsAllQueryParamIncludeMetaEnable GetLibrarySectionsAllQueryParamIncludeMeta = 1 ) func (e GetLibrarySectionsAllQueryParamIncludeMeta) ToPointer() *GetLibrarySectionsAllQueryParamIncludeMeta { return &e } func (e *GetLibrarySectionsAllQueryParamIncludeMeta) 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 = GetLibrarySectionsAllQueryParamIncludeMeta(v) return nil default: return fmt.Errorf("invalid value for GetLibrarySectionsAllQueryParamIncludeMeta: %v", v) } } // QueryParamIncludeGuids - Adds the Guid object to the response type QueryParamIncludeGuids int const ( QueryParamIncludeGuidsDisable QueryParamIncludeGuids = 0 QueryParamIncludeGuidsEnable QueryParamIncludeGuids = 1 ) func (e QueryParamIncludeGuids) ToPointer() *QueryParamIncludeGuids { return &e } func (e *QueryParamIncludeGuids) 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 = QueryParamIncludeGuids(v) return nil default: return fmt.Errorf("invalid value for QueryParamIncludeGuids: %v", v) } } type IncludeAdvanced int const ( IncludeAdvancedDisable IncludeAdvanced = 0 IncludeAdvancedEnable IncludeAdvanced = 1 ) func (e IncludeAdvanced) ToPointer() *IncludeAdvanced { return &e } func (e *IncludeAdvanced) 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 = IncludeAdvanced(v) return nil default: return fmt.Errorf("invalid value for IncludeAdvanced: %v", v) } } type QueryParamIncludeCollections int const ( QueryParamIncludeCollectionsDisable QueryParamIncludeCollections = 0 QueryParamIncludeCollectionsEnable QueryParamIncludeCollections = 1 ) func (e QueryParamIncludeCollections) ToPointer() *QueryParamIncludeCollections { return &e } func (e *QueryParamIncludeCollections) 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 = QueryParamIncludeCollections(v) return nil default: return fmt.Errorf("invalid value for QueryParamIncludeCollections: %v", v) } } type QueryParamIncludeExternalMedia int const ( QueryParamIncludeExternalMediaDisable QueryParamIncludeExternalMedia = 0 QueryParamIncludeExternalMediaEnable QueryParamIncludeExternalMedia = 1 ) func (e QueryParamIncludeExternalMedia) ToPointer() *QueryParamIncludeExternalMedia { return &e } func (e *QueryParamIncludeExternalMedia) 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 = QueryParamIncludeExternalMedia(v) return nil default: return fmt.Errorf("invalid value for QueryParamIncludeExternalMedia: %v", v) } } type GetLibrarySectionsAllRequest 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"` // The type of media to retrieve or filter by. // 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 GetLibrarySectionsAllQueryParamType `queryParam:"style=form,explode=true,name=type"` // Adds the Meta object to the response // IncludeMeta *GetLibrarySectionsAllQueryParamIncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"` // Adds the Guid object to the response // IncludeGuids *QueryParamIncludeGuids `default:"0" queryParam:"style=form,explode=true,name=includeGuids"` IncludeAdvanced *IncludeAdvanced `default:"0" queryParam:"style=form,explode=true,name=includeAdvanced"` IncludeCollections *QueryParamIncludeCollections `default:"0" queryParam:"style=form,explode=true,name=includeCollections"` IncludeExternalMedia *QueryParamIncludeExternalMedia `default:"0" queryParam:"style=form,explode=true,name=includeExternalMedia"` // 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 GetLibrarySectionsAllRequest) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetLibrarySectionsAllRequest) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"sectionKey", "type"}); err != nil { return err } return nil } func (g *GetLibrarySectionsAllRequest) GetSectionKey() int { if g == nil { return 0 } return g.SectionKey } func (g *GetLibrarySectionsAllRequest) GetType() GetLibrarySectionsAllQueryParamType { if g == nil { return GetLibrarySectionsAllQueryParamType(0) } return g.Type } func (g *GetLibrarySectionsAllRequest) GetIncludeMeta() *GetLibrarySectionsAllQueryParamIncludeMeta { if g == nil { return nil } return g.IncludeMeta } func (g *GetLibrarySectionsAllRequest) GetIncludeGuids() *QueryParamIncludeGuids { if g == nil { return nil } return g.IncludeGuids } func (g *GetLibrarySectionsAllRequest) GetIncludeAdvanced() *IncludeAdvanced { if g == nil { return nil } return g.IncludeAdvanced } func (g *GetLibrarySectionsAllRequest) GetIncludeCollections() *QueryParamIncludeCollections { if g == nil { return nil } return g.IncludeCollections } func (g *GetLibrarySectionsAllRequest) GetIncludeExternalMedia() *QueryParamIncludeExternalMedia { if g == nil { return nil } return g.IncludeExternalMedia } func (g *GetLibrarySectionsAllRequest) GetXPlexContainerStart() *int { if g == nil { return nil } return g.XPlexContainerStart } func (g *GetLibrarySectionsAllRequest) GetXPlexContainerSize() *int { if g == nil { return nil } return g.XPlexContainerSize } type GetLibrarySectionsAllFilter struct { Filter string `json:"filter"` FilterType string `json:"filterType"` Key string `json:"key"` Title string `json:"title"` Type string `json:"type"` Advanced *bool `json:"advanced,omitempty"` } func (g *GetLibrarySectionsAllFilter) GetFilter() string { if g == nil { return "" } return g.Filter } func (g *GetLibrarySectionsAllFilter) GetFilterType() string { if g == nil { return "" } return g.FilterType } func (g *GetLibrarySectionsAllFilter) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllFilter) GetTitle() string { if g == nil { return "" } return g.Title } func (g *GetLibrarySectionsAllFilter) GetType() string { if g == nil { return "" } return g.Type } func (g *GetLibrarySectionsAllFilter) GetAdvanced() *bool { if g == nil { return nil } return g.Advanced } // GetLibrarySectionsAllActiveDirection - The direction of the sort. Can be either `asc` or `desc`. type GetLibrarySectionsAllActiveDirection string const ( GetLibrarySectionsAllActiveDirectionAscending GetLibrarySectionsAllActiveDirection = "asc" GetLibrarySectionsAllActiveDirectionDescending GetLibrarySectionsAllActiveDirection = "desc" ) func (e GetLibrarySectionsAllActiveDirection) ToPointer() *GetLibrarySectionsAllActiveDirection { return &e } func (e *GetLibrarySectionsAllActiveDirection) 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 = GetLibrarySectionsAllActiveDirection(v) return nil default: return fmt.Errorf("invalid value for GetLibrarySectionsAllActiveDirection: %v", v) } } // GetLibrarySectionsAllDefaultDirection - The direction of the sort. Can be either `asc` or `desc`. type GetLibrarySectionsAllDefaultDirection string const ( GetLibrarySectionsAllDefaultDirectionAscending GetLibrarySectionsAllDefaultDirection = "asc" GetLibrarySectionsAllDefaultDirectionDescending GetLibrarySectionsAllDefaultDirection = "desc" ) func (e GetLibrarySectionsAllDefaultDirection) ToPointer() *GetLibrarySectionsAllDefaultDirection { return &e } func (e *GetLibrarySectionsAllDefaultDirection) 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 = GetLibrarySectionsAllDefaultDirection(v) return nil default: return fmt.Errorf("invalid value for GetLibrarySectionsAllDefaultDirection: %v", v) } } type GetLibrarySectionsAllSort struct { Default *string `json:"default,omitempty"` Active *bool `json:"active,omitempty"` // The direction of the sort. Can be either `asc` or `desc`. // ActiveDirection *GetLibrarySectionsAllActiveDirection `default:"asc" json:"activeDirection"` // The direction of the sort. Can be either `asc` or `desc`. // DefaultDirection *GetLibrarySectionsAllDefaultDirection `default:"asc" json:"defaultDirection"` DescKey *string `json:"descKey,omitempty"` FirstCharacterKey *string `json:"firstCharacterKey,omitempty"` Key string `json:"key"` Title string `json:"title"` } func (g GetLibrarySectionsAllSort) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetLibrarySectionsAllSort) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil { return err } return nil } func (g *GetLibrarySectionsAllSort) GetDefault() *string { if g == nil { return nil } return g.Default } func (g *GetLibrarySectionsAllSort) GetActive() *bool { if g == nil { return nil } return g.Active } func (g *GetLibrarySectionsAllSort) GetActiveDirection() *GetLibrarySectionsAllActiveDirection { if g == nil { return nil } return g.ActiveDirection } func (g *GetLibrarySectionsAllSort) GetDefaultDirection() *GetLibrarySectionsAllDefaultDirection { if g == nil { return nil } return g.DefaultDirection } func (g *GetLibrarySectionsAllSort) GetDescKey() *string { if g == nil { return nil } return g.DescKey } func (g *GetLibrarySectionsAllSort) GetFirstCharacterKey() *string { if g == nil { return nil } return g.FirstCharacterKey } func (g *GetLibrarySectionsAllSort) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllSort) GetTitle() string { if g == nil { return "" } return g.Title } type GetLibrarySectionsAllField struct { Key string `json:"key"` Title string `json:"title"` Type string `json:"type"` SubType *string `json:"subType,omitempty"` } func (g *GetLibrarySectionsAllField) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllField) GetTitle() string { if g == nil { return "" } return g.Title } func (g *GetLibrarySectionsAllField) GetType() string { if g == nil { return "" } return g.Type } func (g *GetLibrarySectionsAllField) GetSubType() *string { if g == nil { return nil } return g.SubType } type GetLibrarySectionsAllType struct { Key string `json:"key"` Type string `json:"type"` Subtype *string `json:"subtype,omitempty"` Title string `json:"title"` Active bool `json:"active"` Filter []GetLibrarySectionsAllFilter `json:"Filter,omitempty"` Sort []GetLibrarySectionsAllSort `json:"Sort,omitempty"` Field []GetLibrarySectionsAllField `json:"Field,omitempty"` } func (g *GetLibrarySectionsAllType) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllType) GetType() string { if g == nil { return "" } return g.Type } func (g *GetLibrarySectionsAllType) GetSubtype() *string { if g == nil { return nil } return g.Subtype } func (g *GetLibrarySectionsAllType) GetTitle() string { if g == nil { return "" } return g.Title } func (g *GetLibrarySectionsAllType) GetActive() bool { if g == nil { return false } return g.Active } func (g *GetLibrarySectionsAllType) GetFilter() []GetLibrarySectionsAllFilter { if g == nil { return nil } return g.Filter } func (g *GetLibrarySectionsAllType) GetSort() []GetLibrarySectionsAllSort { if g == nil { return nil } return g.Sort } func (g *GetLibrarySectionsAllType) GetField() []GetLibrarySectionsAllField { if g == nil { return nil } return g.Field } type GetLibrarySectionsAllOperator struct { Key string `json:"key"` Title string `json:"title"` } func (g *GetLibrarySectionsAllOperator) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllOperator) GetTitle() string { if g == nil { return "" } return g.Title } type GetLibrarySectionsAllFieldType struct { Type string `json:"type"` Operator []GetLibrarySectionsAllOperator `json:"Operator"` } func (g *GetLibrarySectionsAllFieldType) GetType() string { if g == nil { return "" } return g.Type } func (g *GetLibrarySectionsAllFieldType) GetOperator() []GetLibrarySectionsAllOperator { if g == nil { return []GetLibrarySectionsAllOperator{} } return g.Operator } // GetLibrarySectionsAllMeta - The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. type GetLibrarySectionsAllMeta struct { Type []GetLibrarySectionsAllType `json:"Type,omitempty"` FieldType []GetLibrarySectionsAllFieldType `json:"FieldType,omitempty"` } func (g *GetLibrarySectionsAllMeta) GetType() []GetLibrarySectionsAllType { if g == nil { return nil } return g.Type } func (g *GetLibrarySectionsAllMeta) GetFieldType() []GetLibrarySectionsAllFieldType { if g == nil { return nil } return g.FieldType } // GetLibrarySectionsAllLibraryType - The type of media content in the Plex library. This can represent videos, music, or photos. type GetLibrarySectionsAllLibraryType string const ( GetLibrarySectionsAllLibraryTypeMovie GetLibrarySectionsAllLibraryType = "movie" GetLibrarySectionsAllLibraryTypeTvShow GetLibrarySectionsAllLibraryType = "show" GetLibrarySectionsAllLibraryTypeSeason GetLibrarySectionsAllLibraryType = "season" GetLibrarySectionsAllLibraryTypeEpisode GetLibrarySectionsAllLibraryType = "episode" GetLibrarySectionsAllLibraryTypeArtist GetLibrarySectionsAllLibraryType = "artist" GetLibrarySectionsAllLibraryTypeAlbum GetLibrarySectionsAllLibraryType = "album" GetLibrarySectionsAllLibraryTypeTrack GetLibrarySectionsAllLibraryType = "track" GetLibrarySectionsAllLibraryTypePhotoAlbum GetLibrarySectionsAllLibraryType = "photoalbum" GetLibrarySectionsAllLibraryTypePhoto GetLibrarySectionsAllLibraryType = "photo" GetLibrarySectionsAllLibraryTypeCollection GetLibrarySectionsAllLibraryType = "collection" ) func (e GetLibrarySectionsAllLibraryType) ToPointer() *GetLibrarySectionsAllLibraryType { return &e } type GetLibrarySectionsAllLibraryResponseType string const ( GetLibrarySectionsAllLibraryResponseTypeCoverPoster GetLibrarySectionsAllLibraryResponseType = "coverPoster" GetLibrarySectionsAllLibraryResponseTypeBackground GetLibrarySectionsAllLibraryResponseType = "background" GetLibrarySectionsAllLibraryResponseTypeSnapshot GetLibrarySectionsAllLibraryResponseType = "snapshot" GetLibrarySectionsAllLibraryResponseTypeClearLogo GetLibrarySectionsAllLibraryResponseType = "clearLogo" ) func (e GetLibrarySectionsAllLibraryResponseType) ToPointer() *GetLibrarySectionsAllLibraryResponseType { return &e } type GetLibrarySectionsAllImage struct { Alt string `json:"alt"` Type GetLibrarySectionsAllLibraryResponseType `json:"type"` URL string `json:"url"` } func (g *GetLibrarySectionsAllImage) GetAlt() string { if g == nil { return "" } return g.Alt } func (g *GetLibrarySectionsAllImage) GetType() GetLibrarySectionsAllLibraryResponseType { if g == nil { return GetLibrarySectionsAllLibraryResponseType("") } return g.Type } func (g *GetLibrarySectionsAllImage) GetURL() string { if g == nil { return "" } return g.URL } type GetLibrarySectionsAllUltraBlurColors struct { TopLeft string `json:"topLeft"` TopRight string `json:"topRight"` BottomRight string `json:"bottomRight"` BottomLeft string `json:"bottomLeft"` } func (g *GetLibrarySectionsAllUltraBlurColors) GetTopLeft() string { if g == nil { return "" } return g.TopLeft } func (g *GetLibrarySectionsAllUltraBlurColors) GetTopRight() string { if g == nil { return "" } return g.TopRight } func (g *GetLibrarySectionsAllUltraBlurColors) GetBottomRight() string { if g == nil { return "" } return g.BottomRight } func (g *GetLibrarySectionsAllUltraBlurColors) GetBottomLeft() string { if g == nil { return "" } return g.BottomLeft } type GetLibrarySectionsAllGuids struct { // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// // ID string `json:"id"` } func (g *GetLibrarySectionsAllGuids) GetID() string { if g == nil { return "" } return g.ID } type GetLibrarySectionsAllOptimizedForStreaming1 int const ( GetLibrarySectionsAllOptimizedForStreaming1Zero GetLibrarySectionsAllOptimizedForStreaming1 = 0 GetLibrarySectionsAllOptimizedForStreaming1One GetLibrarySectionsAllOptimizedForStreaming1 = 1 ) func (e GetLibrarySectionsAllOptimizedForStreaming1) ToPointer() *GetLibrarySectionsAllOptimizedForStreaming1 { return &e } func (e *GetLibrarySectionsAllOptimizedForStreaming1) 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 = GetLibrarySectionsAllOptimizedForStreaming1(v) return nil default: return fmt.Errorf("invalid value for GetLibrarySectionsAllOptimizedForStreaming1: %v", v) } } type GetLibrarySectionsAllOptimizedForStreamingType string const ( GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreamingType = "get-library-sections-all_optimizedForStreaming_1" GetLibrarySectionsAllOptimizedForStreamingTypeBoolean GetLibrarySectionsAllOptimizedForStreamingType = "boolean" ) // GetLibrarySectionsAllOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetLibrarySectionsAllOptimizedForStreaming struct { GetLibrarySectionsAllOptimizedForStreaming1 *GetLibrarySectionsAllOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"` Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` Type GetLibrarySectionsAllOptimizedForStreamingType } func CreateGetLibrarySectionsAllOptimizedForStreamingGetLibrarySectionsAllOptimizedForStreaming1(getLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreaming1) GetLibrarySectionsAllOptimizedForStreaming { typ := GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 return GetLibrarySectionsAllOptimizedForStreaming{ GetLibrarySectionsAllOptimizedForStreaming1: &getLibrarySectionsAllOptimizedForStreaming1, Type: typ, } } func CreateGetLibrarySectionsAllOptimizedForStreamingBoolean(boolean bool) GetLibrarySectionsAllOptimizedForStreaming { typ := GetLibrarySectionsAllOptimizedForStreamingTypeBoolean return GetLibrarySectionsAllOptimizedForStreaming{ Boolean: &boolean, Type: typ, } } func (u *GetLibrarySectionsAllOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getLibrarySectionsAllOptimizedForStreaming1 GetLibrarySectionsAllOptimizedForStreaming1 = GetLibrarySectionsAllOptimizedForStreaming1(0) if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreaming1, "", true, nil); err == nil { u.GetLibrarySectionsAllOptimizedForStreaming1 = &getLibrarySectionsAllOptimizedForStreaming1 u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 return nil } var boolean bool = false if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeBoolean return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetLibrarySectionsAllOptimizedForStreaming", string(data)) } func (u GetLibrarySectionsAllOptimizedForStreaming) MarshalJSON() ([]byte, error) { if u.GetLibrarySectionsAllOptimizedForStreaming1 != nil { return utils.MarshalJSON(u.GetLibrarySectionsAllOptimizedForStreaming1, "", true) } if u.Boolean != nil { return utils.MarshalJSON(u.Boolean, "", true) } return nil, errors.New("could not marshal union type GetLibrarySectionsAllOptimizedForStreaming: all fields are null") } type GetLibrarySectionsAllOptimizedForStreamingLibrary1 int const ( GetLibrarySectionsAllOptimizedForStreamingLibrary1Zero GetLibrarySectionsAllOptimizedForStreamingLibrary1 = 0 GetLibrarySectionsAllOptimizedForStreamingLibrary1One GetLibrarySectionsAllOptimizedForStreamingLibrary1 = 1 ) func (e GetLibrarySectionsAllOptimizedForStreamingLibrary1) ToPointer() *GetLibrarySectionsAllOptimizedForStreamingLibrary1 { return &e } func (e *GetLibrarySectionsAllOptimizedForStreamingLibrary1) 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 = GetLibrarySectionsAllOptimizedForStreamingLibrary1(v) return nil default: return fmt.Errorf("invalid value for GetLibrarySectionsAllOptimizedForStreamingLibrary1: %v", v) } } type GetLibrarySectionsAllLibraryOptimizedForStreamingType string const ( GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllLibraryOptimizedForStreamingType = "get-library-sections-all_optimizedForStreaming_Library_1" GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean GetLibrarySectionsAllLibraryOptimizedForStreamingType = "boolean" ) // GetLibrarySectionsAllLibraryOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true type GetLibrarySectionsAllLibraryOptimizedForStreaming struct { GetLibrarySectionsAllOptimizedForStreamingLibrary1 *GetLibrarySectionsAllOptimizedForStreamingLibrary1 `queryParam:"inline,name=optimizedForStreaming"` Boolean *bool `queryParam:"inline,name=optimizedForStreaming"` Type GetLibrarySectionsAllLibraryOptimizedForStreamingType } func CreateGetLibrarySectionsAllLibraryOptimizedForStreamingGetLibrarySectionsAllOptimizedForStreamingLibrary1(getLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllOptimizedForStreamingLibrary1) GetLibrarySectionsAllLibraryOptimizedForStreaming { typ := GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 return GetLibrarySectionsAllLibraryOptimizedForStreaming{ GetLibrarySectionsAllOptimizedForStreamingLibrary1: &getLibrarySectionsAllOptimizedForStreamingLibrary1, Type: typ, } } func CreateGetLibrarySectionsAllLibraryOptimizedForStreamingBoolean(boolean bool) GetLibrarySectionsAllLibraryOptimizedForStreaming { typ := GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean return GetLibrarySectionsAllLibraryOptimizedForStreaming{ Boolean: &boolean, Type: typ, } } func (u *GetLibrarySectionsAllLibraryOptimizedForStreaming) UnmarshalJSON(data []byte) error { var getLibrarySectionsAllOptimizedForStreamingLibrary1 GetLibrarySectionsAllOptimizedForStreamingLibrary1 = GetLibrarySectionsAllOptimizedForStreamingLibrary1(0) if err := utils.UnmarshalJSON(data, &getLibrarySectionsAllOptimizedForStreamingLibrary1, "", true, nil); err == nil { u.GetLibrarySectionsAllOptimizedForStreamingLibrary1 = &getLibrarySectionsAllOptimizedForStreamingLibrary1 u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 return nil } var boolean bool = false if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { u.Boolean = &boolean u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeBoolean return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetLibrarySectionsAllLibraryOptimizedForStreaming", string(data)) } func (u GetLibrarySectionsAllLibraryOptimizedForStreaming) MarshalJSON() ([]byte, error) { if u.GetLibrarySectionsAllOptimizedForStreamingLibrary1 != nil { return utils.MarshalJSON(u.GetLibrarySectionsAllOptimizedForStreamingLibrary1, "", true) } if u.Boolean != nil { return utils.MarshalJSON(u.Boolean, "", true) } return nil, errors.New("could not marshal union type GetLibrarySectionsAllLibraryOptimizedForStreaming: all fields are null") } // GetLibrarySectionsAllHasThumbnail - Indicates if the part has a thumbnail. type GetLibrarySectionsAllHasThumbnail string const ( GetLibrarySectionsAllHasThumbnailFalse GetLibrarySectionsAllHasThumbnail = "0" GetLibrarySectionsAllHasThumbnailTrue GetLibrarySectionsAllHasThumbnail = "1" ) func (e GetLibrarySectionsAllHasThumbnail) ToPointer() *GetLibrarySectionsAllHasThumbnail { return &e } func (e *GetLibrarySectionsAllHasThumbnail) 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 = GetLibrarySectionsAllHasThumbnail(v) return nil default: return fmt.Errorf("invalid value for GetLibrarySectionsAllHasThumbnail: %v", v) } } type GetLibrarySectionsAllStream struct { // Unique stream identifier. ID int64 `json:"id"` // Stream type: // - VIDEO = 1 // - AUDIO = 2 // - SUBTITLE = 3 // streamType int64 `const:"1" json:"streamType"` // Format of the stream (e.g., srt). Format *string `json:"format,omitempty"` // Indicates if this stream is default. Default *bool `json:"default,omitempty"` // Codec used by the stream. Codec string `json:"codec"` // Index of the stream. Index *int `json:"index,omitempty"` // Bitrate of the stream. Bitrate *int `json:"bitrate,omitempty"` // Language of the stream. Language *string `json:"language,omitempty"` // Language tag (e.g., en). LanguageTag *string `json:"languageTag,omitempty"` // ISO language code. LanguageCode *string `json:"languageCode,omitempty"` // Indicates whether header compression is enabled. HeaderCompression *bool `json:"headerCompression,omitempty"` // Dolby Vision BL compatibility ID. DOVIBLCompatID *int `json:"DOVIBLCompatID,omitempty"` // Indicates if Dolby Vision BL is present. DOVIBLPresent *bool `json:"DOVIBLPresent,omitempty"` // Indicates if Dolby Vision EL is present. DOVIELPresent *bool `json:"DOVIELPresent,omitempty"` // Dolby Vision level. DOVILevel *int `json:"DOVILevel,omitempty"` // Indicates if Dolby Vision is present. DOVIPresent *bool `json:"DOVIPresent,omitempty"` // Dolby Vision profile. DOVIProfile *int `json:"DOVIProfile,omitempty"` // Indicates if Dolby Vision RPU is present. DOVIRPUPresent *bool `json:"DOVIRPUPresent,omitempty"` // Dolby Vision version. DOVIVersion *string `json:"DOVIVersion,omitempty"` // Bit depth of the video stream. BitDepth *int `json:"bitDepth,omitempty"` // Chroma sample location. ChromaLocation *string `json:"chromaLocation,omitempty"` // Chroma subsampling format. ChromaSubsampling *string `json:"chromaSubsampling,omitempty"` // Coded video height. CodedHeight *int `json:"codedHeight,omitempty"` // Coded video width. CodedWidth *int `json:"codedWidth,omitempty"` ClosedCaptions *bool `json:"closedCaptions,omitempty"` // Color primaries used. ColorPrimaries *string `json:"colorPrimaries,omitempty"` // Color range (e.g., tv). ColorRange *string `json:"colorRange,omitempty"` // Color space. ColorSpace *string `json:"colorSpace,omitempty"` // Color transfer characteristics. ColorTrc *string `json:"colorTrc,omitempty"` // Frame rate of the stream. FrameRate *float32 `json:"frameRate,omitempty"` // Key to access this stream part. Key *string `json:"key,omitempty"` // Height of the video stream. Height *int `json:"height,omitempty"` // Video level. Level *int `json:"level,omitempty"` // Indicates if this is the original stream. Original *bool `json:"original,omitempty"` HasScalingMatrix *bool `json:"hasScalingMatrix,omitempty"` // Video profile. Profile *string `json:"profile,omitempty"` ScanType *string `json:"scanType,omitempty"` EmbeddedInVideo *string `json:"embeddedInVideo,omitempty"` // Number of reference frames. RefFrames *int `json:"refFrames,omitempty"` // Width of the video stream. Width *int `json:"width,omitempty"` // Display title for the stream. DisplayTitle string `json:"displayTitle"` // Extended display title for the stream. ExtendedDisplayTitle string `json:"extendedDisplayTitle"` // Indicates if this stream is selected (applicable for audio streams). Selected *bool `json:"selected,omitempty"` Forced *bool `json:"forced,omitempty"` // Number of audio channels (for audio streams). Channels *int `json:"channels,omitempty"` // Audio channel layout. AudioChannelLayout *string `json:"audioChannelLayout,omitempty"` // Sampling rate for the audio stream. SamplingRate *int `json:"samplingRate,omitempty"` // Indicates if the stream can auto-sync. CanAutoSync *bool `json:"canAutoSync,omitempty"` // Indicates if the stream is for the hearing impaired. HearingImpaired *bool `json:"hearingImpaired,omitempty"` // Indicates if the stream is a dub. Dub *bool `json:"dub,omitempty"` // Optional title for the stream (e.g., language variant). Title *string `json:"title,omitempty"` } func (g GetLibrarySectionsAllStream) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetLibrarySectionsAllStream) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "streamType", "codec", "displayTitle", "extendedDisplayTitle"}); err != nil { return err } return nil } func (g *GetLibrarySectionsAllStream) GetID() int64 { if g == nil { return 0 } return g.ID } func (g *GetLibrarySectionsAllStream) GetStreamType() int64 { return 1 } func (g *GetLibrarySectionsAllStream) GetFormat() *string { if g == nil { return nil } return g.Format } func (g *GetLibrarySectionsAllStream) GetDefault() *bool { if g == nil { return nil } return g.Default } func (g *GetLibrarySectionsAllStream) GetCodec() string { if g == nil { return "" } return g.Codec } func (g *GetLibrarySectionsAllStream) GetIndex() *int { if g == nil { return nil } return g.Index } func (g *GetLibrarySectionsAllStream) GetBitrate() *int { if g == nil { return nil } return g.Bitrate } func (g *GetLibrarySectionsAllStream) GetLanguage() *string { if g == nil { return nil } return g.Language } func (g *GetLibrarySectionsAllStream) GetLanguageTag() *string { if g == nil { return nil } return g.LanguageTag } func (g *GetLibrarySectionsAllStream) GetLanguageCode() *string { if g == nil { return nil } return g.LanguageCode } func (g *GetLibrarySectionsAllStream) GetHeaderCompression() *bool { if g == nil { return nil } return g.HeaderCompression } func (g *GetLibrarySectionsAllStream) GetDOVIBLCompatID() *int { if g == nil { return nil } return g.DOVIBLCompatID } func (g *GetLibrarySectionsAllStream) GetDOVIBLPresent() *bool { if g == nil { return nil } return g.DOVIBLPresent } func (g *GetLibrarySectionsAllStream) GetDOVIELPresent() *bool { if g == nil { return nil } return g.DOVIELPresent } func (g *GetLibrarySectionsAllStream) GetDOVILevel() *int { if g == nil { return nil } return g.DOVILevel } func (g *GetLibrarySectionsAllStream) GetDOVIPresent() *bool { if g == nil { return nil } return g.DOVIPresent } func (g *GetLibrarySectionsAllStream) GetDOVIProfile() *int { if g == nil { return nil } return g.DOVIProfile } func (g *GetLibrarySectionsAllStream) GetDOVIRPUPresent() *bool { if g == nil { return nil } return g.DOVIRPUPresent } func (g *GetLibrarySectionsAllStream) GetDOVIVersion() *string { if g == nil { return nil } return g.DOVIVersion } func (g *GetLibrarySectionsAllStream) GetBitDepth() *int { if g == nil { return nil } return g.BitDepth } func (g *GetLibrarySectionsAllStream) GetChromaLocation() *string { if g == nil { return nil } return g.ChromaLocation } func (g *GetLibrarySectionsAllStream) GetChromaSubsampling() *string { if g == nil { return nil } return g.ChromaSubsampling } func (g *GetLibrarySectionsAllStream) GetCodedHeight() *int { if g == nil { return nil } return g.CodedHeight } func (g *GetLibrarySectionsAllStream) GetCodedWidth() *int { if g == nil { return nil } return g.CodedWidth } func (g *GetLibrarySectionsAllStream) GetClosedCaptions() *bool { if g == nil { return nil } return g.ClosedCaptions } func (g *GetLibrarySectionsAllStream) GetColorPrimaries() *string { if g == nil { return nil } return g.ColorPrimaries } func (g *GetLibrarySectionsAllStream) GetColorRange() *string { if g == nil { return nil } return g.ColorRange } func (g *GetLibrarySectionsAllStream) GetColorSpace() *string { if g == nil { return nil } return g.ColorSpace } func (g *GetLibrarySectionsAllStream) GetColorTrc() *string { if g == nil { return nil } return g.ColorTrc } func (g *GetLibrarySectionsAllStream) GetFrameRate() *float32 { if g == nil { return nil } return g.FrameRate } func (g *GetLibrarySectionsAllStream) GetKey() *string { if g == nil { return nil } return g.Key } func (g *GetLibrarySectionsAllStream) GetHeight() *int { if g == nil { return nil } return g.Height } func (g *GetLibrarySectionsAllStream) GetLevel() *int { if g == nil { return nil } return g.Level } func (g *GetLibrarySectionsAllStream) GetOriginal() *bool { if g == nil { return nil } return g.Original } func (g *GetLibrarySectionsAllStream) GetHasScalingMatrix() *bool { if g == nil { return nil } return g.HasScalingMatrix } func (g *GetLibrarySectionsAllStream) GetProfile() *string { if g == nil { return nil } return g.Profile } func (g *GetLibrarySectionsAllStream) GetScanType() *string { if g == nil { return nil } return g.ScanType } func (g *GetLibrarySectionsAllStream) GetEmbeddedInVideo() *string { if g == nil { return nil } return g.EmbeddedInVideo } func (g *GetLibrarySectionsAllStream) GetRefFrames() *int { if g == nil { return nil } return g.RefFrames } func (g *GetLibrarySectionsAllStream) GetWidth() *int { if g == nil { return nil } return g.Width } func (g *GetLibrarySectionsAllStream) GetDisplayTitle() string { if g == nil { return "" } return g.DisplayTitle } func (g *GetLibrarySectionsAllStream) GetExtendedDisplayTitle() string { if g == nil { return "" } return g.ExtendedDisplayTitle } func (g *GetLibrarySectionsAllStream) GetSelected() *bool { if g == nil { return nil } return g.Selected } func (g *GetLibrarySectionsAllStream) GetForced() *bool { if g == nil { return nil } return g.Forced } func (g *GetLibrarySectionsAllStream) GetChannels() *int { if g == nil { return nil } return g.Channels } func (g *GetLibrarySectionsAllStream) GetAudioChannelLayout() *string { if g == nil { return nil } return g.AudioChannelLayout } func (g *GetLibrarySectionsAllStream) GetSamplingRate() *int { if g == nil { return nil } return g.SamplingRate } func (g *GetLibrarySectionsAllStream) GetCanAutoSync() *bool { if g == nil { return nil } return g.CanAutoSync } func (g *GetLibrarySectionsAllStream) GetHearingImpaired() *bool { if g == nil { return nil } return g.HearingImpaired } func (g *GetLibrarySectionsAllStream) GetDub() *bool { if g == nil { return nil } return g.Dub } func (g *GetLibrarySectionsAllStream) GetTitle() *string { if g == nil { return nil } return g.Title } type GetLibrarySectionsAllPart struct { // Indicates if the part is accessible. Accessible *bool `json:"accessible,omitempty"` // Indicates if the part exists. Exists *bool `json:"exists,omitempty"` // Unique part identifier. ID int64 `json:"id"` // Key to access this part. Key string `json:"key"` Indexes *string `json:"indexes,omitempty"` // Duration of the part in milliseconds. Duration *int `json:"duration,omitempty"` // File path for the part. File string `json:"file"` // File size in bytes. Size int64 `json:"size"` PacketLength *int `json:"packetLength,omitempty"` // Container format of the part. Container *string `json:"container,omitempty"` // Video profile for the part. VideoProfile *string `json:"videoProfile,omitempty"` // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). AudioProfile *string `json:"audioProfile,omitempty"` Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true OptimizedForStreaming *GetLibrarySectionsAllLibraryOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` HasThumbnail *GetLibrarySectionsAllHasThumbnail `default:"0" json:"hasThumbnail"` // An array of streams for this part. Stream []GetLibrarySectionsAllStream `json:"Stream,omitempty"` } func (g GetLibrarySectionsAllPart) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetLibrarySectionsAllPart) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"id", "key", "file", "size"}); err != nil { return err } return nil } func (g *GetLibrarySectionsAllPart) GetAccessible() *bool { if g == nil { return nil } return g.Accessible } func (g *GetLibrarySectionsAllPart) GetExists() *bool { if g == nil { return nil } return g.Exists } func (g *GetLibrarySectionsAllPart) GetID() int64 { if g == nil { return 0 } return g.ID } func (g *GetLibrarySectionsAllPart) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllPart) GetIndexes() *string { if g == nil { return nil } return g.Indexes } func (g *GetLibrarySectionsAllPart) GetDuration() *int { if g == nil { return nil } return g.Duration } func (g *GetLibrarySectionsAllPart) GetFile() string { if g == nil { return "" } return g.File } func (g *GetLibrarySectionsAllPart) GetSize() int64 { if g == nil { return 0 } return g.Size } func (g *GetLibrarySectionsAllPart) GetPacketLength() *int { if g == nil { return nil } return g.PacketLength } func (g *GetLibrarySectionsAllPart) GetContainer() *string { if g == nil { return nil } return g.Container } func (g *GetLibrarySectionsAllPart) GetVideoProfile() *string { if g == nil { return nil } return g.VideoProfile } func (g *GetLibrarySectionsAllPart) GetAudioProfile() *string { if g == nil { return nil } return g.AudioProfile } func (g *GetLibrarySectionsAllPart) GetHas64bitOffsets() *bool { if g == nil { return nil } return g.Has64bitOffsets } func (g *GetLibrarySectionsAllPart) GetOptimizedForStreaming() *GetLibrarySectionsAllLibraryOptimizedForStreaming { if g == nil { return nil } return g.OptimizedForStreaming } func (g *GetLibrarySectionsAllPart) GetHasThumbnail() *GetLibrarySectionsAllHasThumbnail { if g == nil { return nil } return g.HasThumbnail } func (g *GetLibrarySectionsAllPart) GetStream() []GetLibrarySectionsAllStream { if g == nil { return nil } return g.Stream } type GetLibrarySectionsAllMedia struct { // Unique media identifier. ID int64 `json:"id"` // Duration of the media in milliseconds. Duration *int `json:"duration,omitempty"` // Bitrate in bits per second. Bitrate *int `json:"bitrate,omitempty"` // Video width in pixels. Width *int `json:"width,omitempty"` // Video height in pixels. Height *int `json:"height,omitempty"` // Aspect ratio of the video. AspectRatio *float32 `json:"aspectRatio,omitempty"` // Number of audio channels. AudioChannels *int `json:"audioChannels,omitempty"` DisplayOffset *int `json:"displayOffset,omitempty"` // Audio codec used. AudioCodec *string `json:"audioCodec,omitempty"` // Video codec used. VideoCodec *string `json:"videoCodec,omitempty"` // Video resolution (e.g., 4k). VideoResolution *string `json:"videoResolution,omitempty"` // File container type. Container *string `json:"container,omitempty"` // Frame rate of the video. Values found include NTSC, PAL, 24p // VideoFrameRate *string `json:"videoFrameRate,omitempty"` // Video profile (e.g., main 10). VideoProfile *string `json:"videoProfile,omitempty"` // Indicates whether voice activity is detected. HasVoiceActivity *bool `json:"hasVoiceActivity,omitempty"` // The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). AudioProfile *string `json:"audioProfile,omitempty"` // Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true OptimizedForStreaming *GetLibrarySectionsAllOptimizedForStreaming `json:"optimizedForStreaming,omitempty"` Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` // An array of parts for this media item. Part []GetLibrarySectionsAllPart `json:"Part,omitempty"` } func (g *GetLibrarySectionsAllMedia) GetID() int64 { if g == nil { return 0 } return g.ID } func (g *GetLibrarySectionsAllMedia) GetDuration() *int { if g == nil { return nil } return g.Duration } func (g *GetLibrarySectionsAllMedia) GetBitrate() *int { if g == nil { return nil } return g.Bitrate } func (g *GetLibrarySectionsAllMedia) GetWidth() *int { if g == nil { return nil } return g.Width } func (g *GetLibrarySectionsAllMedia) GetHeight() *int { if g == nil { return nil } return g.Height } func (g *GetLibrarySectionsAllMedia) GetAspectRatio() *float32 { if g == nil { return nil } return g.AspectRatio } func (g *GetLibrarySectionsAllMedia) GetAudioChannels() *int { if g == nil { return nil } return g.AudioChannels } func (g *GetLibrarySectionsAllMedia) GetDisplayOffset() *int { if g == nil { return nil } return g.DisplayOffset } func (g *GetLibrarySectionsAllMedia) GetAudioCodec() *string { if g == nil { return nil } return g.AudioCodec } func (g *GetLibrarySectionsAllMedia) GetVideoCodec() *string { if g == nil { return nil } return g.VideoCodec } func (g *GetLibrarySectionsAllMedia) GetVideoResolution() *string { if g == nil { return nil } return g.VideoResolution } func (g *GetLibrarySectionsAllMedia) GetContainer() *string { if g == nil { return nil } return g.Container } func (g *GetLibrarySectionsAllMedia) GetVideoFrameRate() *string { if g == nil { return nil } return g.VideoFrameRate } func (g *GetLibrarySectionsAllMedia) GetVideoProfile() *string { if g == nil { return nil } return g.VideoProfile } func (g *GetLibrarySectionsAllMedia) GetHasVoiceActivity() *bool { if g == nil { return nil } return g.HasVoiceActivity } func (g *GetLibrarySectionsAllMedia) GetAudioProfile() *string { if g == nil { return nil } return g.AudioProfile } func (g *GetLibrarySectionsAllMedia) GetOptimizedForStreaming() *GetLibrarySectionsAllOptimizedForStreaming { if g == nil { return nil } return g.OptimizedForStreaming } func (g *GetLibrarySectionsAllMedia) GetHas64bitOffsets() *bool { if g == nil { return nil } return g.Has64bitOffsets } func (g *GetLibrarySectionsAllMedia) GetPart() []GetLibrarySectionsAllPart { if g == nil { return nil } return g.Part } type GetLibrarySectionsAllGenre struct { // The genre name of this media-item // Tag string `json:"tag"` } func (g *GetLibrarySectionsAllGenre) GetTag() string { if g == nil { return "" } return g.Tag } type GetLibrarySectionsAllCountry struct { // The country of origin of this media item Tag string `json:"tag"` } func (g *GetLibrarySectionsAllCountry) GetTag() string { if g == nil { return "" } return g.Tag } type GetLibrarySectionsAllDirector struct { // The role of Director Tag string `json:"tag"` } func (g *GetLibrarySectionsAllDirector) GetTag() string { if g == nil { return "" } return g.Tag } type GetLibrarySectionsAllWriter struct { // The role of Writer Tag string `json:"tag"` } func (g *GetLibrarySectionsAllWriter) GetTag() string { if g == nil { return "" } return g.Tag } type GetLibrarySectionsAllRole struct { // The display tag for the actor (typically the actor's name). Tag string `json:"tag"` } func (g *GetLibrarySectionsAllRole) GetTag() string { if g == nil { return "" } return g.Tag } type GetLibrarySectionsAllCollection struct { // The user-made collection this media item belongs to Tag string `json:"tag"` } func (g *GetLibrarySectionsAllCollection) GetTag() string { if g == nil { return "" } return g.Tag } // GetLibrarySectionsAllMetadata - Unknown type GetLibrarySectionsAllMetadata struct { // The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. RatingKey string `json:"ratingKey"` // The unique key for the media item. Key string `json:"key"` // The globally unique identifier for the media item. GUID string `json:"guid"` // A URL‐friendly version of the media title. Slug string `json:"slug"` // The studio that produced the media item. Studio *string `json:"studio,omitempty"` Type GetLibrarySectionsAllLibraryType `json:"type"` // The title of the media item. Title string `json:"title"` // The sort title used for ordering media items. TitleSort string `json:"titleSort"` // The content rating for the media item. ContentRating *string `json:"contentRating,omitempty"` // A synopsis of the media item. Summary string `json:"summary"` // The critic rating for the media item. Rating float32 `json:"rating"` // The audience rating for the media item. AudienceRating float64 `json:"audienceRating"` // The release year of the media item. Year *int `json:"year,omitempty"` // A brief tagline for the media item. Tagline string `json:"tagline"` // The thumbnail image URL for the media item. Thumb string `json:"thumb"` // The art image URL for the media item. Art string `json:"art"` // The theme URL for the media item. Theme string `json:"theme"` // The index position of the media item. Index int `json:"index"` // The number of leaf items (end nodes) under this media item. LeafCount *int `json:"leafCount,omitempty"` // The number of leaf items that have been viewed. ViewedLeafCount *int `json:"viewedLeafCount,omitempty"` // The number of child items associated with this media item. ChildCount int `json:"childCount"` // The total number of seasons (for TV shows). SeasonCount int `json:"seasonCount"` // The duration of the media item in milliseconds. Duration int `json:"duration"` // The original release date of the media item. OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` AddedAt int64 `json:"addedAt"` // Unix epoch datetime in seconds UpdatedAt *int64 `json:"updatedAt,omitempty"` // The URL for the audience rating image. AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` // The source from which chapter data is derived. ChapterSource *string `json:"chapterSource,omitempty"` // The primary extra key associated with this media item. PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` // The original title of the media item (if different). OriginalTitle *string `json:"originalTitle,omitempty"` // The rating key of the parent media item. ParentRatingKey *string `json:"parentRatingKey,omitempty"` // The rating key of the grandparent media item. GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"` // The GUID of the parent media item. ParentGUID *string `json:"parentGuid,omitempty"` // The GUID of the grandparent media item. GrandparentGUID *string `json:"grandparentGuid,omitempty"` // The slug for the grandparent media item. GrandparentSlug *string `json:"grandparentSlug,omitempty"` // The key of the grandparent media item. GrandparentKey *string `json:"grandparentKey,omitempty"` // The key of the parent media item. ParentKey *string `json:"parentKey,omitempty"` // The title of the grandparent media item. GrandparentTitle *string `json:"grandparentTitle,omitempty"` // The thumbnail URL for the grandparent media item. GrandparentThumb *string `json:"grandparentThumb,omitempty"` // The theme URL for the grandparent media item. GrandparentTheme *string `json:"grandparentTheme,omitempty"` // The art URL for the grandparent media item. GrandparentArt *string `json:"grandparentArt,omitempty"` // The title of the parent media item. ParentTitle *string `json:"parentTitle,omitempty"` // The index position of the parent media item. ParentIndex *int `json:"parentIndex,omitempty"` // The thumbnail URL for the parent media item. ParentThumb *string `json:"parentThumb,omitempty"` // The URL for the rating image. RatingImage *string `json:"ratingImage,omitempty"` // The number of times this media item has been viewed. ViewCount *int `json:"viewCount,omitempty"` // The current playback offset (in milliseconds). ViewOffset *int `json:"viewOffset,omitempty"` // The number of times this media item has been skipped. SkipCount *int `json:"skipCount,omitempty"` // A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. Subtype *string `json:"subtype,omitempty"` // The Unix timestamp representing the last time the item was rated. LastRatedAt *int64 `json:"lastRatedAt,omitempty"` // The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). CreatedAtAccuracy *string `json:"createdAtAccuracy,omitempty"` // The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. CreatedAtTZOffset *string `json:"createdAtTZOffset,omitempty"` // Unix timestamp for when the media item was last viewed. LastViewedAt *int `json:"lastViewedAt,omitempty"` // The rating provided by a user for the item. This value is expressed as a decimal number. UserRating *float32 `json:"userRating,omitempty"` Image []GetLibrarySectionsAllImage `json:"Image,omitempty"` UltraBlurColors *GetLibrarySectionsAllUltraBlurColors `json:"UltraBlurColors,omitempty"` Guids []GetLibrarySectionsAllGuids `json:"Guid,omitempty"` Media []GetLibrarySectionsAllMedia `json:"Media,omitempty"` Genre []GetLibrarySectionsAllGenre `json:"Genre,omitempty"` Country []GetLibrarySectionsAllCountry `json:"Country,omitempty"` Director []GetLibrarySectionsAllDirector `json:"Director,omitempty"` Writer []GetLibrarySectionsAllWriter `json:"Writer,omitempty"` Role []GetLibrarySectionsAllRole `json:"Role,omitempty"` Collection []GetLibrarySectionsAllCollection `json:"Collection,omitempty"` } func (g GetLibrarySectionsAllMetadata) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetLibrarySectionsAllMetadata) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"ratingKey", "key", "guid", "slug", "type", "title", "titleSort", "summary", "rating", "audienceRating", "tagline", "thumb", "art", "theme", "index", "childCount", "seasonCount", "duration", "addedAt"}); err != nil { return err } return nil } func (g *GetLibrarySectionsAllMetadata) GetRatingKey() string { if g == nil { return "" } return g.RatingKey } func (g *GetLibrarySectionsAllMetadata) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetLibrarySectionsAllMetadata) GetGUID() string { if g == nil { return "" } return g.GUID } func (g *GetLibrarySectionsAllMetadata) GetSlug() string { if g == nil { return "" } return g.Slug } func (g *GetLibrarySectionsAllMetadata) GetStudio() *string { if g == nil { return nil } return g.Studio } func (g *GetLibrarySectionsAllMetadata) GetType() GetLibrarySectionsAllLibraryType { if g == nil { return GetLibrarySectionsAllLibraryType("") } return g.Type } func (g *GetLibrarySectionsAllMetadata) GetTitle() string { if g == nil { return "" } return g.Title } func (g *GetLibrarySectionsAllMetadata) GetTitleSort() string { if g == nil { return "" } return g.TitleSort } func (g *GetLibrarySectionsAllMetadata) GetContentRating() *string { if g == nil { return nil } return g.ContentRating } func (g *GetLibrarySectionsAllMetadata) GetSummary() string { if g == nil { return "" } return g.Summary } func (g *GetLibrarySectionsAllMetadata) GetRating() float32 { if g == nil { return 0.0 } return g.Rating } func (g *GetLibrarySectionsAllMetadata) GetAudienceRating() float64 { if g == nil { return 0.0 } return g.AudienceRating } func (g *GetLibrarySectionsAllMetadata) GetYear() *int { if g == nil { return nil } return g.Year } func (g *GetLibrarySectionsAllMetadata) GetTagline() string { if g == nil { return "" } return g.Tagline } func (g *GetLibrarySectionsAllMetadata) GetThumb() string { if g == nil { return "" } return g.Thumb } func (g *GetLibrarySectionsAllMetadata) GetArt() string { if g == nil { return "" } return g.Art } func (g *GetLibrarySectionsAllMetadata) GetTheme() string { if g == nil { return "" } return g.Theme } func (g *GetLibrarySectionsAllMetadata) GetIndex() int { if g == nil { return 0 } return g.Index } func (g *GetLibrarySectionsAllMetadata) GetLeafCount() *int { if g == nil { return nil } return g.LeafCount } func (g *GetLibrarySectionsAllMetadata) GetViewedLeafCount() *int { if g == nil { return nil } return g.ViewedLeafCount } func (g *GetLibrarySectionsAllMetadata) GetChildCount() int { if g == nil { return 0 } return g.ChildCount } func (g *GetLibrarySectionsAllMetadata) GetSeasonCount() int { if g == nil { return 0 } return g.SeasonCount } func (g *GetLibrarySectionsAllMetadata) GetDuration() int { if g == nil { return 0 } return g.Duration } func (g *GetLibrarySectionsAllMetadata) GetOriginallyAvailableAt() *types.Date { if g == nil { return nil } return g.OriginallyAvailableAt } func (g *GetLibrarySectionsAllMetadata) GetAddedAt() int64 { if g == nil { return 0 } return g.AddedAt } func (g *GetLibrarySectionsAllMetadata) GetUpdatedAt() *int64 { if g == nil { return nil } return g.UpdatedAt } func (g *GetLibrarySectionsAllMetadata) GetAudienceRatingImage() *string { if g == nil { return nil } return g.AudienceRatingImage } func (g *GetLibrarySectionsAllMetadata) GetChapterSource() *string { if g == nil { return nil } return g.ChapterSource } func (g *GetLibrarySectionsAllMetadata) GetPrimaryExtraKey() *string { if g == nil { return nil } return g.PrimaryExtraKey } func (g *GetLibrarySectionsAllMetadata) GetOriginalTitle() *string { if g == nil { return nil } return g.OriginalTitle } func (g *GetLibrarySectionsAllMetadata) GetParentRatingKey() *string { if g == nil { return nil } return g.ParentRatingKey } func (g *GetLibrarySectionsAllMetadata) GetGrandparentRatingKey() *string { if g == nil { return nil } return g.GrandparentRatingKey } func (g *GetLibrarySectionsAllMetadata) GetParentGUID() *string { if g == nil { return nil } return g.ParentGUID } func (g *GetLibrarySectionsAllMetadata) GetGrandparentGUID() *string { if g == nil { return nil } return g.GrandparentGUID } func (g *GetLibrarySectionsAllMetadata) GetGrandparentSlug() *string { if g == nil { return nil } return g.GrandparentSlug } func (g *GetLibrarySectionsAllMetadata) GetGrandparentKey() *string { if g == nil { return nil } return g.GrandparentKey } func (g *GetLibrarySectionsAllMetadata) GetParentKey() *string { if g == nil { return nil } return g.ParentKey } func (g *GetLibrarySectionsAllMetadata) GetGrandparentTitle() *string { if g == nil { return nil } return g.GrandparentTitle } func (g *GetLibrarySectionsAllMetadata) GetGrandparentThumb() *string { if g == nil { return nil } return g.GrandparentThumb } func (g *GetLibrarySectionsAllMetadata) GetGrandparentTheme() *string { if g == nil { return nil } return g.GrandparentTheme } func (g *GetLibrarySectionsAllMetadata) GetGrandparentArt() *string { if g == nil { return nil } return g.GrandparentArt } func (g *GetLibrarySectionsAllMetadata) GetParentTitle() *string { if g == nil { return nil } return g.ParentTitle } func (g *GetLibrarySectionsAllMetadata) GetParentIndex() *int { if g == nil { return nil } return g.ParentIndex } func (g *GetLibrarySectionsAllMetadata) GetParentThumb() *string { if g == nil { return nil } return g.ParentThumb } func (g *GetLibrarySectionsAllMetadata) GetRatingImage() *string { if g == nil { return nil } return g.RatingImage } func (g *GetLibrarySectionsAllMetadata) GetViewCount() *int { if g == nil { return nil } return g.ViewCount } func (g *GetLibrarySectionsAllMetadata) GetViewOffset() *int { if g == nil { return nil } return g.ViewOffset } func (g *GetLibrarySectionsAllMetadata) GetSkipCount() *int { if g == nil { return nil } return g.SkipCount } func (g *GetLibrarySectionsAllMetadata) GetSubtype() *string { if g == nil { return nil } return g.Subtype } func (g *GetLibrarySectionsAllMetadata) GetLastRatedAt() *int64 { if g == nil { return nil } return g.LastRatedAt } func (g *GetLibrarySectionsAllMetadata) GetCreatedAtAccuracy() *string { if g == nil { return nil } return g.CreatedAtAccuracy } func (g *GetLibrarySectionsAllMetadata) GetCreatedAtTZOffset() *string { if g == nil { return nil } return g.CreatedAtTZOffset } func (g *GetLibrarySectionsAllMetadata) GetLastViewedAt() *int { if g == nil { return nil } return g.LastViewedAt } func (g *GetLibrarySectionsAllMetadata) GetUserRating() *float32 { if g == nil { return nil } return g.UserRating } func (g *GetLibrarySectionsAllMetadata) GetImage() []GetLibrarySectionsAllImage { if g == nil { return nil } return g.Image } func (g *GetLibrarySectionsAllMetadata) GetUltraBlurColors() *GetLibrarySectionsAllUltraBlurColors { if g == nil { return nil } return g.UltraBlurColors } func (g *GetLibrarySectionsAllMetadata) GetGuids() []GetLibrarySectionsAllGuids { if g == nil { return nil } return g.Guids } func (g *GetLibrarySectionsAllMetadata) GetMedia() []GetLibrarySectionsAllMedia { if g == nil { return nil } return g.Media } func (g *GetLibrarySectionsAllMetadata) GetGenre() []GetLibrarySectionsAllGenre { if g == nil { return nil } return g.Genre } func (g *GetLibrarySectionsAllMetadata) GetCountry() []GetLibrarySectionsAllCountry { if g == nil { return nil } return g.Country } func (g *GetLibrarySectionsAllMetadata) GetDirector() []GetLibrarySectionsAllDirector { if g == nil { return nil } return g.Director } func (g *GetLibrarySectionsAllMetadata) GetWriter() []GetLibrarySectionsAllWriter { if g == nil { return nil } return g.Writer } func (g *GetLibrarySectionsAllMetadata) GetRole() []GetLibrarySectionsAllRole { if g == nil { return nil } return g.Role } func (g *GetLibrarySectionsAllMetadata) GetCollection() []GetLibrarySectionsAllCollection { if g == nil { return nil } return g.Collection } type GetLibrarySectionsAllMediaContainer struct { // Number of media items returned in this response. Size int `json:"size"` // Total number of media items in the library. TotalSize int `json:"totalSize"` // Offset value for pagination. Offset int64 `json:"offset"` // Indicates whether syncing is allowed. AllowSync bool `json:"allowSync"` // URL for the background artwork of the media container. Art string `json:"art"` // The content type or mode. Content string `json:"content"` // An plugin identifier for the media container. Identifier string `json:"identifier"` // The unique identifier for the library section. LibrarySectionID *int64 `json:"librarySectionID,omitempty"` // The title of the library section. LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` // The universally unique identifier for the library section. LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` // The prefix used for media tag resource paths. MediaTagPrefix string `json:"mediaTagPrefix"` // The version number for media tags. MediaTagVersion int64 `json:"mediaTagVersion"` // URL for the thumbnail image of the media container. Thumb string `json:"thumb"` // Specifies whether caching is disabled. Nocache bool `json:"nocache"` // The primary title of the media container. Title1 string `json:"title1"` // The secondary title of the media container. Title2 string `json:"title2"` // Identifier for the view group layout. ViewGroup string `json:"viewGroup"` // The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. // Meta *GetLibrarySectionsAllMeta `json:"Meta,omitempty"` // An array of metadata items. Metadata []GetLibrarySectionsAllMetadata `json:"Metadata,omitempty"` } func (g *GetLibrarySectionsAllMediaContainer) GetSize() int { if g == nil { return 0 } return g.Size } func (g *GetLibrarySectionsAllMediaContainer) GetTotalSize() int { if g == nil { return 0 } return g.TotalSize } func (g *GetLibrarySectionsAllMediaContainer) GetOffset() int64 { if g == nil { return 0 } return g.Offset } func (g *GetLibrarySectionsAllMediaContainer) GetAllowSync() bool { if g == nil { return false } return g.AllowSync } func (g *GetLibrarySectionsAllMediaContainer) GetArt() string { if g == nil { return "" } return g.Art } func (g *GetLibrarySectionsAllMediaContainer) GetContent() string { if g == nil { return "" } return g.Content } func (g *GetLibrarySectionsAllMediaContainer) GetIdentifier() string { if g == nil { return "" } return g.Identifier } func (g *GetLibrarySectionsAllMediaContainer) GetLibrarySectionID() *int64 { if g == nil { return nil } return g.LibrarySectionID } func (g *GetLibrarySectionsAllMediaContainer) GetLibrarySectionTitle() *string { if g == nil { return nil } return g.LibrarySectionTitle } func (g *GetLibrarySectionsAllMediaContainer) GetLibrarySectionUUID() *string { if g == nil { return nil } return g.LibrarySectionUUID } func (g *GetLibrarySectionsAllMediaContainer) GetMediaTagPrefix() string { if g == nil { return "" } return g.MediaTagPrefix } func (g *GetLibrarySectionsAllMediaContainer) GetMediaTagVersion() int64 { if g == nil { return 0 } return g.MediaTagVersion } func (g *GetLibrarySectionsAllMediaContainer) GetThumb() string { if g == nil { return "" } return g.Thumb } func (g *GetLibrarySectionsAllMediaContainer) GetNocache() bool { if g == nil { return false } return g.Nocache } func (g *GetLibrarySectionsAllMediaContainer) GetTitle1() string { if g == nil { return "" } return g.Title1 } func (g *GetLibrarySectionsAllMediaContainer) GetTitle2() string { if g == nil { return "" } return g.Title2 } func (g *GetLibrarySectionsAllMediaContainer) GetViewGroup() string { if g == nil { return "" } return g.ViewGroup } func (g *GetLibrarySectionsAllMediaContainer) GetMeta() *GetLibrarySectionsAllMeta { if g == nil { return nil } return g.Meta } func (g *GetLibrarySectionsAllMediaContainer) GetMetadata() []GetLibrarySectionsAllMetadata { if g == nil { return nil } return g.Metadata } // GetLibrarySectionsAllResponseBody - Successful response containing media container data. type GetLibrarySectionsAllResponseBody struct { MediaContainer *GetLibrarySectionsAllMediaContainer `json:"MediaContainer,omitempty"` } func (g *GetLibrarySectionsAllResponseBody) GetMediaContainer() *GetLibrarySectionsAllMediaContainer { if g == nil { return nil } return g.MediaContainer } type GetLibrarySectionsAllResponse 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 // Successful response containing media container data. Object *GetLibrarySectionsAllResponseBody } func (g *GetLibrarySectionsAllResponse) GetContentType() string { if g == nil { return "" } return g.ContentType } func (g *GetLibrarySectionsAllResponse) GetStatusCode() int { if g == nil { return 0 } return g.StatusCode } func (g *GetLibrarySectionsAllResponse) GetRawResponse() *http.Response { if g == nil { return nil } return g.RawResponse } func (g *GetLibrarySectionsAllResponse) GetObject() *GetLibrarySectionsAllResponseBody { if g == nil { return nil } return g.Object }