// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations import ( "encoding/json" "fmt" "github.com/LukeHagar/plexgo/internal/utils" "github.com/LukeHagar/plexgo/types" "net/http" ) var GetWatchListServerList = []string{ "https://discover.provider.plex.tv", } // Filter type Filter string const ( FilterAll Filter = "all" FilterAvailable Filter = "available" FilterReleased Filter = "released" ) func (e Filter) ToPointer() *Filter { return &e } // Libtype - The type of library to filter. Can be "movie" or "show", or all if not present. type Libtype string const ( LibtypeMovie Libtype = "movie" LibtypeShow Libtype = "show" ) func (e Libtype) ToPointer() *Libtype { return &e } // IncludeCollections - include collections in the results type IncludeCollections int64 const ( IncludeCollectionsOne IncludeCollections = 1 IncludeCollectionsZero IncludeCollections = 0 ) func (e IncludeCollections) ToPointer() *IncludeCollections { return &e } func (e *IncludeCollections) UnmarshalJSON(data []byte) error { var v int64 if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case 1: fallthrough case 0: *e = IncludeCollections(v) return nil default: return fmt.Errorf("invalid value for IncludeCollections: %v", v) } } // IncludeExternalMedia - include external media in the results type IncludeExternalMedia int64 const ( IncludeExternalMediaOne IncludeExternalMedia = 1 IncludeExternalMediaZero IncludeExternalMedia = 0 ) func (e IncludeExternalMedia) ToPointer() *IncludeExternalMedia { return &e } func (e *IncludeExternalMedia) UnmarshalJSON(data []byte) error { var v int64 if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case 1: fallthrough case 0: *e = IncludeExternalMedia(v) return nil default: return fmt.Errorf("invalid value for IncludeExternalMedia: %v", v) } } type GetWatchListRequest struct { // Filter Filter Filter `pathParam:"style=simple,explode=false,name=filter"` // In the format "field:dir". Available fields are "watchlistedAt" (Added At), // "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). // "dir" can be "asc" or "desc" // Sort *string `queryParam:"style=form,explode=true,name=sort"` // The type of library to filter. Can be "movie" or "show", or all if not present. // Libtype *Libtype `queryParam:"style=form,explode=true,name=libtype"` // 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. // Maxresults *int `queryParam:"style=form,explode=true,name=maxresults"` // include collections in the results // IncludeCollections *IncludeCollections `queryParam:"style=form,explode=true,name=includeCollections"` // include external media in the results // IncludeExternalMedia *IncludeExternalMedia `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"` // An authentication token, obtained from plex.tv XPlexToken string `header:"style=simple,explode=false,name=X-Plex-Token"` } func (g GetWatchListRequest) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetWatchListRequest) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"filter", "X-Plex-Token"}); err != nil { return err } return nil } func (o *GetWatchListRequest) GetFilter() Filter { if o == nil { return Filter("") } return o.Filter } func (o *GetWatchListRequest) GetSort() *string { if o == nil { return nil } return o.Sort } func (o *GetWatchListRequest) GetLibtype() *Libtype { if o == nil { return nil } return o.Libtype } func (o *GetWatchListRequest) GetMaxresults() *int { if o == nil { return nil } return o.Maxresults } func (o *GetWatchListRequest) GetIncludeCollections() *IncludeCollections { if o == nil { return nil } return o.IncludeCollections } func (o *GetWatchListRequest) GetIncludeExternalMedia() *IncludeExternalMedia { if o == nil { return nil } return o.IncludeExternalMedia } func (o *GetWatchListRequest) GetXPlexContainerStart() *int { if o == nil { return nil } return o.XPlexContainerStart } func (o *GetWatchListRequest) GetXPlexContainerSize() *int { if o == nil { return nil } return o.XPlexContainerSize } func (o *GetWatchListRequest) GetXPlexToken() string { if o == nil { return "" } return o.XPlexToken } type Image struct { Alt *string `json:"alt,omitempty"` Type *string `json:"type,omitempty"` URL *string `json:"url,omitempty"` } func (o *Image) GetAlt() *string { if o == nil { return nil } return o.Alt } func (o *Image) GetType() *string { if o == nil { return nil } return o.Type } func (o *Image) GetURL() *string { if o == nil { return nil } return o.URL } type Metadata struct { Art *string `json:"art,omitempty"` GUID *string `json:"guid,omitempty"` Key *string `json:"key,omitempty"` RatingKey *string `json:"ratingKey,omitempty"` Studio *string `json:"studio,omitempty"` Tagline *string `json:"tagline,omitempty"` Type *string `json:"type,omitempty"` Thumb *string `json:"thumb,omitempty"` AddedAt *int `json:"addedAt,omitempty"` Duration *int `json:"duration,omitempty"` PublicPagesURL *string `json:"publicPagesURL,omitempty"` Slug *string `json:"slug,omitempty"` UserState *bool `json:"userState,omitempty"` Title *string `json:"title,omitempty"` ContentRating *string `json:"contentRating,omitempty"` OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` Year *int `json:"year,omitempty"` Image []Image `json:"Image,omitempty"` Banner *string `json:"banner,omitempty"` Rating *float64 `json:"rating,omitempty"` ExpiresAt *int `json:"expiresAt,omitempty"` OriginalTitle *string `json:"originalTitle,omitempty"` AudienceRating *float64 `json:"audienceRating,omitempty"` AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` RatingImage *string `json:"ratingImage,omitempty"` ImdbRatingCount *int `json:"imdbRatingCount,omitempty"` Subtype *string `json:"subtype,omitempty"` Theme *string `json:"theme,omitempty"` LeafCount *int `json:"leafCount,omitempty"` ChildCount *int `json:"childCount,omitempty"` IsContinuingSeries *bool `json:"isContinuingSeries,omitempty"` SkipChildren *bool `json:"skipChildren,omitempty"` AvailabilityID *string `json:"availabilityId,omitempty"` StreamingMediaID *string `json:"streamingMediaId,omitempty"` PlayableKey *string `json:"playableKey,omitempty"` } func (m Metadata) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(m, "", false) } func (m *Metadata) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { return err } return nil } func (o *Metadata) GetArt() *string { if o == nil { return nil } return o.Art } func (o *Metadata) GetGUID() *string { if o == nil { return nil } return o.GUID } func (o *Metadata) GetKey() *string { if o == nil { return nil } return o.Key } func (o *Metadata) GetRatingKey() *string { if o == nil { return nil } return o.RatingKey } func (o *Metadata) GetStudio() *string { if o == nil { return nil } return o.Studio } func (o *Metadata) GetTagline() *string { if o == nil { return nil } return o.Tagline } func (o *Metadata) GetType() *string { if o == nil { return nil } return o.Type } func (o *Metadata) GetThumb() *string { if o == nil { return nil } return o.Thumb } func (o *Metadata) GetAddedAt() *int { if o == nil { return nil } return o.AddedAt } func (o *Metadata) GetDuration() *int { if o == nil { return nil } return o.Duration } func (o *Metadata) GetPublicPagesURL() *string { if o == nil { return nil } return o.PublicPagesURL } func (o *Metadata) GetSlug() *string { if o == nil { return nil } return o.Slug } func (o *Metadata) GetUserState() *bool { if o == nil { return nil } return o.UserState } func (o *Metadata) GetTitle() *string { if o == nil { return nil } return o.Title } func (o *Metadata) GetContentRating() *string { if o == nil { return nil } return o.ContentRating } func (o *Metadata) GetOriginallyAvailableAt() *types.Date { if o == nil { return nil } return o.OriginallyAvailableAt } func (o *Metadata) GetYear() *int { if o == nil { return nil } return o.Year } func (o *Metadata) GetImage() []Image { if o == nil { return nil } return o.Image } func (o *Metadata) GetBanner() *string { if o == nil { return nil } return o.Banner } func (o *Metadata) GetRating() *float64 { if o == nil { return nil } return o.Rating } func (o *Metadata) GetExpiresAt() *int { if o == nil { return nil } return o.ExpiresAt } func (o *Metadata) GetOriginalTitle() *string { if o == nil { return nil } return o.OriginalTitle } func (o *Metadata) GetAudienceRating() *float64 { if o == nil { return nil } return o.AudienceRating } func (o *Metadata) GetAudienceRatingImage() *string { if o == nil { return nil } return o.AudienceRatingImage } func (o *Metadata) GetRatingImage() *string { if o == nil { return nil } return o.RatingImage } func (o *Metadata) GetImdbRatingCount() *int { if o == nil { return nil } return o.ImdbRatingCount } func (o *Metadata) GetSubtype() *string { if o == nil { return nil } return o.Subtype } func (o *Metadata) GetTheme() *string { if o == nil { return nil } return o.Theme } func (o *Metadata) GetLeafCount() *int { if o == nil { return nil } return o.LeafCount } func (o *Metadata) GetChildCount() *int { if o == nil { return nil } return o.ChildCount } func (o *Metadata) GetIsContinuingSeries() *bool { if o == nil { return nil } return o.IsContinuingSeries } func (o *Metadata) GetSkipChildren() *bool { if o == nil { return nil } return o.SkipChildren } func (o *Metadata) GetAvailabilityID() *string { if o == nil { return nil } return o.AvailabilityID } func (o *Metadata) GetStreamingMediaID() *string { if o == nil { return nil } return o.StreamingMediaID } func (o *Metadata) GetPlayableKey() *string { if o == nil { return nil } return o.PlayableKey } // GetWatchListResponseBody - Watchlist Data type GetWatchListResponseBody struct { LibrarySectionID *string `json:"librarySectionID,omitempty"` LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` Offset *int `json:"offset,omitempty"` TotalSize *int `json:"totalSize,omitempty"` Identifier *string `json:"identifier,omitempty"` Size *int `json:"size,omitempty"` Metadata []Metadata `json:"Metadata,omitempty"` } func (o *GetWatchListResponseBody) GetLibrarySectionID() *string { if o == nil { return nil } return o.LibrarySectionID } func (o *GetWatchListResponseBody) GetLibrarySectionTitle() *string { if o == nil { return nil } return o.LibrarySectionTitle } func (o *GetWatchListResponseBody) GetOffset() *int { if o == nil { return nil } return o.Offset } func (o *GetWatchListResponseBody) GetTotalSize() *int { if o == nil { return nil } return o.TotalSize } func (o *GetWatchListResponseBody) GetIdentifier() *string { if o == nil { return nil } return o.Identifier } func (o *GetWatchListResponseBody) GetSize() *int { if o == nil { return nil } return o.Size } func (o *GetWatchListResponseBody) GetMetadata() []Metadata { if o == nil { return nil } return o.Metadata } type GetWatchListResponse 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 // Watchlist Data Object *GetWatchListResponseBody } func (o *GetWatchListResponse) GetContentType() string { if o == nil { return "" } return o.ContentType } func (o *GetWatchListResponse) GetStatusCode() int { if o == nil { return 0 } return o.StatusCode } func (o *GetWatchListResponse) GetRawResponse() *http.Response { if o == nil { return nil } return o.RawResponse } func (o *GetWatchListResponse) GetObject() *GetWatchListResponseBody { if o == nil { return nil } return o.Object }