// 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" ) // GetTopWatchedContentQueryParamType - 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 GetTopWatchedContentQueryParamType int64 const ( GetTopWatchedContentQueryParamTypeMovie GetTopWatchedContentQueryParamType = 1 GetTopWatchedContentQueryParamTypeTvShow GetTopWatchedContentQueryParamType = 2 GetTopWatchedContentQueryParamTypeSeason GetTopWatchedContentQueryParamType = 3 GetTopWatchedContentQueryParamTypeEpisode GetTopWatchedContentQueryParamType = 4 GetTopWatchedContentQueryParamTypeArtist GetTopWatchedContentQueryParamType = 5 GetTopWatchedContentQueryParamTypeAlbum GetTopWatchedContentQueryParamType = 6 GetTopWatchedContentQueryParamTypeTrack GetTopWatchedContentQueryParamType = 7 GetTopWatchedContentQueryParamTypePhotoAlbum GetTopWatchedContentQueryParamType = 8 GetTopWatchedContentQueryParamTypePhoto GetTopWatchedContentQueryParamType = 9 ) func (e GetTopWatchedContentQueryParamType) ToPointer() *GetTopWatchedContentQueryParamType { return &e } // GetTopWatchedContentQueryParamIncludeGuids - Adds the Guid object to the response type GetTopWatchedContentQueryParamIncludeGuids int const ( GetTopWatchedContentQueryParamIncludeGuidsDisable GetTopWatchedContentQueryParamIncludeGuids = 0 GetTopWatchedContentQueryParamIncludeGuidsEnable GetTopWatchedContentQueryParamIncludeGuids = 1 ) func (e GetTopWatchedContentQueryParamIncludeGuids) ToPointer() *GetTopWatchedContentQueryParamIncludeGuids { return &e } func (e *GetTopWatchedContentQueryParamIncludeGuids) 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 = GetTopWatchedContentQueryParamIncludeGuids(v) return nil default: return fmt.Errorf("invalid value for GetTopWatchedContentQueryParamIncludeGuids: %v", v) } } type GetTopWatchedContentRequest struct { // 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 GetTopWatchedContentQueryParamType `queryParam:"style=form,explode=true,name=type"` // Adds the Guid object to the response // IncludeGuids *GetTopWatchedContentQueryParamIncludeGuids `default:"0" queryParam:"style=form,explode=true,name=includeGuids"` } func (g GetTopWatchedContentRequest) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetTopWatchedContentRequest) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"type"}); err != nil { return err } return nil } func (g *GetTopWatchedContentRequest) GetType() GetTopWatchedContentQueryParamType { if g == nil { return GetTopWatchedContentQueryParamType(0) } return g.Type } func (g *GetTopWatchedContentRequest) GetIncludeGuids() *GetTopWatchedContentQueryParamIncludeGuids { if g == nil { return nil } return g.IncludeGuids } type GetTopWatchedContentGenre struct { ID *int `json:"id,omitempty"` Filter *string `json:"filter,omitempty"` Tag *string `json:"tag,omitempty"` } func (g *GetTopWatchedContentGenre) GetID() *int { if g == nil { return nil } return g.ID } func (g *GetTopWatchedContentGenre) GetFilter() *string { if g == nil { return nil } return g.Filter } func (g *GetTopWatchedContentGenre) GetTag() *string { if g == nil { return nil } return g.Tag } type GetTopWatchedContentCountry struct { ID *int `json:"id,omitempty"` Filter *string `json:"filter,omitempty"` Tag *string `json:"tag,omitempty"` } func (g *GetTopWatchedContentCountry) GetID() *int { if g == nil { return nil } return g.ID } func (g *GetTopWatchedContentCountry) GetFilter() *string { if g == nil { return nil } return g.Filter } func (g *GetTopWatchedContentCountry) GetTag() *string { if g == nil { return nil } return g.Tag } type GetTopWatchedContentGuids struct { ID *string `json:"id,omitempty"` } func (g *GetTopWatchedContentGuids) GetID() *string { if g == nil { return nil } return g.ID } type GetTopWatchedContentRole struct { ID *int `json:"id,omitempty"` Filter *string `json:"filter,omitempty"` Tag *string `json:"tag,omitempty"` TagKey *string `json:"tagKey,omitempty"` Role *string `json:"role,omitempty"` Thumb *string `json:"thumb,omitempty"` } func (g *GetTopWatchedContentRole) GetID() *int { if g == nil { return nil } return g.ID } func (g *GetTopWatchedContentRole) GetFilter() *string { if g == nil { return nil } return g.Filter } func (g *GetTopWatchedContentRole) GetTag() *string { if g == nil { return nil } return g.Tag } func (g *GetTopWatchedContentRole) GetTagKey() *string { if g == nil { return nil } return g.TagKey } func (g *GetTopWatchedContentRole) GetRole() *string { if g == nil { return nil } return g.Role } func (g *GetTopWatchedContentRole) GetThumb() *string { if g == nil { return nil } return g.Thumb } type GetTopWatchedContentUser struct { ID *int `json:"id,omitempty"` } func (g *GetTopWatchedContentUser) GetID() *int { if g == nil { return nil } return g.ID } type GetTopWatchedContentMetadata struct { RatingKey *string `json:"ratingKey,omitempty"` Key *string `json:"key,omitempty"` GUID *string `json:"guid,omitempty"` Slug *string `json:"slug,omitempty"` Studio *string `json:"studio,omitempty"` Type *string `json:"type,omitempty"` Title *string `json:"title,omitempty"` LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` LibrarySectionID *int `json:"librarySectionID,omitempty"` LibrarySectionKey *string `json:"librarySectionKey,omitempty"` ContentRating *string `json:"contentRating,omitempty"` Summary *string `json:"summary,omitempty"` Index *int64 `json:"index,omitempty"` AudienceRating *float64 `json:"audienceRating,omitempty"` Year *int `json:"year,omitempty"` Tagline *string `json:"tagline,omitempty"` Thumb *string `json:"thumb,omitempty"` Art *string `json:"art,omitempty"` Duration *int `json:"duration,omitempty"` OriginallyAvailableAt *types.Date `json:"originallyAvailableAt,omitempty"` LeafCount *int64 `json:"leafCount,omitempty"` ViewedLeafCount *int64 `json:"viewedLeafCount,omitempty"` ChildCount *int64 `json:"childCount,omitempty"` AddedAt *int `json:"addedAt,omitempty"` UpdatedAt *int `json:"updatedAt,omitempty"` GlobalViewCount *int64 `json:"globalViewCount,omitempty"` AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` Genre []GetTopWatchedContentGenre `json:"Genre,omitempty"` Country []GetTopWatchedContentCountry `json:"Country,omitempty"` Guids []GetTopWatchedContentGuids `json:"Guid,omitempty"` Role []GetTopWatchedContentRole `json:"Role,omitempty"` User []GetTopWatchedContentUser `json:"User,omitempty"` } func (g GetTopWatchedContentMetadata) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetTopWatchedContentMetadata) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { return err } return nil } func (g *GetTopWatchedContentMetadata) GetRatingKey() *string { if g == nil { return nil } return g.RatingKey } func (g *GetTopWatchedContentMetadata) GetKey() *string { if g == nil { return nil } return g.Key } func (g *GetTopWatchedContentMetadata) GetGUID() *string { if g == nil { return nil } return g.GUID } func (g *GetTopWatchedContentMetadata) GetSlug() *string { if g == nil { return nil } return g.Slug } func (g *GetTopWatchedContentMetadata) GetStudio() *string { if g == nil { return nil } return g.Studio } func (g *GetTopWatchedContentMetadata) GetType() *string { if g == nil { return nil } return g.Type } func (g *GetTopWatchedContentMetadata) GetTitle() *string { if g == nil { return nil } return g.Title } func (g *GetTopWatchedContentMetadata) GetLibrarySectionTitle() *string { if g == nil { return nil } return g.LibrarySectionTitle } func (g *GetTopWatchedContentMetadata) GetLibrarySectionID() *int { if g == nil { return nil } return g.LibrarySectionID } func (g *GetTopWatchedContentMetadata) GetLibrarySectionKey() *string { if g == nil { return nil } return g.LibrarySectionKey } func (g *GetTopWatchedContentMetadata) GetContentRating() *string { if g == nil { return nil } return g.ContentRating } func (g *GetTopWatchedContentMetadata) GetSummary() *string { if g == nil { return nil } return g.Summary } func (g *GetTopWatchedContentMetadata) GetIndex() *int64 { if g == nil { return nil } return g.Index } func (g *GetTopWatchedContentMetadata) GetAudienceRating() *float64 { if g == nil { return nil } return g.AudienceRating } func (g *GetTopWatchedContentMetadata) GetYear() *int { if g == nil { return nil } return g.Year } func (g *GetTopWatchedContentMetadata) GetTagline() *string { if g == nil { return nil } return g.Tagline } func (g *GetTopWatchedContentMetadata) GetThumb() *string { if g == nil { return nil } return g.Thumb } func (g *GetTopWatchedContentMetadata) GetArt() *string { if g == nil { return nil } return g.Art } func (g *GetTopWatchedContentMetadata) GetDuration() *int { if g == nil { return nil } return g.Duration } func (g *GetTopWatchedContentMetadata) GetOriginallyAvailableAt() *types.Date { if g == nil { return nil } return g.OriginallyAvailableAt } func (g *GetTopWatchedContentMetadata) GetLeafCount() *int64 { if g == nil { return nil } return g.LeafCount } func (g *GetTopWatchedContentMetadata) GetViewedLeafCount() *int64 { if g == nil { return nil } return g.ViewedLeafCount } func (g *GetTopWatchedContentMetadata) GetChildCount() *int64 { if g == nil { return nil } return g.ChildCount } func (g *GetTopWatchedContentMetadata) GetAddedAt() *int { if g == nil { return nil } return g.AddedAt } func (g *GetTopWatchedContentMetadata) GetUpdatedAt() *int { if g == nil { return nil } return g.UpdatedAt } func (g *GetTopWatchedContentMetadata) GetGlobalViewCount() *int64 { if g == nil { return nil } return g.GlobalViewCount } func (g *GetTopWatchedContentMetadata) GetAudienceRatingImage() *string { if g == nil { return nil } return g.AudienceRatingImage } func (g *GetTopWatchedContentMetadata) GetGenre() []GetTopWatchedContentGenre { if g == nil { return nil } return g.Genre } func (g *GetTopWatchedContentMetadata) GetCountry() []GetTopWatchedContentCountry { if g == nil { return nil } return g.Country } func (g *GetTopWatchedContentMetadata) GetGuids() []GetTopWatchedContentGuids { if g == nil { return nil } return g.Guids } func (g *GetTopWatchedContentMetadata) GetRole() []GetTopWatchedContentRole { if g == nil { return nil } return g.Role } func (g *GetTopWatchedContentMetadata) GetUser() []GetTopWatchedContentUser { if g == nil { return nil } return g.User } type GetTopWatchedContentMediaContainer struct { // Number of media items returned in this response. Size int `json:"size"` // Indicates whether syncing is allowed. AllowSync bool `json:"allowSync"` // An plugin identifier for the media container. Identifier string `json:"identifier"` // The prefix used for media tag resource paths. MediaTagPrefix string `json:"mediaTagPrefix"` // The version number for media tags. MediaTagVersion int64 `json:"mediaTagVersion"` Metadata []GetTopWatchedContentMetadata `json:"Metadata,omitempty"` } func (g *GetTopWatchedContentMediaContainer) GetSize() int { if g == nil { return 0 } return g.Size } func (g *GetTopWatchedContentMediaContainer) GetAllowSync() bool { if g == nil { return false } return g.AllowSync } func (g *GetTopWatchedContentMediaContainer) GetIdentifier() string { if g == nil { return "" } return g.Identifier } func (g *GetTopWatchedContentMediaContainer) GetMediaTagPrefix() string { if g == nil { return "" } return g.MediaTagPrefix } func (g *GetTopWatchedContentMediaContainer) GetMediaTagVersion() int64 { if g == nil { return 0 } return g.MediaTagVersion } func (g *GetTopWatchedContentMediaContainer) GetMetadata() []GetTopWatchedContentMetadata { if g == nil { return nil } return g.Metadata } // GetTopWatchedContentResponseBody - The metadata of the library item. type GetTopWatchedContentResponseBody struct { MediaContainer *GetTopWatchedContentMediaContainer `json:"MediaContainer,omitempty"` } func (g *GetTopWatchedContentResponseBody) GetMediaContainer() *GetTopWatchedContentMediaContainer { if g == nil { return nil } return g.MediaContainer } type GetTopWatchedContentResponse struct { // HTTP response content type for this operation ContentType string // HTTP response status code for this operation StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // The metadata of the library item. Object *GetTopWatchedContentResponseBody } func (g *GetTopWatchedContentResponse) GetContentType() string { if g == nil { return "" } return g.ContentType } func (g *GetTopWatchedContentResponse) GetStatusCode() int { if g == nil { return 0 } return g.StatusCode } func (g *GetTopWatchedContentResponse) GetRawResponse() *http.Response { if g == nil { return nil } return g.RawResponse } func (g *GetTopWatchedContentResponse) GetObject() *GetTopWatchedContentResponseBody { if g == nil { return nil } return g.Object }