mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
2756 lines
61 KiB
Go
2756 lines
61 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||
|
||
package operations
|
||
|
||
import (
|
||
"encoding/json"
|
||
"errors"
|
||
"fmt"
|
||
"github.com/LukeHagar/plexgo/internal/utils"
|
||
"github.com/LukeHagar/plexgo/types"
|
||
"net/http"
|
||
)
|
||
|
||
// Type - 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 Type int64
|
||
|
||
const (
|
||
TypeMovie Type = 1
|
||
TypeTvShow Type = 2
|
||
TypeSeason Type = 3
|
||
TypeEpisode Type = 4
|
||
TypeArtist Type = 5
|
||
TypeAlbum Type = 6
|
||
TypeTrack Type = 7
|
||
TypePhotoAlbum Type = 8
|
||
TypePhoto Type = 9
|
||
)
|
||
|
||
func (e Type) ToPointer() *Type {
|
||
return &e
|
||
}
|
||
|
||
// IncludeMeta - Adds the Meta object to the response
|
||
type IncludeMeta int
|
||
|
||
const (
|
||
IncludeMetaDisable IncludeMeta = 0
|
||
IncludeMetaEnable IncludeMeta = 1
|
||
)
|
||
|
||
func (e IncludeMeta) ToPointer() *IncludeMeta {
|
||
return &e
|
||
}
|
||
func (e *IncludeMeta) UnmarshalJSON(data []byte) error {
|
||
var v int
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case 0:
|
||
fallthrough
|
||
case 1:
|
||
*e = IncludeMeta(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for IncludeMeta: %v", v)
|
||
}
|
||
}
|
||
|
||
type GetRecentlyAddedRequest struct {
|
||
// The content directory ID.
|
||
ContentDirectoryID int64 `queryParam:"style=form,explode=true,name=contentDirectoryID"`
|
||
// Comma-separated list of pinned content directory IDs.
|
||
PinnedContentDirectoryID *string `queryParam:"style=form,explode=true,name=pinnedContentDirectoryID"`
|
||
// The library section ID for filtering content.
|
||
SectionID *int64 `queryParam:"style=form,explode=true,name=sectionID"`
|
||
// 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 Type `queryParam:"style=form,explode=true,name=type"`
|
||
// Adds the Meta object to the response
|
||
//
|
||
IncludeMeta *IncludeMeta `default:"0" queryParam:"style=form,explode=true,name=includeMeta"`
|
||
// 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 GetRecentlyAddedRequest) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(g, "", false)
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &g, "", false, []string{"contentDirectoryID", "type"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetContentDirectoryID() int64 {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.ContentDirectoryID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetPinnedContentDirectoryID() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.PinnedContentDirectoryID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetSectionID() *int64 {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.SectionID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetType() Type {
|
||
if g == nil {
|
||
return Type(0)
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetIncludeMeta() *IncludeMeta {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.IncludeMeta
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetXPlexContainerStart() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.XPlexContainerStart
|
||
}
|
||
|
||
func (g *GetRecentlyAddedRequest) GetXPlexContainerSize() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.XPlexContainerSize
|
||
}
|
||
|
||
type GetRecentlyAddedFilter 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 *GetRecentlyAddedFilter) GetFilter() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Filter
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFilter) GetFilterType() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.FilterType
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFilter) GetKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Key
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFilter) GetTitle() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Title
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFilter) GetType() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFilter) GetAdvanced() *bool {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Advanced
|
||
}
|
||
|
||
// GetRecentlyAddedActiveDirection - The direction of the sort. Can be either `asc` or `desc`.
|
||
type GetRecentlyAddedActiveDirection string
|
||
|
||
const (
|
||
GetRecentlyAddedActiveDirectionAscending GetRecentlyAddedActiveDirection = "asc"
|
||
GetRecentlyAddedActiveDirectionDescending GetRecentlyAddedActiveDirection = "desc"
|
||
)
|
||
|
||
func (e GetRecentlyAddedActiveDirection) ToPointer() *GetRecentlyAddedActiveDirection {
|
||
return &e
|
||
}
|
||
func (e *GetRecentlyAddedActiveDirection) 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 = GetRecentlyAddedActiveDirection(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for GetRecentlyAddedActiveDirection: %v", v)
|
||
}
|
||
}
|
||
|
||
// GetRecentlyAddedDefaultDirection - The direction of the sort. Can be either `asc` or `desc`.
|
||
type GetRecentlyAddedDefaultDirection string
|
||
|
||
const (
|
||
GetRecentlyAddedDefaultDirectionAscending GetRecentlyAddedDefaultDirection = "asc"
|
||
GetRecentlyAddedDefaultDirectionDescending GetRecentlyAddedDefaultDirection = "desc"
|
||
)
|
||
|
||
func (e GetRecentlyAddedDefaultDirection) ToPointer() *GetRecentlyAddedDefaultDirection {
|
||
return &e
|
||
}
|
||
func (e *GetRecentlyAddedDefaultDirection) 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 = GetRecentlyAddedDefaultDirection(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for GetRecentlyAddedDefaultDirection: %v", v)
|
||
}
|
||
}
|
||
|
||
type GetRecentlyAddedSort struct {
|
||
Default *string `json:"default,omitempty"`
|
||
Active *bool `json:"active,omitempty"`
|
||
// The direction of the sort. Can be either `asc` or `desc`.
|
||
//
|
||
ActiveDirection *GetRecentlyAddedActiveDirection `default:"asc" json:"activeDirection"`
|
||
// The direction of the sort. Can be either `asc` or `desc`.
|
||
//
|
||
DefaultDirection *GetRecentlyAddedDefaultDirection `default:"asc" json:"defaultDirection"`
|
||
DescKey *string `json:"descKey,omitempty"`
|
||
FirstCharacterKey *string `json:"firstCharacterKey,omitempty"`
|
||
Key string `json:"key"`
|
||
Title string `json:"title"`
|
||
}
|
||
|
||
func (g GetRecentlyAddedSort) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(g, "", false)
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &g, "", false, []string{"key", "title"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetDefault() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Default
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetActive() *bool {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Active
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetActiveDirection() *GetRecentlyAddedActiveDirection {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ActiveDirection
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetDefaultDirection() *GetRecentlyAddedDefaultDirection {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.DefaultDirection
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetDescKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.DescKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetFirstCharacterKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.FirstCharacterKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Key
|
||
}
|
||
|
||
func (g *GetRecentlyAddedSort) GetTitle() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Title
|
||
}
|
||
|
||
type GetRecentlyAddedField struct {
|
||
Key string `json:"key"`
|
||
Title string `json:"title"`
|
||
Type string `json:"type"`
|
||
SubType *string `json:"subType,omitempty"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedField) GetKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Key
|
||
}
|
||
|
||
func (g *GetRecentlyAddedField) GetTitle() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Title
|
||
}
|
||
|
||
func (g *GetRecentlyAddedField) GetType() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedField) GetSubType() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.SubType
|
||
}
|
||
|
||
type GetRecentlyAddedType struct {
|
||
Key string `json:"key"`
|
||
Type string `json:"type"`
|
||
Subtype *string `json:"subtype,omitempty"`
|
||
Title string `json:"title"`
|
||
Active bool `json:"active"`
|
||
Filter []GetRecentlyAddedFilter `json:"Filter,omitempty"`
|
||
Sort []GetRecentlyAddedSort `json:"Sort,omitempty"`
|
||
Field []GetRecentlyAddedField `json:"Field,omitempty"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Key
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetType() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetSubtype() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Subtype
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetTitle() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Title
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetActive() bool {
|
||
if g == nil {
|
||
return false
|
||
}
|
||
return g.Active
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetFilter() []GetRecentlyAddedFilter {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Filter
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetSort() []GetRecentlyAddedSort {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Sort
|
||
}
|
||
|
||
func (g *GetRecentlyAddedType) GetField() []GetRecentlyAddedField {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Field
|
||
}
|
||
|
||
type GetRecentlyAddedOperator struct {
|
||
Key string `json:"key"`
|
||
Title string `json:"title"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedOperator) GetKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Key
|
||
}
|
||
|
||
func (g *GetRecentlyAddedOperator) GetTitle() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Title
|
||
}
|
||
|
||
type GetRecentlyAddedFieldType struct {
|
||
Type string `json:"type"`
|
||
Operator []GetRecentlyAddedOperator `json:"Operator"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFieldType) GetType() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedFieldType) GetOperator() []GetRecentlyAddedOperator {
|
||
if g == nil {
|
||
return []GetRecentlyAddedOperator{}
|
||
}
|
||
return g.Operator
|
||
}
|
||
|
||
// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||
type Meta struct {
|
||
Type []GetRecentlyAddedType `json:"Type,omitempty"`
|
||
FieldType []GetRecentlyAddedFieldType `json:"FieldType,omitempty"`
|
||
}
|
||
|
||
func (m *Meta) GetType() []GetRecentlyAddedType {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Type
|
||
}
|
||
|
||
func (m *Meta) GetFieldType() []GetRecentlyAddedFieldType {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.FieldType
|
||
}
|
||
|
||
// GetRecentlyAddedHubsType - The type of media content in the Plex library. This can represent videos, music, or photos.
|
||
type GetRecentlyAddedHubsType string
|
||
|
||
const (
|
||
GetRecentlyAddedHubsTypeMovie GetRecentlyAddedHubsType = "movie"
|
||
GetRecentlyAddedHubsTypeTvShow GetRecentlyAddedHubsType = "show"
|
||
GetRecentlyAddedHubsTypeSeason GetRecentlyAddedHubsType = "season"
|
||
GetRecentlyAddedHubsTypeEpisode GetRecentlyAddedHubsType = "episode"
|
||
GetRecentlyAddedHubsTypeArtist GetRecentlyAddedHubsType = "artist"
|
||
GetRecentlyAddedHubsTypeAlbum GetRecentlyAddedHubsType = "album"
|
||
GetRecentlyAddedHubsTypeTrack GetRecentlyAddedHubsType = "track"
|
||
GetRecentlyAddedHubsTypePhotoAlbum GetRecentlyAddedHubsType = "photoalbum"
|
||
GetRecentlyAddedHubsTypePhoto GetRecentlyAddedHubsType = "photo"
|
||
GetRecentlyAddedHubsTypeCollection GetRecentlyAddedHubsType = "collection"
|
||
)
|
||
|
||
func (e GetRecentlyAddedHubsType) ToPointer() *GetRecentlyAddedHubsType {
|
||
return &e
|
||
}
|
||
|
||
type GetRecentlyAddedHubsResponseType string
|
||
|
||
const (
|
||
GetRecentlyAddedHubsResponseTypeCoverPoster GetRecentlyAddedHubsResponseType = "coverPoster"
|
||
GetRecentlyAddedHubsResponseTypeBackground GetRecentlyAddedHubsResponseType = "background"
|
||
GetRecentlyAddedHubsResponseTypeSnapshot GetRecentlyAddedHubsResponseType = "snapshot"
|
||
GetRecentlyAddedHubsResponseTypeClearLogo GetRecentlyAddedHubsResponseType = "clearLogo"
|
||
)
|
||
|
||
func (e GetRecentlyAddedHubsResponseType) ToPointer() *GetRecentlyAddedHubsResponseType {
|
||
return &e
|
||
}
|
||
|
||
type GetRecentlyAddedImage struct {
|
||
Alt string `json:"alt"`
|
||
Type GetRecentlyAddedHubsResponseType `json:"type"`
|
||
URL string `json:"url"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedImage) GetAlt() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Alt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedImage) GetType() GetRecentlyAddedHubsResponseType {
|
||
if g == nil {
|
||
return GetRecentlyAddedHubsResponseType("")
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedImage) GetURL() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.URL
|
||
}
|
||
|
||
type UltraBlurColors struct {
|
||
TopLeft string `json:"topLeft"`
|
||
TopRight string `json:"topRight"`
|
||
BottomRight string `json:"bottomRight"`
|
||
BottomLeft string `json:"bottomLeft"`
|
||
}
|
||
|
||
func (u *UltraBlurColors) GetTopLeft() string {
|
||
if u == nil {
|
||
return ""
|
||
}
|
||
return u.TopLeft
|
||
}
|
||
|
||
func (u *UltraBlurColors) GetTopRight() string {
|
||
if u == nil {
|
||
return ""
|
||
}
|
||
return u.TopRight
|
||
}
|
||
|
||
func (u *UltraBlurColors) GetBottomRight() string {
|
||
if u == nil {
|
||
return ""
|
||
}
|
||
return u.BottomRight
|
||
}
|
||
|
||
func (u *UltraBlurColors) GetBottomLeft() string {
|
||
if u == nil {
|
||
return ""
|
||
}
|
||
return u.BottomLeft
|
||
}
|
||
|
||
type Guids struct {
|
||
// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://
|
||
//
|
||
ID string `json:"id"`
|
||
}
|
||
|
||
func (g *Guids) GetID() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.ID
|
||
}
|
||
|
||
type One int
|
||
|
||
const (
|
||
OneZero One = 0
|
||
OneOne One = 1
|
||
)
|
||
|
||
func (e One) ToPointer() *One {
|
||
return &e
|
||
}
|
||
func (e *One) 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 = One(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for One: %v", v)
|
||
}
|
||
}
|
||
|
||
type OptimizedForStreamingType string
|
||
|
||
const (
|
||
OptimizedForStreamingTypeOne OptimizedForStreamingType = "1"
|
||
OptimizedForStreamingTypeBoolean OptimizedForStreamingType = "boolean"
|
||
)
|
||
|
||
// OptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||
type OptimizedForStreaming struct {
|
||
One *One `queryParam:"inline,name=optimizedForStreaming"`
|
||
Boolean *bool `queryParam:"inline,name=optimizedForStreaming"`
|
||
|
||
Type OptimizedForStreamingType
|
||
}
|
||
|
||
func CreateOptimizedForStreamingOne(one One) OptimizedForStreaming {
|
||
typ := OptimizedForStreamingTypeOne
|
||
|
||
return OptimizedForStreaming{
|
||
One: &one,
|
||
Type: typ,
|
||
}
|
||
}
|
||
|
||
func CreateOptimizedForStreamingBoolean(boolean bool) OptimizedForStreaming {
|
||
typ := OptimizedForStreamingTypeBoolean
|
||
|
||
return OptimizedForStreaming{
|
||
Boolean: &boolean,
|
||
Type: typ,
|
||
}
|
||
}
|
||
|
||
func (u *OptimizedForStreaming) UnmarshalJSON(data []byte) error {
|
||
|
||
var one One = One(0)
|
||
if err := utils.UnmarshalJSON(data, &one, "", true, nil); err == nil {
|
||
u.One = &one
|
||
u.Type = OptimizedForStreamingTypeOne
|
||
return nil
|
||
}
|
||
|
||
var boolean bool = false
|
||
if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil {
|
||
u.Boolean = &boolean
|
||
u.Type = OptimizedForStreamingTypeBoolean
|
||
return nil
|
||
}
|
||
|
||
return fmt.Errorf("could not unmarshal `%s` into any supported union types for OptimizedForStreaming", string(data))
|
||
}
|
||
|
||
func (u OptimizedForStreaming) MarshalJSON() ([]byte, error) {
|
||
if u.One != nil {
|
||
return utils.MarshalJSON(u.One, "", true)
|
||
}
|
||
|
||
if u.Boolean != nil {
|
||
return utils.MarshalJSON(u.Boolean, "", true)
|
||
}
|
||
|
||
return nil, errors.New("could not marshal union type OptimizedForStreaming: all fields are null")
|
||
}
|
||
|
||
type GetRecentlyAddedOptimizedForStreaming1 int
|
||
|
||
const (
|
||
GetRecentlyAddedOptimizedForStreaming1Zero GetRecentlyAddedOptimizedForStreaming1 = 0
|
||
GetRecentlyAddedOptimizedForStreaming1One GetRecentlyAddedOptimizedForStreaming1 = 1
|
||
)
|
||
|
||
func (e GetRecentlyAddedOptimizedForStreaming1) ToPointer() *GetRecentlyAddedOptimizedForStreaming1 {
|
||
return &e
|
||
}
|
||
func (e *GetRecentlyAddedOptimizedForStreaming1) 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 = GetRecentlyAddedOptimizedForStreaming1(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for GetRecentlyAddedOptimizedForStreaming1: %v", v)
|
||
}
|
||
}
|
||
|
||
type GetRecentlyAddedOptimizedForStreamingType string
|
||
|
||
const (
|
||
GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreamingType = "get-recently-added_optimizedForStreaming_1"
|
||
GetRecentlyAddedOptimizedForStreamingTypeBoolean GetRecentlyAddedOptimizedForStreamingType = "boolean"
|
||
)
|
||
|
||
// GetRecentlyAddedOptimizedForStreaming - Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||
type GetRecentlyAddedOptimizedForStreaming struct {
|
||
GetRecentlyAddedOptimizedForStreaming1 *GetRecentlyAddedOptimizedForStreaming1 `queryParam:"inline,name=optimizedForStreaming"`
|
||
Boolean *bool `queryParam:"inline,name=optimizedForStreaming"`
|
||
|
||
Type GetRecentlyAddedOptimizedForStreamingType
|
||
}
|
||
|
||
func CreateGetRecentlyAddedOptimizedForStreamingGetRecentlyAddedOptimizedForStreaming1(getRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreaming1) GetRecentlyAddedOptimizedForStreaming {
|
||
typ := GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1
|
||
|
||
return GetRecentlyAddedOptimizedForStreaming{
|
||
GetRecentlyAddedOptimizedForStreaming1: &getRecentlyAddedOptimizedForStreaming1,
|
||
Type: typ,
|
||
}
|
||
}
|
||
|
||
func CreateGetRecentlyAddedOptimizedForStreamingBoolean(boolean bool) GetRecentlyAddedOptimizedForStreaming {
|
||
typ := GetRecentlyAddedOptimizedForStreamingTypeBoolean
|
||
|
||
return GetRecentlyAddedOptimizedForStreaming{
|
||
Boolean: &boolean,
|
||
Type: typ,
|
||
}
|
||
}
|
||
|
||
func (u *GetRecentlyAddedOptimizedForStreaming) UnmarshalJSON(data []byte) error {
|
||
|
||
var getRecentlyAddedOptimizedForStreaming1 GetRecentlyAddedOptimizedForStreaming1 = GetRecentlyAddedOptimizedForStreaming1(0)
|
||
if err := utils.UnmarshalJSON(data, &getRecentlyAddedOptimizedForStreaming1, "", true, nil); err == nil {
|
||
u.GetRecentlyAddedOptimizedForStreaming1 = &getRecentlyAddedOptimizedForStreaming1
|
||
u.Type = GetRecentlyAddedOptimizedForStreamingTypeGetRecentlyAddedOptimizedForStreaming1
|
||
return nil
|
||
}
|
||
|
||
var boolean bool = false
|
||
if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil {
|
||
u.Boolean = &boolean
|
||
u.Type = GetRecentlyAddedOptimizedForStreamingTypeBoolean
|
||
return nil
|
||
}
|
||
|
||
return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetRecentlyAddedOptimizedForStreaming", string(data))
|
||
}
|
||
|
||
func (u GetRecentlyAddedOptimizedForStreaming) MarshalJSON() ([]byte, error) {
|
||
if u.GetRecentlyAddedOptimizedForStreaming1 != nil {
|
||
return utils.MarshalJSON(u.GetRecentlyAddedOptimizedForStreaming1, "", true)
|
||
}
|
||
|
||
if u.Boolean != nil {
|
||
return utils.MarshalJSON(u.Boolean, "", true)
|
||
}
|
||
|
||
return nil, errors.New("could not marshal union type GetRecentlyAddedOptimizedForStreaming: all fields are null")
|
||
}
|
||
|
||
// HasThumbnail - Indicates if the part has a thumbnail.
|
||
type HasThumbnail string
|
||
|
||
const (
|
||
HasThumbnailFalse HasThumbnail = "0"
|
||
HasThumbnailTrue HasThumbnail = "1"
|
||
)
|
||
|
||
func (e HasThumbnail) ToPointer() *HasThumbnail {
|
||
return &e
|
||
}
|
||
func (e *HasThumbnail) UnmarshalJSON(data []byte) error {
|
||
var v string
|
||
if err := json.Unmarshal(data, &v); err != nil {
|
||
return err
|
||
}
|
||
switch v {
|
||
case "0":
|
||
fallthrough
|
||
case "1":
|
||
*e = HasThumbnail(v)
|
||
return nil
|
||
default:
|
||
return fmt.Errorf("invalid value for HasThumbnail: %v", v)
|
||
}
|
||
}
|
||
|
||
type Stream 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 (s Stream) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(s, "", false)
|
||
}
|
||
|
||
func (s *Stream) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &s, "", false, []string{"id", "streamType", "codec", "displayTitle", "extendedDisplayTitle"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (s *Stream) GetID() int64 {
|
||
if s == nil {
|
||
return 0
|
||
}
|
||
return s.ID
|
||
}
|
||
|
||
func (s *Stream) GetStreamType() int64 {
|
||
return 1
|
||
}
|
||
|
||
func (s *Stream) GetFormat() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Format
|
||
}
|
||
|
||
func (s *Stream) GetDefault() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Default
|
||
}
|
||
|
||
func (s *Stream) GetCodec() string {
|
||
if s == nil {
|
||
return ""
|
||
}
|
||
return s.Codec
|
||
}
|
||
|
||
func (s *Stream) GetIndex() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Index
|
||
}
|
||
|
||
func (s *Stream) GetBitrate() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Bitrate
|
||
}
|
||
|
||
func (s *Stream) GetLanguage() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Language
|
||
}
|
||
|
||
func (s *Stream) GetLanguageTag() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.LanguageTag
|
||
}
|
||
|
||
func (s *Stream) GetLanguageCode() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.LanguageCode
|
||
}
|
||
|
||
func (s *Stream) GetHeaderCompression() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.HeaderCompression
|
||
}
|
||
|
||
func (s *Stream) GetDOVIBLCompatID() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIBLCompatID
|
||
}
|
||
|
||
func (s *Stream) GetDOVIBLPresent() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIBLPresent
|
||
}
|
||
|
||
func (s *Stream) GetDOVIELPresent() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIELPresent
|
||
}
|
||
|
||
func (s *Stream) GetDOVILevel() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVILevel
|
||
}
|
||
|
||
func (s *Stream) GetDOVIPresent() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIPresent
|
||
}
|
||
|
||
func (s *Stream) GetDOVIProfile() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIProfile
|
||
}
|
||
|
||
func (s *Stream) GetDOVIRPUPresent() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIRPUPresent
|
||
}
|
||
|
||
func (s *Stream) GetDOVIVersion() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.DOVIVersion
|
||
}
|
||
|
||
func (s *Stream) GetBitDepth() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.BitDepth
|
||
}
|
||
|
||
func (s *Stream) GetChromaLocation() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ChromaLocation
|
||
}
|
||
|
||
func (s *Stream) GetChromaSubsampling() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ChromaSubsampling
|
||
}
|
||
|
||
func (s *Stream) GetCodedHeight() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.CodedHeight
|
||
}
|
||
|
||
func (s *Stream) GetCodedWidth() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.CodedWidth
|
||
}
|
||
|
||
func (s *Stream) GetClosedCaptions() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ClosedCaptions
|
||
}
|
||
|
||
func (s *Stream) GetColorPrimaries() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ColorPrimaries
|
||
}
|
||
|
||
func (s *Stream) GetColorRange() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ColorRange
|
||
}
|
||
|
||
func (s *Stream) GetColorSpace() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ColorSpace
|
||
}
|
||
|
||
func (s *Stream) GetColorTrc() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ColorTrc
|
||
}
|
||
|
||
func (s *Stream) GetFrameRate() *float32 {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.FrameRate
|
||
}
|
||
|
||
func (s *Stream) GetKey() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Key
|
||
}
|
||
|
||
func (s *Stream) GetHeight() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Height
|
||
}
|
||
|
||
func (s *Stream) GetLevel() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Level
|
||
}
|
||
|
||
func (s *Stream) GetOriginal() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Original
|
||
}
|
||
|
||
func (s *Stream) GetHasScalingMatrix() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.HasScalingMatrix
|
||
}
|
||
|
||
func (s *Stream) GetProfile() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Profile
|
||
}
|
||
|
||
func (s *Stream) GetScanType() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.ScanType
|
||
}
|
||
|
||
func (s *Stream) GetEmbeddedInVideo() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.EmbeddedInVideo
|
||
}
|
||
|
||
func (s *Stream) GetRefFrames() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.RefFrames
|
||
}
|
||
|
||
func (s *Stream) GetWidth() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Width
|
||
}
|
||
|
||
func (s *Stream) GetDisplayTitle() string {
|
||
if s == nil {
|
||
return ""
|
||
}
|
||
return s.DisplayTitle
|
||
}
|
||
|
||
func (s *Stream) GetExtendedDisplayTitle() string {
|
||
if s == nil {
|
||
return ""
|
||
}
|
||
return s.ExtendedDisplayTitle
|
||
}
|
||
|
||
func (s *Stream) GetSelected() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Selected
|
||
}
|
||
|
||
func (s *Stream) GetForced() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Forced
|
||
}
|
||
|
||
func (s *Stream) GetChannels() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Channels
|
||
}
|
||
|
||
func (s *Stream) GetAudioChannelLayout() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.AudioChannelLayout
|
||
}
|
||
|
||
func (s *Stream) GetSamplingRate() *int {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.SamplingRate
|
||
}
|
||
|
||
func (s *Stream) GetCanAutoSync() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.CanAutoSync
|
||
}
|
||
|
||
func (s *Stream) GetHearingImpaired() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.HearingImpaired
|
||
}
|
||
|
||
func (s *Stream) GetDub() *bool {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Dub
|
||
}
|
||
|
||
func (s *Stream) GetTitle() *string {
|
||
if s == nil {
|
||
return nil
|
||
}
|
||
return s.Title
|
||
}
|
||
|
||
type Part 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 *GetRecentlyAddedOptimizedForStreaming `json:"optimizedForStreaming,omitempty"`
|
||
HasThumbnail *HasThumbnail `default:"0" json:"hasThumbnail"`
|
||
// An array of streams for this part.
|
||
Stream []Stream `json:"Stream,omitempty"`
|
||
}
|
||
|
||
func (p Part) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(p, "", false)
|
||
}
|
||
|
||
func (p *Part) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &p, "", false, []string{"id", "key", "file", "size"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (p *Part) GetAccessible() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Accessible
|
||
}
|
||
|
||
func (p *Part) GetExists() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Exists
|
||
}
|
||
|
||
func (p *Part) GetID() int64 {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.ID
|
||
}
|
||
|
||
func (p *Part) GetKey() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Key
|
||
}
|
||
|
||
func (p *Part) GetIndexes() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Indexes
|
||
}
|
||
|
||
func (p *Part) GetDuration() *int {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Duration
|
||
}
|
||
|
||
func (p *Part) GetFile() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.File
|
||
}
|
||
|
||
func (p *Part) GetSize() int64 {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.Size
|
||
}
|
||
|
||
func (p *Part) GetPacketLength() *int {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.PacketLength
|
||
}
|
||
|
||
func (p *Part) GetContainer() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Container
|
||
}
|
||
|
||
func (p *Part) GetVideoProfile() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.VideoProfile
|
||
}
|
||
|
||
func (p *Part) GetAudioProfile() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.AudioProfile
|
||
}
|
||
|
||
func (p *Part) GetHas64bitOffsets() *bool {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Has64bitOffsets
|
||
}
|
||
|
||
func (p *Part) GetOptimizedForStreaming() *GetRecentlyAddedOptimizedForStreaming {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.OptimizedForStreaming
|
||
}
|
||
|
||
func (p *Part) GetHasThumbnail() *HasThumbnail {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.HasThumbnail
|
||
}
|
||
|
||
func (p *Part) GetStream() []Stream {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Stream
|
||
}
|
||
|
||
type Media 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 *OptimizedForStreaming `json:"optimizedForStreaming,omitempty"`
|
||
Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"`
|
||
// An array of parts for this media item.
|
||
Part []Part `json:"Part,omitempty"`
|
||
}
|
||
|
||
func (m *Media) GetID() int64 {
|
||
if m == nil {
|
||
return 0
|
||
}
|
||
return m.ID
|
||
}
|
||
|
||
func (m *Media) GetDuration() *int {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Duration
|
||
}
|
||
|
||
func (m *Media) GetBitrate() *int {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Bitrate
|
||
}
|
||
|
||
func (m *Media) GetWidth() *int {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Width
|
||
}
|
||
|
||
func (m *Media) GetHeight() *int {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Height
|
||
}
|
||
|
||
func (m *Media) GetAspectRatio() *float32 {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.AspectRatio
|
||
}
|
||
|
||
func (m *Media) GetAudioChannels() *int {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.AudioChannels
|
||
}
|
||
|
||
func (m *Media) GetDisplayOffset() *int {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.DisplayOffset
|
||
}
|
||
|
||
func (m *Media) GetAudioCodec() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.AudioCodec
|
||
}
|
||
|
||
func (m *Media) GetVideoCodec() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.VideoCodec
|
||
}
|
||
|
||
func (m *Media) GetVideoResolution() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.VideoResolution
|
||
}
|
||
|
||
func (m *Media) GetContainer() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Container
|
||
}
|
||
|
||
func (m *Media) GetVideoFrameRate() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.VideoFrameRate
|
||
}
|
||
|
||
func (m *Media) GetVideoProfile() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.VideoProfile
|
||
}
|
||
|
||
func (m *Media) GetHasVoiceActivity() *bool {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.HasVoiceActivity
|
||
}
|
||
|
||
func (m *Media) GetAudioProfile() *string {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.AudioProfile
|
||
}
|
||
|
||
func (m *Media) GetOptimizedForStreaming() *OptimizedForStreaming {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.OptimizedForStreaming
|
||
}
|
||
|
||
func (m *Media) GetHas64bitOffsets() *bool {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Has64bitOffsets
|
||
}
|
||
|
||
func (m *Media) GetPart() []Part {
|
||
if m == nil {
|
||
return nil
|
||
}
|
||
return m.Part
|
||
}
|
||
|
||
// Genre - The filter query string for similar items.
|
||
type Genre struct {
|
||
// The unique identifier for the genre.
|
||
// NOTE: This is different for each Plex server and is not globally unique.
|
||
//
|
||
ID int `json:"id"`
|
||
Filter string `json:"filter"`
|
||
// The genre name of this media-item
|
||
//
|
||
Tag string `json:"tag"`
|
||
}
|
||
|
||
func (g *Genre) GetID() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.ID
|
||
}
|
||
|
||
func (g *Genre) GetFilter() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Filter
|
||
}
|
||
|
||
func (g *Genre) GetTag() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Tag
|
||
}
|
||
|
||
// Country - The filter query string for country media items.
|
||
type Country struct {
|
||
// The unique identifier for the country.
|
||
// NOTE: This is different for each Plex server and is not globally unique.
|
||
//
|
||
ID int `json:"id"`
|
||
// The country of origin of this media item
|
||
Tag string `json:"tag"`
|
||
Filter string `json:"filter"`
|
||
}
|
||
|
||
func (c *Country) GetID() int {
|
||
if c == nil {
|
||
return 0
|
||
}
|
||
return c.ID
|
||
}
|
||
|
||
func (c *Country) GetTag() string {
|
||
if c == nil {
|
||
return ""
|
||
}
|
||
return c.Tag
|
||
}
|
||
|
||
func (c *Country) GetFilter() string {
|
||
if c == nil {
|
||
return ""
|
||
}
|
||
return c.Filter
|
||
}
|
||
|
||
type Director struct {
|
||
// Unique identifier for the director.
|
||
ID int `json:"id"`
|
||
// The filter string used to query this director.
|
||
Filter string `json:"filter"`
|
||
// The role of Director
|
||
Tag string `json:"tag"`
|
||
// A unique 24-character hexadecimal key associated with the director's tag, used for internal identification.
|
||
TagKey string `json:"tagKey"`
|
||
// The absolute URL of the thumbnail image for the director.
|
||
Thumb *string `json:"thumb,omitempty"`
|
||
}
|
||
|
||
func (d *Director) GetID() int {
|
||
if d == nil {
|
||
return 0
|
||
}
|
||
return d.ID
|
||
}
|
||
|
||
func (d *Director) GetFilter() string {
|
||
if d == nil {
|
||
return ""
|
||
}
|
||
return d.Filter
|
||
}
|
||
|
||
func (d *Director) GetTag() string {
|
||
if d == nil {
|
||
return ""
|
||
}
|
||
return d.Tag
|
||
}
|
||
|
||
func (d *Director) GetTagKey() string {
|
||
if d == nil {
|
||
return ""
|
||
}
|
||
return d.TagKey
|
||
}
|
||
|
||
func (d *Director) GetThumb() *string {
|
||
if d == nil {
|
||
return nil
|
||
}
|
||
return d.Thumb
|
||
}
|
||
|
||
type Writer struct {
|
||
// Unique identifier for the writer.
|
||
ID int `json:"id"`
|
||
// The filter string used to query this writer.
|
||
Filter string `json:"filter"`
|
||
// The role of Writer
|
||
Tag string `json:"tag"`
|
||
// A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification.
|
||
TagKey *string `json:"tagKey,omitempty"`
|
||
// The absolute URL of the thumbnail image for the writer.
|
||
Thumb *string `json:"thumb,omitempty"`
|
||
}
|
||
|
||
func (w *Writer) GetID() int {
|
||
if w == nil {
|
||
return 0
|
||
}
|
||
return w.ID
|
||
}
|
||
|
||
func (w *Writer) GetFilter() string {
|
||
if w == nil {
|
||
return ""
|
||
}
|
||
return w.Filter
|
||
}
|
||
|
||
func (w *Writer) GetTag() string {
|
||
if w == nil {
|
||
return ""
|
||
}
|
||
return w.Tag
|
||
}
|
||
|
||
func (w *Writer) GetTagKey() *string {
|
||
if w == nil {
|
||
return nil
|
||
}
|
||
return w.TagKey
|
||
}
|
||
|
||
func (w *Writer) GetThumb() *string {
|
||
if w == nil {
|
||
return nil
|
||
}
|
||
return w.Thumb
|
||
}
|
||
|
||
type Role struct {
|
||
// The unique identifier for the role.
|
||
// NOTE: This is different for each Plex server and is not globally unique.
|
||
//
|
||
ID int `json:"id"`
|
||
// The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
|
||
Filter string `json:"filter"`
|
||
// The display tag for the actor (typically the actor's name).
|
||
Tag string `json:"tag"`
|
||
// A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification.
|
||
// NOTE: This is globally unique across all Plex Servers.
|
||
//
|
||
TagKey string `json:"tagKey"`
|
||
// The role played by the actor in the media item.
|
||
Role *string `json:"role,omitempty"`
|
||
// The absolute URL of the thumbnail image for the actor.
|
||
Thumb *string `json:"thumb,omitempty"`
|
||
}
|
||
|
||
func (r *Role) GetID() int {
|
||
if r == nil {
|
||
return 0
|
||
}
|
||
return r.ID
|
||
}
|
||
|
||
func (r *Role) GetFilter() string {
|
||
if r == nil {
|
||
return ""
|
||
}
|
||
return r.Filter
|
||
}
|
||
|
||
func (r *Role) GetTag() string {
|
||
if r == nil {
|
||
return ""
|
||
}
|
||
return r.Tag
|
||
}
|
||
|
||
func (r *Role) GetTagKey() string {
|
||
if r == nil {
|
||
return ""
|
||
}
|
||
return r.TagKey
|
||
}
|
||
|
||
func (r *Role) GetRole() *string {
|
||
if r == nil {
|
||
return nil
|
||
}
|
||
return r.Role
|
||
}
|
||
|
||
func (r *Role) GetThumb() *string {
|
||
if r == nil {
|
||
return nil
|
||
}
|
||
return r.Thumb
|
||
}
|
||
|
||
type Producer struct {
|
||
// Unique identifier for the producer.
|
||
ID int `json:"id"`
|
||
// The filter string used to query this producer.
|
||
Filter string `json:"filter"`
|
||
// The name of the producer
|
||
Tag string `json:"tag"`
|
||
// A 24-character hexadecimal unique key associated with the producer's tag, used for internal identification.
|
||
//
|
||
TagKey string `json:"tagKey"`
|
||
// The absolute URL of the thumbnail image for the producer.
|
||
Thumb *string `json:"thumb,omitempty"`
|
||
}
|
||
|
||
func (p *Producer) GetID() int {
|
||
if p == nil {
|
||
return 0
|
||
}
|
||
return p.ID
|
||
}
|
||
|
||
func (p *Producer) GetFilter() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Filter
|
||
}
|
||
|
||
func (p *Producer) GetTag() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.Tag
|
||
}
|
||
|
||
func (p *Producer) GetTagKey() string {
|
||
if p == nil {
|
||
return ""
|
||
}
|
||
return p.TagKey
|
||
}
|
||
|
||
func (p *Producer) GetThumb() *string {
|
||
if p == nil {
|
||
return nil
|
||
}
|
||
return p.Thumb
|
||
}
|
||
|
||
// Rating - The type of rating, for example 'audience' or 'critic'.
|
||
type Rating struct {
|
||
// The URL for the rating image, for example from IMDb.
|
||
Image string `json:"image"`
|
||
Value float32 `json:"value"`
|
||
Type string `json:"type"`
|
||
}
|
||
|
||
func (r *Rating) GetImage() string {
|
||
if r == nil {
|
||
return ""
|
||
}
|
||
return r.Image
|
||
}
|
||
|
||
func (r *Rating) GetValue() float32 {
|
||
if r == nil {
|
||
return 0.0
|
||
}
|
||
return r.Value
|
||
}
|
||
|
||
func (r *Rating) GetType() string {
|
||
if r == nil {
|
||
return ""
|
||
}
|
||
return r.Type
|
||
}
|
||
|
||
// Similar - The display tag for the similar item, typically the title.
|
||
type Similar struct {
|
||
ID int `json:"id"`
|
||
Filter string `json:"filter"`
|
||
Tag string `json:"tag"`
|
||
}
|
||
|
||
func (s *Similar) GetID() int {
|
||
if s == nil {
|
||
return 0
|
||
}
|
||
return s.ID
|
||
}
|
||
|
||
func (s *Similar) GetFilter() string {
|
||
if s == nil {
|
||
return ""
|
||
}
|
||
return s.Filter
|
||
}
|
||
|
||
func (s *Similar) GetTag() string {
|
||
if s == nil {
|
||
return ""
|
||
}
|
||
return s.Tag
|
||
}
|
||
|
||
// Location - The folder path for the media item.
|
||
type Location struct {
|
||
Path string `json:"path"`
|
||
}
|
||
|
||
func (l *Location) GetPath() string {
|
||
if l == nil {
|
||
return ""
|
||
}
|
||
return l.Path
|
||
}
|
||
|
||
type Collection struct {
|
||
// The user-made collection this media item belongs to
|
||
Tag string `json:"tag"`
|
||
}
|
||
|
||
func (c *Collection) GetTag() string {
|
||
if c == nil {
|
||
return ""
|
||
}
|
||
return c.Tag
|
||
}
|
||
|
||
// GetRecentlyAddedMetadata - Unknown
|
||
type GetRecentlyAddedMetadata struct {
|
||
AddedAt int64 `json:"addedAt"`
|
||
// The art image URL for the media item.
|
||
Art string `json:"art"`
|
||
// The URL for the audience rating image.
|
||
AudienceRatingImage *string `json:"audienceRatingImage,omitempty"`
|
||
// The audience rating for the media item.
|
||
AudienceRating float64 `json:"audienceRating"`
|
||
// The source from which chapter data is derived.
|
||
ChapterSource *string `json:"chapterSource,omitempty"`
|
||
// The number of child items associated with this media item.
|
||
ChildCount int `json:"childCount"`
|
||
// The content rating for the media item.
|
||
ContentRating *string `json:"contentRating,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"`
|
||
// The duration of the media item in milliseconds.
|
||
Duration int `json:"duration"`
|
||
// The art URL for the grandparent media item.
|
||
GrandparentArt *string `json:"grandparentArt,omitempty"`
|
||
// The GUID of the grandparent media item.
|
||
GrandparentGUID *string `json:"grandparentGuid,omitempty"`
|
||
// The key of the grandparent media item.
|
||
GrandparentKey *string `json:"grandparentKey,omitempty"`
|
||
// The rating key of the grandparent media item.
|
||
GrandparentRatingKey *string `json:"grandparentRatingKey,omitempty"`
|
||
// The slug for the grandparent media item.
|
||
GrandparentSlug *string `json:"grandparentSlug,omitempty"`
|
||
// The theme URL for the grandparent media item.
|
||
GrandparentTheme *string `json:"grandparentTheme,omitempty"`
|
||
// The thumbnail URL for the grandparent media item.
|
||
GrandparentThumb *string `json:"grandparentThumb,omitempty"`
|
||
// The title of the grandparent media item.
|
||
GrandparentTitle *string `json:"grandparentTitle,omitempty"`
|
||
// The globally unique identifier for the media item.
|
||
GUID string `json:"guid"`
|
||
// The index position of the media item.
|
||
Index int `json:"index"`
|
||
// The unique key for the media item.
|
||
Key string `json:"key"`
|
||
// The Unix timestamp representing the last time the item was rated.
|
||
LastRatedAt *int64 `json:"lastRatedAt,omitempty"`
|
||
// Unix timestamp for when the media item was last viewed.
|
||
LastViewedAt *int `json:"lastViewedAt,omitempty"`
|
||
// The number of leaf items (end nodes) under this media item.
|
||
LeafCount *int `json:"leafCount,omitempty"`
|
||
// The identifier for the library section.
|
||
LibrarySectionID *int64 `json:"librarySectionID,omitempty"`
|
||
// The key corresponding to the library section.
|
||
LibrarySectionKey *string `json:"librarySectionKey,omitempty"`
|
||
// The title of the library section.
|
||
LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"`
|
||
// The original title of the media item (if different).
|
||
OriginalTitle *string `json:"originalTitle,omitempty"`
|
||
// The original release date of the media item.
|
||
OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"`
|
||
// The GUID of the parent media item.
|
||
ParentGUID *string `json:"parentGuid,omitempty"`
|
||
// The index position of the parent media item.
|
||
ParentIndex *int `json:"parentIndex,omitempty"`
|
||
// The key of the parent media item.
|
||
ParentKey *string `json:"parentKey,omitempty"`
|
||
// The rating key of the parent media item.
|
||
ParentRatingKey *string `json:"parentRatingKey,omitempty"`
|
||
// The slug for the parent media item.
|
||
ParentSlug *string `json:"parentSlug,omitempty"`
|
||
// The studio of the parent media item.
|
||
ParentStudio string `json:"parentStudio"`
|
||
// The theme URL for the parent media item.
|
||
ParentTheme string `json:"parentTheme"`
|
||
// The thumbnail URL for the parent media item.
|
||
ParentThumb *string `json:"parentThumb,omitempty"`
|
||
// The title of the parent media item.
|
||
ParentTitle *string `json:"parentTitle,omitempty"`
|
||
// The release year of the parent media item.
|
||
ParentYear *int `json:"parentYear,omitempty"`
|
||
// The primary extra key associated with this media item.
|
||
PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"`
|
||
// The URL for the rating image.
|
||
RatingImage *string `json:"ratingImage,omitempty"`
|
||
// 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 critic rating for the media item.
|
||
Rating float32 `json:"rating"`
|
||
// The total number of seasons (for TV shows).
|
||
SeasonCount int `json:"seasonCount"`
|
||
// The number of times this media item has been skipped.
|
||
SkipCount *int `json:"skipCount,omitempty"`
|
||
// A URL‐friendly version of the media title.
|
||
Slug string `json:"slug"`
|
||
// The studio that produced the media item.
|
||
Studio *string `json:"studio,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"`
|
||
// A synopsis of the media item.
|
||
Summary string `json:"summary"`
|
||
// A brief tagline for the media item.
|
||
Tagline string `json:"tagline"`
|
||
// The theme URL for the media item.
|
||
Theme string `json:"theme"`
|
||
// The thumbnail image URL for the media item.
|
||
Thumb string `json:"thumb"`
|
||
// The sort title used for ordering media items.
|
||
TitleSort string `json:"titleSort"`
|
||
// The title of the media item.
|
||
Title string `json:"title"`
|
||
Type GetRecentlyAddedHubsType `json:"type"`
|
||
// Unix epoch datetime in seconds
|
||
UpdatedAt *int64 `json:"updatedAt,omitempty"`
|
||
// The rating provided by a user for the item. This value is expressed as a decimal number.
|
||
UserRating *float32 `json:"userRating,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 leaf items that have been viewed.
|
||
ViewedLeafCount *int `json:"viewedLeafCount,omitempty"`
|
||
// The release year of the media item.
|
||
Year *int `json:"year,omitempty"`
|
||
Image []GetRecentlyAddedImage `json:"Image,omitempty"`
|
||
UltraBlurColors *UltraBlurColors `json:"UltraBlurColors,omitempty"`
|
||
Guids []Guids `json:"Guid,omitempty"`
|
||
Media []Media `json:"Media,omitempty"`
|
||
Genre []Genre `json:"Genre,omitempty"`
|
||
Country []Country `json:"Country,omitempty"`
|
||
Director []Director `json:"Director,omitempty"`
|
||
Writer []Writer `json:"Writer,omitempty"`
|
||
Role []Role `json:"Role,omitempty"`
|
||
Producer []Producer `json:"Producer,omitempty"`
|
||
Rating1 []Rating `json:"Rating,omitempty"`
|
||
Similar []Similar `json:"Similar,omitempty"`
|
||
Location []Location `json:"Location,omitempty"`
|
||
Collection []Collection `json:"Collection,omitempty"`
|
||
}
|
||
|
||
func (g GetRecentlyAddedMetadata) MarshalJSON() ([]byte, error) {
|
||
return utils.MarshalJSON(g, "", false)
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) UnmarshalJSON(data []byte) error {
|
||
if err := utils.UnmarshalJSON(data, &g, "", false, []string{"addedAt", "art", "audienceRating", "childCount", "duration", "guid", "index", "key", "parentStudio", "parentTheme", "ratingKey", "rating", "seasonCount", "slug", "summary", "tagline", "theme", "thumb", "titleSort", "title", "type"}); err != nil {
|
||
return err
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetAddedAt() int64 {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.AddedAt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetArt() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Art
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetAudienceRatingImage() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.AudienceRatingImage
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetAudienceRating() float64 {
|
||
if g == nil {
|
||
return 0.0
|
||
}
|
||
return g.AudienceRating
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetChapterSource() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ChapterSource
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetChildCount() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.ChildCount
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetContentRating() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ContentRating
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetCreatedAtAccuracy() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.CreatedAtAccuracy
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetCreatedAtTZOffset() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.CreatedAtTZOffset
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetDuration() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.Duration
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentArt() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentArt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentGUID() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentGUID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentRatingKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentRatingKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentSlug() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentSlug
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentTheme() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentTheme
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentThumb() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentThumb
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGrandparentTitle() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.GrandparentTitle
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGUID() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.GUID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetIndex() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.Index
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Key
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLastRatedAt() *int64 {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.LastRatedAt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLastViewedAt() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.LastViewedAt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLeafCount() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.LeafCount
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLibrarySectionID() *int64 {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.LibrarySectionID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLibrarySectionKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.LibrarySectionKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLibrarySectionTitle() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.LibrarySectionTitle
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetOriginalTitle() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.OriginalTitle
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetOriginallyAvailableAt() *types.Date {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.OriginallyAvailableAt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentGUID() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentGUID
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentIndex() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentIndex
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentRatingKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentRatingKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentSlug() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentSlug
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentStudio() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.ParentStudio
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentTheme() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.ParentTheme
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentThumb() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentThumb
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentTitle() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentTitle
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetParentYear() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ParentYear
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetPrimaryExtraKey() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.PrimaryExtraKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetRatingImage() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.RatingImage
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetRatingKey() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.RatingKey
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetRating() float32 {
|
||
if g == nil {
|
||
return 0.0
|
||
}
|
||
return g.Rating
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetSeasonCount() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.SeasonCount
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetSkipCount() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.SkipCount
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetSlug() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Slug
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetStudio() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Studio
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetSubtype() *string {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Subtype
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetSummary() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Summary
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetTagline() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Tagline
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetTheme() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Theme
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetThumb() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Thumb
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetTitleSort() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.TitleSort
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetTitle() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Title
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetType() GetRecentlyAddedHubsType {
|
||
if g == nil {
|
||
return GetRecentlyAddedHubsType("")
|
||
}
|
||
return g.Type
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetUpdatedAt() *int64 {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.UpdatedAt
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetUserRating() *float32 {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.UserRating
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetViewCount() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ViewCount
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetViewOffset() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ViewOffset
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetViewedLeafCount() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.ViewedLeafCount
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetYear() *int {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Year
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetImage() []GetRecentlyAddedImage {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Image
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetUltraBlurColors() *UltraBlurColors {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.UltraBlurColors
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGuids() []Guids {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Guids
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetMedia() []Media {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Media
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetGenre() []Genre {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Genre
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetCountry() []Country {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Country
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetDirector() []Director {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Director
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetWriter() []Writer {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Writer
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetRole() []Role {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Role
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetProducer() []Producer {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Producer
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetRating1() []Rating {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Rating1
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetSimilar() []Similar {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Similar
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetLocation() []Location {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Location
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMetadata) GetCollection() []Collection {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Collection
|
||
}
|
||
|
||
type GetRecentlyAddedMediaContainer 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"`
|
||
// An plugin identifier for the media container.
|
||
Identifier string `json:"identifier"`
|
||
// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
|
||
//
|
||
Meta *Meta `json:"Meta,omitempty"`
|
||
// An array of metadata items.
|
||
Metadata []GetRecentlyAddedMetadata `json:"Metadata,omitempty"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetSize() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.Size
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetTotalSize() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.TotalSize
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetOffset() int64 {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.Offset
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetAllowSync() bool {
|
||
if g == nil {
|
||
return false
|
||
}
|
||
return g.AllowSync
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetIdentifier() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.Identifier
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetMeta() *Meta {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Meta
|
||
}
|
||
|
||
func (g *GetRecentlyAddedMediaContainer) GetMetadata() []GetRecentlyAddedMetadata {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Metadata
|
||
}
|
||
|
||
// GetRecentlyAddedResponseBody - A successful response with recently added content.
|
||
type GetRecentlyAddedResponseBody struct {
|
||
MediaContainer *GetRecentlyAddedMediaContainer `json:"MediaContainer,omitempty"`
|
||
}
|
||
|
||
func (g *GetRecentlyAddedResponseBody) GetMediaContainer() *GetRecentlyAddedMediaContainer {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.MediaContainer
|
||
}
|
||
|
||
type GetRecentlyAddedResponse 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
|
||
// A successful response with recently added content.
|
||
Object *GetRecentlyAddedResponseBody
|
||
}
|
||
|
||
func (g *GetRecentlyAddedResponse) GetContentType() string {
|
||
if g == nil {
|
||
return ""
|
||
}
|
||
return g.ContentType
|
||
}
|
||
|
||
func (g *GetRecentlyAddedResponse) GetStatusCode() int {
|
||
if g == nil {
|
||
return 0
|
||
}
|
||
return g.StatusCode
|
||
}
|
||
|
||
func (g *GetRecentlyAddedResponse) GetRawResponse() *http.Response {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.RawResponse
|
||
}
|
||
|
||
func (g *GetRecentlyAddedResponse) GetObject() *GetRecentlyAddedResponseBody {
|
||
if g == nil {
|
||
return nil
|
||
}
|
||
return g.Object
|
||
}
|