// 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, false); err != nil { return err } return nil } func (o *GetLibrarySectionsAllRequest) GetSectionKey() int { if o == nil { return 0 } return o.SectionKey } func (o *GetLibrarySectionsAllRequest) GetType() GetLibrarySectionsAllQueryParamType { if o == nil { return GetLibrarySectionsAllQueryParamType(0) } return o.Type } func (o *GetLibrarySectionsAllRequest) GetIncludeMeta() *GetLibrarySectionsAllQueryParamIncludeMeta { if o == nil { return nil } return o.IncludeMeta } func (o *GetLibrarySectionsAllRequest) GetIncludeGuids() *QueryParamIncludeGuids { if o == nil { return nil } return o.IncludeGuids } func (o *GetLibrarySectionsAllRequest) GetIncludeAdvanced() *IncludeAdvanced { if o == nil { return nil } return o.IncludeAdvanced } func (o *GetLibrarySectionsAllRequest) GetIncludeCollections() *QueryParamIncludeCollections { if o == nil { return nil } return o.IncludeCollections } func (o *GetLibrarySectionsAllRequest) GetIncludeExternalMedia() *QueryParamIncludeExternalMedia { if o == nil { return nil } return o.IncludeExternalMedia } func (o *GetLibrarySectionsAllRequest) GetXPlexContainerStart() *int { if o == nil { return nil } return o.XPlexContainerStart } func (o *GetLibrarySectionsAllRequest) GetXPlexContainerSize() *int { if o == nil { return nil } return o.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 (o *GetLibrarySectionsAllFilter) GetFilter() string { if o == nil { return "" } return o.Filter } func (o *GetLibrarySectionsAllFilter) GetFilterType() string { if o == nil { return "" } return o.FilterType } func (o *GetLibrarySectionsAllFilter) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllFilter) GetTitle() string { if o == nil { return "" } return o.Title } func (o *GetLibrarySectionsAllFilter) GetType() string { if o == nil { return "" } return o.Type } func (o *GetLibrarySectionsAllFilter) GetAdvanced() *bool { if o == nil { return nil } return o.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, false); err != nil { return err } return nil } func (o *GetLibrarySectionsAllSort) GetDefault() *string { if o == nil { return nil } return o.Default } func (o *GetLibrarySectionsAllSort) GetActive() *bool { if o == nil { return nil } return o.Active } func (o *GetLibrarySectionsAllSort) GetActiveDirection() *GetLibrarySectionsAllActiveDirection { if o == nil { return nil } return o.ActiveDirection } func (o *GetLibrarySectionsAllSort) GetDefaultDirection() *GetLibrarySectionsAllDefaultDirection { if o == nil { return nil } return o.DefaultDirection } func (o *GetLibrarySectionsAllSort) GetDescKey() *string { if o == nil { return nil } return o.DescKey } func (o *GetLibrarySectionsAllSort) GetFirstCharacterKey() *string { if o == nil { return nil } return o.FirstCharacterKey } func (o *GetLibrarySectionsAllSort) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllSort) GetTitle() string { if o == nil { return "" } return o.Title } type GetLibrarySectionsAllField struct { Key string `json:"key"` Title string `json:"title"` Type string `json:"type"` SubType *string `json:"subType,omitempty"` } func (o *GetLibrarySectionsAllField) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllField) GetTitle() string { if o == nil { return "" } return o.Title } func (o *GetLibrarySectionsAllField) GetType() string { if o == nil { return "" } return o.Type } func (o *GetLibrarySectionsAllField) GetSubType() *string { if o == nil { return nil } return o.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 (o *GetLibrarySectionsAllType) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllType) GetType() string { if o == nil { return "" } return o.Type } func (o *GetLibrarySectionsAllType) GetSubtype() *string { if o == nil { return nil } return o.Subtype } func (o *GetLibrarySectionsAllType) GetTitle() string { if o == nil { return "" } return o.Title } func (o *GetLibrarySectionsAllType) GetActive() bool { if o == nil { return false } return o.Active } func (o *GetLibrarySectionsAllType) GetFilter() []GetLibrarySectionsAllFilter { if o == nil { return nil } return o.Filter } func (o *GetLibrarySectionsAllType) GetSort() []GetLibrarySectionsAllSort { if o == nil { return nil } return o.Sort } func (o *GetLibrarySectionsAllType) GetField() []GetLibrarySectionsAllField { if o == nil { return nil } return o.Field } type GetLibrarySectionsAllOperator struct { Key string `json:"key"` Title string `json:"title"` } func (o *GetLibrarySectionsAllOperator) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllOperator) GetTitle() string { if o == nil { return "" } return o.Title } type GetLibrarySectionsAllFieldType struct { Type string `json:"type"` Operator []GetLibrarySectionsAllOperator `json:"Operator"` } func (o *GetLibrarySectionsAllFieldType) GetType() string { if o == nil { return "" } return o.Type } func (o *GetLibrarySectionsAllFieldType) GetOperator() []GetLibrarySectionsAllOperator { if o == nil { return []GetLibrarySectionsAllOperator{} } return o.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 (o *GetLibrarySectionsAllMeta) GetType() []GetLibrarySectionsAllType { if o == nil { return nil } return o.Type } func (o *GetLibrarySectionsAllMeta) GetFieldType() []GetLibrarySectionsAllFieldType { if o == nil { return nil } return o.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 (o *GetLibrarySectionsAllImage) GetAlt() string { if o == nil { return "" } return o.Alt } func (o *GetLibrarySectionsAllImage) GetType() GetLibrarySectionsAllLibraryResponseType { if o == nil { return GetLibrarySectionsAllLibraryResponseType("") } return o.Type } func (o *GetLibrarySectionsAllImage) GetURL() string { if o == nil { return "" } return o.URL } type GetLibrarySectionsAllUltraBlurColors struct { TopLeft string `json:"topLeft"` TopRight string `json:"topRight"` BottomRight string `json:"bottomRight"` BottomLeft string `json:"bottomLeft"` } func (o *GetLibrarySectionsAllUltraBlurColors) GetTopLeft() string { if o == nil { return "" } return o.TopLeft } func (o *GetLibrarySectionsAllUltraBlurColors) GetTopRight() string { if o == nil { return "" } return o.TopRight } func (o *GetLibrarySectionsAllUltraBlurColors) GetBottomRight() string { if o == nil { return "" } return o.BottomRight } func (o *GetLibrarySectionsAllUltraBlurColors) GetBottomLeft() string { if o == nil { return "" } return o.BottomLeft } type GetLibrarySectionsAllGuids struct { // The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// // ID string `json:"id"` } func (o *GetLibrarySectionsAllGuids) GetID() string { if o == nil { return "" } return o.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"` Boolean *bool `queryParam:"inline"` 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, true); err == nil { u.GetLibrarySectionsAllOptimizedForStreaming1 = &getLibrarySectionsAllOptimizedForStreaming1 u.Type = GetLibrarySectionsAllOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreaming1 return nil } var boolean bool = false if err := utils.UnmarshalJSON(data, &boolean, "", true, true); 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"` Boolean *bool `queryParam:"inline"` 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, true); err == nil { u.GetLibrarySectionsAllOptimizedForStreamingLibrary1 = &getLibrarySectionsAllOptimizedForStreamingLibrary1 u.Type = GetLibrarySectionsAllLibraryOptimizedForStreamingTypeGetLibrarySectionsAllOptimizedForStreamingLibrary1 return nil } var boolean bool = false if err := utils.UnmarshalJSON(data, &boolean, "", true, true); 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, false); err != nil { return err } return nil } func (o *GetLibrarySectionsAllStream) GetID() int64 { if o == nil { return 0 } return o.ID } func (o *GetLibrarySectionsAllStream) GetStreamType() int64 { return 1 } func (o *GetLibrarySectionsAllStream) GetFormat() *string { if o == nil { return nil } return o.Format } func (o *GetLibrarySectionsAllStream) GetDefault() *bool { if o == nil { return nil } return o.Default } func (o *GetLibrarySectionsAllStream) GetCodec() string { if o == nil { return "" } return o.Codec } func (o *GetLibrarySectionsAllStream) GetIndex() *int { if o == nil { return nil } return o.Index } func (o *GetLibrarySectionsAllStream) GetBitrate() *int { if o == nil { return nil } return o.Bitrate } func (o *GetLibrarySectionsAllStream) GetLanguage() *string { if o == nil { return nil } return o.Language } func (o *GetLibrarySectionsAllStream) GetLanguageTag() *string { if o == nil { return nil } return o.LanguageTag } func (o *GetLibrarySectionsAllStream) GetLanguageCode() *string { if o == nil { return nil } return o.LanguageCode } func (o *GetLibrarySectionsAllStream) GetHeaderCompression() *bool { if o == nil { return nil } return o.HeaderCompression } func (o *GetLibrarySectionsAllStream) GetDOVIBLCompatID() *int { if o == nil { return nil } return o.DOVIBLCompatID } func (o *GetLibrarySectionsAllStream) GetDOVIBLPresent() *bool { if o == nil { return nil } return o.DOVIBLPresent } func (o *GetLibrarySectionsAllStream) GetDOVIELPresent() *bool { if o == nil { return nil } return o.DOVIELPresent } func (o *GetLibrarySectionsAllStream) GetDOVILevel() *int { if o == nil { return nil } return o.DOVILevel } func (o *GetLibrarySectionsAllStream) GetDOVIPresent() *bool { if o == nil { return nil } return o.DOVIPresent } func (o *GetLibrarySectionsAllStream) GetDOVIProfile() *int { if o == nil { return nil } return o.DOVIProfile } func (o *GetLibrarySectionsAllStream) GetDOVIRPUPresent() *bool { if o == nil { return nil } return o.DOVIRPUPresent } func (o *GetLibrarySectionsAllStream) GetDOVIVersion() *string { if o == nil { return nil } return o.DOVIVersion } func (o *GetLibrarySectionsAllStream) GetBitDepth() *int { if o == nil { return nil } return o.BitDepth } func (o *GetLibrarySectionsAllStream) GetChromaLocation() *string { if o == nil { return nil } return o.ChromaLocation } func (o *GetLibrarySectionsAllStream) GetChromaSubsampling() *string { if o == nil { return nil } return o.ChromaSubsampling } func (o *GetLibrarySectionsAllStream) GetCodedHeight() *int { if o == nil { return nil } return o.CodedHeight } func (o *GetLibrarySectionsAllStream) GetCodedWidth() *int { if o == nil { return nil } return o.CodedWidth } func (o *GetLibrarySectionsAllStream) GetClosedCaptions() *bool { if o == nil { return nil } return o.ClosedCaptions } func (o *GetLibrarySectionsAllStream) GetColorPrimaries() *string { if o == nil { return nil } return o.ColorPrimaries } func (o *GetLibrarySectionsAllStream) GetColorRange() *string { if o == nil { return nil } return o.ColorRange } func (o *GetLibrarySectionsAllStream) GetColorSpace() *string { if o == nil { return nil } return o.ColorSpace } func (o *GetLibrarySectionsAllStream) GetColorTrc() *string { if o == nil { return nil } return o.ColorTrc } func (o *GetLibrarySectionsAllStream) GetFrameRate() *float32 { if o == nil { return nil } return o.FrameRate } func (o *GetLibrarySectionsAllStream) GetKey() *string { if o == nil { return nil } return o.Key } func (o *GetLibrarySectionsAllStream) GetHeight() *int { if o == nil { return nil } return o.Height } func (o *GetLibrarySectionsAllStream) GetLevel() *int { if o == nil { return nil } return o.Level } func (o *GetLibrarySectionsAllStream) GetOriginal() *bool { if o == nil { return nil } return o.Original } func (o *GetLibrarySectionsAllStream) GetHasScalingMatrix() *bool { if o == nil { return nil } return o.HasScalingMatrix } func (o *GetLibrarySectionsAllStream) GetProfile() *string { if o == nil { return nil } return o.Profile } func (o *GetLibrarySectionsAllStream) GetScanType() *string { if o == nil { return nil } return o.ScanType } func (o *GetLibrarySectionsAllStream) GetEmbeddedInVideo() *string { if o == nil { return nil } return o.EmbeddedInVideo } func (o *GetLibrarySectionsAllStream) GetRefFrames() *int { if o == nil { return nil } return o.RefFrames } func (o *GetLibrarySectionsAllStream) GetWidth() *int { if o == nil { return nil } return o.Width } func (o *GetLibrarySectionsAllStream) GetDisplayTitle() string { if o == nil { return "" } return o.DisplayTitle } func (o *GetLibrarySectionsAllStream) GetExtendedDisplayTitle() string { if o == nil { return "" } return o.ExtendedDisplayTitle } func (o *GetLibrarySectionsAllStream) GetSelected() *bool { if o == nil { return nil } return o.Selected } func (o *GetLibrarySectionsAllStream) GetForced() *bool { if o == nil { return nil } return o.Forced } func (o *GetLibrarySectionsAllStream) GetChannels() *int { if o == nil { return nil } return o.Channels } func (o *GetLibrarySectionsAllStream) GetAudioChannelLayout() *string { if o == nil { return nil } return o.AudioChannelLayout } func (o *GetLibrarySectionsAllStream) GetSamplingRate() *int { if o == nil { return nil } return o.SamplingRate } func (o *GetLibrarySectionsAllStream) GetCanAutoSync() *bool { if o == nil { return nil } return o.CanAutoSync } func (o *GetLibrarySectionsAllStream) GetHearingImpaired() *bool { if o == nil { return nil } return o.HearingImpaired } func (o *GetLibrarySectionsAllStream) GetDub() *bool { if o == nil { return nil } return o.Dub } func (o *GetLibrarySectionsAllStream) GetTitle() *string { if o == nil { return nil } return o.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, false); err != nil { return err } return nil } func (o *GetLibrarySectionsAllPart) GetAccessible() *bool { if o == nil { return nil } return o.Accessible } func (o *GetLibrarySectionsAllPart) GetExists() *bool { if o == nil { return nil } return o.Exists } func (o *GetLibrarySectionsAllPart) GetID() int64 { if o == nil { return 0 } return o.ID } func (o *GetLibrarySectionsAllPart) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllPart) GetIndexes() *string { if o == nil { return nil } return o.Indexes } func (o *GetLibrarySectionsAllPart) GetDuration() *int { if o == nil { return nil } return o.Duration } func (o *GetLibrarySectionsAllPart) GetFile() string { if o == nil { return "" } return o.File } func (o *GetLibrarySectionsAllPart) GetSize() int64 { if o == nil { return 0 } return o.Size } func (o *GetLibrarySectionsAllPart) GetPacketLength() *int { if o == nil { return nil } return o.PacketLength } func (o *GetLibrarySectionsAllPart) GetContainer() *string { if o == nil { return nil } return o.Container } func (o *GetLibrarySectionsAllPart) GetVideoProfile() *string { if o == nil { return nil } return o.VideoProfile } func (o *GetLibrarySectionsAllPart) GetAudioProfile() *string { if o == nil { return nil } return o.AudioProfile } func (o *GetLibrarySectionsAllPart) GetHas64bitOffsets() *bool { if o == nil { return nil } return o.Has64bitOffsets } func (o *GetLibrarySectionsAllPart) GetOptimizedForStreaming() *GetLibrarySectionsAllLibraryOptimizedForStreaming { if o == nil { return nil } return o.OptimizedForStreaming } func (o *GetLibrarySectionsAllPart) GetHasThumbnail() *GetLibrarySectionsAllHasThumbnail { if o == nil { return nil } return o.HasThumbnail } func (o *GetLibrarySectionsAllPart) GetStream() []GetLibrarySectionsAllStream { if o == nil { return nil } return o.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 (o *GetLibrarySectionsAllMedia) GetID() int64 { if o == nil { return 0 } return o.ID } func (o *GetLibrarySectionsAllMedia) GetDuration() *int { if o == nil { return nil } return o.Duration } func (o *GetLibrarySectionsAllMedia) GetBitrate() *int { if o == nil { return nil } return o.Bitrate } func (o *GetLibrarySectionsAllMedia) GetWidth() *int { if o == nil { return nil } return o.Width } func (o *GetLibrarySectionsAllMedia) GetHeight() *int { if o == nil { return nil } return o.Height } func (o *GetLibrarySectionsAllMedia) GetAspectRatio() *float32 { if o == nil { return nil } return o.AspectRatio } func (o *GetLibrarySectionsAllMedia) GetAudioChannels() *int { if o == nil { return nil } return o.AudioChannels } func (o *GetLibrarySectionsAllMedia) GetDisplayOffset() *int { if o == nil { return nil } return o.DisplayOffset } func (o *GetLibrarySectionsAllMedia) GetAudioCodec() *string { if o == nil { return nil } return o.AudioCodec } func (o *GetLibrarySectionsAllMedia) GetVideoCodec() *string { if o == nil { return nil } return o.VideoCodec } func (o *GetLibrarySectionsAllMedia) GetVideoResolution() *string { if o == nil { return nil } return o.VideoResolution } func (o *GetLibrarySectionsAllMedia) GetContainer() *string { if o == nil { return nil } return o.Container } func (o *GetLibrarySectionsAllMedia) GetVideoFrameRate() *string { if o == nil { return nil } return o.VideoFrameRate } func (o *GetLibrarySectionsAllMedia) GetVideoProfile() *string { if o == nil { return nil } return o.VideoProfile } func (o *GetLibrarySectionsAllMedia) GetHasVoiceActivity() *bool { if o == nil { return nil } return o.HasVoiceActivity } func (o *GetLibrarySectionsAllMedia) GetAudioProfile() *string { if o == nil { return nil } return o.AudioProfile } func (o *GetLibrarySectionsAllMedia) GetOptimizedForStreaming() *GetLibrarySectionsAllOptimizedForStreaming { if o == nil { return nil } return o.OptimizedForStreaming } func (o *GetLibrarySectionsAllMedia) GetHas64bitOffsets() *bool { if o == nil { return nil } return o.Has64bitOffsets } func (o *GetLibrarySectionsAllMedia) GetPart() []GetLibrarySectionsAllPart { if o == nil { return nil } return o.Part } type GetLibrarySectionsAllGenre struct { // The genre name of this media-item // Tag string `json:"tag"` } func (o *GetLibrarySectionsAllGenre) GetTag() string { if o == nil { return "" } return o.Tag } type GetLibrarySectionsAllCountry struct { // The country of origin of this media item Tag string `json:"tag"` } func (o *GetLibrarySectionsAllCountry) GetTag() string { if o == nil { return "" } return o.Tag } type GetLibrarySectionsAllDirector struct { // The role of Director Tag string `json:"tag"` } func (o *GetLibrarySectionsAllDirector) GetTag() string { if o == nil { return "" } return o.Tag } type GetLibrarySectionsAllWriter struct { // The role of Writer Tag string `json:"tag"` } func (o *GetLibrarySectionsAllWriter) GetTag() string { if o == nil { return "" } return o.Tag } type GetLibrarySectionsAllRole struct { // The display tag for the actor (typically the actor's name). Tag string `json:"tag"` } func (o *GetLibrarySectionsAllRole) GetTag() string { if o == nil { return "" } return o.Tag } type GetLibrarySectionsAllCollection struct { // The user-made collection this media item belongs to Tag string `json:"tag"` } func (o *GetLibrarySectionsAllCollection) GetTag() string { if o == nil { return "" } return o.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, false); err != nil { return err } return nil } func (o *GetLibrarySectionsAllMetadata) GetRatingKey() string { if o == nil { return "" } return o.RatingKey } func (o *GetLibrarySectionsAllMetadata) GetKey() string { if o == nil { return "" } return o.Key } func (o *GetLibrarySectionsAllMetadata) GetGUID() string { if o == nil { return "" } return o.GUID } func (o *GetLibrarySectionsAllMetadata) GetSlug() string { if o == nil { return "" } return o.Slug } func (o *GetLibrarySectionsAllMetadata) GetStudio() *string { if o == nil { return nil } return o.Studio } func (o *GetLibrarySectionsAllMetadata) GetType() GetLibrarySectionsAllLibraryType { if o == nil { return GetLibrarySectionsAllLibraryType("") } return o.Type } func (o *GetLibrarySectionsAllMetadata) GetTitle() string { if o == nil { return "" } return o.Title } func (o *GetLibrarySectionsAllMetadata) GetTitleSort() string { if o == nil { return "" } return o.TitleSort } func (o *GetLibrarySectionsAllMetadata) GetContentRating() *string { if o == nil { return nil } return o.ContentRating } func (o *GetLibrarySectionsAllMetadata) GetSummary() string { if o == nil { return "" } return o.Summary } func (o *GetLibrarySectionsAllMetadata) GetRating() float32 { if o == nil { return 0.0 } return o.Rating } func (o *GetLibrarySectionsAllMetadata) GetAudienceRating() float64 { if o == nil { return 0.0 } return o.AudienceRating } func (o *GetLibrarySectionsAllMetadata) GetYear() *int { if o == nil { return nil } return o.Year } func (o *GetLibrarySectionsAllMetadata) GetTagline() string { if o == nil { return "" } return o.Tagline } func (o *GetLibrarySectionsAllMetadata) GetThumb() string { if o == nil { return "" } return o.Thumb } func (o *GetLibrarySectionsAllMetadata) GetArt() string { if o == nil { return "" } return o.Art } func (o *GetLibrarySectionsAllMetadata) GetTheme() string { if o == nil { return "" } return o.Theme } func (o *GetLibrarySectionsAllMetadata) GetIndex() int { if o == nil { return 0 } return o.Index } func (o *GetLibrarySectionsAllMetadata) GetLeafCount() *int { if o == nil { return nil } return o.LeafCount } func (o *GetLibrarySectionsAllMetadata) GetViewedLeafCount() *int { if o == nil { return nil } return o.ViewedLeafCount } func (o *GetLibrarySectionsAllMetadata) GetChildCount() int { if o == nil { return 0 } return o.ChildCount } func (o *GetLibrarySectionsAllMetadata) GetSeasonCount() int { if o == nil { return 0 } return o.SeasonCount } func (o *GetLibrarySectionsAllMetadata) GetDuration() int { if o == nil { return 0 } return o.Duration } func (o *GetLibrarySectionsAllMetadata) GetOriginallyAvailableAt() *types.Date { if o == nil { return nil } return o.OriginallyAvailableAt } func (o *GetLibrarySectionsAllMetadata) GetAddedAt() int64 { if o == nil { return 0 } return o.AddedAt } func (o *GetLibrarySectionsAllMetadata) GetUpdatedAt() *int64 { if o == nil { return nil } return o.UpdatedAt } func (o *GetLibrarySectionsAllMetadata) GetAudienceRatingImage() *string { if o == nil { return nil } return o.AudienceRatingImage } func (o *GetLibrarySectionsAllMetadata) GetChapterSource() *string { if o == nil { return nil } return o.ChapterSource } func (o *GetLibrarySectionsAllMetadata) GetPrimaryExtraKey() *string { if o == nil { return nil } return o.PrimaryExtraKey } func (o *GetLibrarySectionsAllMetadata) GetOriginalTitle() *string { if o == nil { return nil } return o.OriginalTitle } func (o *GetLibrarySectionsAllMetadata) GetParentRatingKey() *string { if o == nil { return nil } return o.ParentRatingKey } func (o *GetLibrarySectionsAllMetadata) GetGrandparentRatingKey() *string { if o == nil { return nil } return o.GrandparentRatingKey } func (o *GetLibrarySectionsAllMetadata) GetParentGUID() *string { if o == nil { return nil } return o.ParentGUID } func (o *GetLibrarySectionsAllMetadata) GetGrandparentGUID() *string { if o == nil { return nil } return o.GrandparentGUID } func (o *GetLibrarySectionsAllMetadata) GetGrandparentSlug() *string { if o == nil { return nil } return o.GrandparentSlug } func (o *GetLibrarySectionsAllMetadata) GetGrandparentKey() *string { if o == nil { return nil } return o.GrandparentKey } func (o *GetLibrarySectionsAllMetadata) GetParentKey() *string { if o == nil { return nil } return o.ParentKey } func (o *GetLibrarySectionsAllMetadata) GetGrandparentTitle() *string { if o == nil { return nil } return o.GrandparentTitle } func (o *GetLibrarySectionsAllMetadata) GetGrandparentThumb() *string { if o == nil { return nil } return o.GrandparentThumb } func (o *GetLibrarySectionsAllMetadata) GetGrandparentTheme() *string { if o == nil { return nil } return o.GrandparentTheme } func (o *GetLibrarySectionsAllMetadata) GetGrandparentArt() *string { if o == nil { return nil } return o.GrandparentArt } func (o *GetLibrarySectionsAllMetadata) GetParentTitle() *string { if o == nil { return nil } return o.ParentTitle } func (o *GetLibrarySectionsAllMetadata) GetParentIndex() *int { if o == nil { return nil } return o.ParentIndex } func (o *GetLibrarySectionsAllMetadata) GetParentThumb() *string { if o == nil { return nil } return o.ParentThumb } func (o *GetLibrarySectionsAllMetadata) GetRatingImage() *string { if o == nil { return nil } return o.RatingImage } func (o *GetLibrarySectionsAllMetadata) GetViewCount() *int { if o == nil { return nil } return o.ViewCount } func (o *GetLibrarySectionsAllMetadata) GetViewOffset() *int { if o == nil { return nil } return o.ViewOffset } func (o *GetLibrarySectionsAllMetadata) GetSkipCount() *int { if o == nil { return nil } return o.SkipCount } func (o *GetLibrarySectionsAllMetadata) GetSubtype() *string { if o == nil { return nil } return o.Subtype } func (o *GetLibrarySectionsAllMetadata) GetLastRatedAt() *int64 { if o == nil { return nil } return o.LastRatedAt } func (o *GetLibrarySectionsAllMetadata) GetCreatedAtAccuracy() *string { if o == nil { return nil } return o.CreatedAtAccuracy } func (o *GetLibrarySectionsAllMetadata) GetCreatedAtTZOffset() *string { if o == nil { return nil } return o.CreatedAtTZOffset } func (o *GetLibrarySectionsAllMetadata) GetLastViewedAt() *int { if o == nil { return nil } return o.LastViewedAt } func (o *GetLibrarySectionsAllMetadata) GetUserRating() *float32 { if o == nil { return nil } return o.UserRating } func (o *GetLibrarySectionsAllMetadata) GetImage() []GetLibrarySectionsAllImage { if o == nil { return nil } return o.Image } func (o *GetLibrarySectionsAllMetadata) GetUltraBlurColors() *GetLibrarySectionsAllUltraBlurColors { if o == nil { return nil } return o.UltraBlurColors } func (o *GetLibrarySectionsAllMetadata) GetGuids() []GetLibrarySectionsAllGuids { if o == nil { return nil } return o.Guids } func (o *GetLibrarySectionsAllMetadata) GetMedia() []GetLibrarySectionsAllMedia { if o == nil { return nil } return o.Media } func (o *GetLibrarySectionsAllMetadata) GetGenre() []GetLibrarySectionsAllGenre { if o == nil { return nil } return o.Genre } func (o *GetLibrarySectionsAllMetadata) GetCountry() []GetLibrarySectionsAllCountry { if o == nil { return nil } return o.Country } func (o *GetLibrarySectionsAllMetadata) GetDirector() []GetLibrarySectionsAllDirector { if o == nil { return nil } return o.Director } func (o *GetLibrarySectionsAllMetadata) GetWriter() []GetLibrarySectionsAllWriter { if o == nil { return nil } return o.Writer } func (o *GetLibrarySectionsAllMetadata) GetRole() []GetLibrarySectionsAllRole { if o == nil { return nil } return o.Role } func (o *GetLibrarySectionsAllMetadata) GetCollection() []GetLibrarySectionsAllCollection { if o == nil { return nil } return o.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 (o *GetLibrarySectionsAllMediaContainer) GetSize() int { if o == nil { return 0 } return o.Size } func (o *GetLibrarySectionsAllMediaContainer) GetTotalSize() int { if o == nil { return 0 } return o.TotalSize } func (o *GetLibrarySectionsAllMediaContainer) GetOffset() int64 { if o == nil { return 0 } return o.Offset } func (o *GetLibrarySectionsAllMediaContainer) GetAllowSync() bool { if o == nil { return false } return o.AllowSync } func (o *GetLibrarySectionsAllMediaContainer) GetArt() string { if o == nil { return "" } return o.Art } func (o *GetLibrarySectionsAllMediaContainer) GetContent() string { if o == nil { return "" } return o.Content } func (o *GetLibrarySectionsAllMediaContainer) GetIdentifier() string { if o == nil { return "" } return o.Identifier } func (o *GetLibrarySectionsAllMediaContainer) GetLibrarySectionID() *int64 { if o == nil { return nil } return o.LibrarySectionID } func (o *GetLibrarySectionsAllMediaContainer) GetLibrarySectionTitle() *string { if o == nil { return nil } return o.LibrarySectionTitle } func (o *GetLibrarySectionsAllMediaContainer) GetLibrarySectionUUID() *string { if o == nil { return nil } return o.LibrarySectionUUID } func (o *GetLibrarySectionsAllMediaContainer) GetMediaTagPrefix() string { if o == nil { return "" } return o.MediaTagPrefix } func (o *GetLibrarySectionsAllMediaContainer) GetMediaTagVersion() int64 { if o == nil { return 0 } return o.MediaTagVersion } func (o *GetLibrarySectionsAllMediaContainer) GetThumb() string { if o == nil { return "" } return o.Thumb } func (o *GetLibrarySectionsAllMediaContainer) GetNocache() bool { if o == nil { return false } return o.Nocache } func (o *GetLibrarySectionsAllMediaContainer) GetTitle1() string { if o == nil { return "" } return o.Title1 } func (o *GetLibrarySectionsAllMediaContainer) GetTitle2() string { if o == nil { return "" } return o.Title2 } func (o *GetLibrarySectionsAllMediaContainer) GetViewGroup() string { if o == nil { return "" } return o.ViewGroup } func (o *GetLibrarySectionsAllMediaContainer) GetMeta() *GetLibrarySectionsAllMeta { if o == nil { return nil } return o.Meta } func (o *GetLibrarySectionsAllMediaContainer) GetMetadata() []GetLibrarySectionsAllMetadata { if o == nil { return nil } return o.Metadata } // GetLibrarySectionsAllResponseBody - Successful response containing media container data. type GetLibrarySectionsAllResponseBody struct { MediaContainer *GetLibrarySectionsAllMediaContainer `json:"MediaContainer,omitempty"` } func (o *GetLibrarySectionsAllResponseBody) GetMediaContainer() *GetLibrarySectionsAllMediaContainer { if o == nil { return nil } return o.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 (o *GetLibrarySectionsAllResponse) GetContentType() string { if o == nil { return "" } return o.ContentType } func (o *GetLibrarySectionsAllResponse) GetStatusCode() int { if o == nil { return 0 } return o.StatusCode } func (o *GetLibrarySectionsAllResponse) GetRawResponse() *http.Response { if o == nil { return nil } return o.RawResponse } func (o *GetLibrarySectionsAllResponse) GetObject() *GetLibrarySectionsAllResponseBody { if o == nil { return nil } return o.Object }