// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. package operations import ( "encoding/json" "fmt" "github.com/LukeHagar/plexgo/internal/utils" "net/http" ) // GetAllLibrariesType - The library type type GetAllLibrariesType string const ( GetAllLibrariesTypeMovie GetAllLibrariesType = "movie" GetAllLibrariesTypeTvShow GetAllLibrariesType = "show" GetAllLibrariesTypeSeason GetAllLibrariesType = "season" GetAllLibrariesTypeEpisode GetAllLibrariesType = "episode" GetAllLibrariesTypeArtist GetAllLibrariesType = "artist" GetAllLibrariesTypeAlbum GetAllLibrariesType = "album" GetAllLibrariesTypeTrack GetAllLibrariesType = "track" GetAllLibrariesTypePhotoAlbum GetAllLibrariesType = "photoalbum" GetAllLibrariesTypePhoto GetAllLibrariesType = "photo" GetAllLibrariesTypeCollection GetAllLibrariesType = "collection" ) func (e GetAllLibrariesType) ToPointer() *GetAllLibrariesType { return &e } // Hidden - The Plex library visibility setting type Hidden int const ( HiddenVisible Hidden = 0 HiddenExcludeHomeScreen Hidden = 1 HiddenExcludeHomeScreenAndGlobalSearch Hidden = 2 ) func (e Hidden) ToPointer() *Hidden { return &e } func (e *Hidden) UnmarshalJSON(data []byte) error { var v int if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case 0: fallthrough case 1: fallthrough case 2: *e = Hidden(v) return nil default: return fmt.Errorf("invalid value for Hidden: %v", v) } } type GetAllLibrariesLocation struct { // The ID of the location. ID int `json:"id"` // The path to the media item. Path string `json:"path"` } func (g *GetAllLibrariesLocation) GetID() int { if g == nil { return 0 } return g.ID } func (g *GetAllLibrariesLocation) GetPath() string { if g == nil { return "" } return g.Path } type GetAllLibrariesDirectory struct { // Indicates whether syncing is allowed. AllowSync bool `json:"allowSync"` // URL for the background artwork of the media container. Art string `json:"art"` // The relative path to the composite media item. Composite string `json:"composite"` // UNKNOWN Filters bool `json:"filters"` // Indicates whether the library is currently being refreshed or updated Refreshing bool `json:"refreshing"` // URL for the thumbnail image of the media container. Thumb string `json:"thumb"` // The library key representing the unique identifier Key string `json:"key"` Type GetAllLibrariesType `json:"type"` // The title of the library Title string `json:"title"` // The Plex agent used to match and retrieve media metadata. Agent string `json:"agent"` // UNKNOWN Scanner string `json:"scanner"` // The Plex library language that has been set Language string `json:"language"` // The universally unique identifier for the library. UUID string `json:"uuid"` // Unix epoch datetime in seconds UpdatedAt int64 `json:"updatedAt"` CreatedAt *int64 `json:"createdAt,omitempty"` // Unix epoch datetime in seconds ScannedAt int64 `json:"scannedAt"` // UNKNOWN Content bool `json:"content"` // UNKNOWN Directory bool `json:"directory"` // Timestamp (in seconds) representing the last time the content was modified. // NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64 // ContentChangedAt int64 `json:"contentChangedAt"` // The Plex library visibility setting Hidden *Hidden `default:"0" json:"hidden"` Location []GetAllLibrariesLocation `json:"Location"` } func (g GetAllLibrariesDirectory) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(g, "", false) } func (g *GetAllLibrariesDirectory) UnmarshalJSON(data []byte) error { if err := utils.UnmarshalJSON(data, &g, "", false, []string{"allowSync", "art", "composite", "filters", "refreshing", "thumb", "key", "type", "title", "agent", "scanner", "language", "uuid", "updatedAt", "scannedAt", "content", "directory", "contentChangedAt", "Location"}); err != nil { return err } return nil } func (g *GetAllLibrariesDirectory) GetAllowSync() bool { if g == nil { return false } return g.AllowSync } func (g *GetAllLibrariesDirectory) GetArt() string { if g == nil { return "" } return g.Art } func (g *GetAllLibrariesDirectory) GetComposite() string { if g == nil { return "" } return g.Composite } func (g *GetAllLibrariesDirectory) GetFilters() bool { if g == nil { return false } return g.Filters } func (g *GetAllLibrariesDirectory) GetRefreshing() bool { if g == nil { return false } return g.Refreshing } func (g *GetAllLibrariesDirectory) GetThumb() string { if g == nil { return "" } return g.Thumb } func (g *GetAllLibrariesDirectory) GetKey() string { if g == nil { return "" } return g.Key } func (g *GetAllLibrariesDirectory) GetType() GetAllLibrariesType { if g == nil { return GetAllLibrariesType("") } return g.Type } func (g *GetAllLibrariesDirectory) GetTitle() string { if g == nil { return "" } return g.Title } func (g *GetAllLibrariesDirectory) GetAgent() string { if g == nil { return "" } return g.Agent } func (g *GetAllLibrariesDirectory) GetScanner() string { if g == nil { return "" } return g.Scanner } func (g *GetAllLibrariesDirectory) GetLanguage() string { if g == nil { return "" } return g.Language } func (g *GetAllLibrariesDirectory) GetUUID() string { if g == nil { return "" } return g.UUID } func (g *GetAllLibrariesDirectory) GetUpdatedAt() int64 { if g == nil { return 0 } return g.UpdatedAt } func (g *GetAllLibrariesDirectory) GetCreatedAt() *int64 { if g == nil { return nil } return g.CreatedAt } func (g *GetAllLibrariesDirectory) GetScannedAt() int64 { if g == nil { return 0 } return g.ScannedAt } func (g *GetAllLibrariesDirectory) GetContent() bool { if g == nil { return false } return g.Content } func (g *GetAllLibrariesDirectory) GetDirectory() bool { if g == nil { return false } return g.Directory } func (g *GetAllLibrariesDirectory) GetContentChangedAt() int64 { if g == nil { return 0 } return g.ContentChangedAt } func (g *GetAllLibrariesDirectory) GetHidden() *Hidden { if g == nil { return nil } return g.Hidden } func (g *GetAllLibrariesDirectory) GetLocation() []GetAllLibrariesLocation { if g == nil { return []GetAllLibrariesLocation{} } return g.Location } type GetAllLibrariesMediaContainer struct { // Number of media items returned in this response. Size int `json:"size"` // Indicates whether syncing is allowed. AllowSync bool `json:"allowSync"` // The primary title of the media container. Title1 string `json:"title1"` Directory []GetAllLibrariesDirectory `json:"Directory,omitempty"` } func (g *GetAllLibrariesMediaContainer) GetSize() int { if g == nil { return 0 } return g.Size } func (g *GetAllLibrariesMediaContainer) GetAllowSync() bool { if g == nil { return false } return g.AllowSync } func (g *GetAllLibrariesMediaContainer) GetTitle1() string { if g == nil { return "" } return g.Title1 } func (g *GetAllLibrariesMediaContainer) GetDirectory() []GetAllLibrariesDirectory { if g == nil { return nil } return g.Directory } // GetAllLibrariesResponseBody - The libraries available on the Server type GetAllLibrariesResponseBody struct { MediaContainer *GetAllLibrariesMediaContainer `json:"MediaContainer,omitempty"` } func (g *GetAllLibrariesResponseBody) GetMediaContainer() *GetAllLibrariesMediaContainer { if g == nil { return nil } return g.MediaContainer } type GetAllLibrariesResponse 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 libraries available on the Server Object *GetAllLibrariesResponseBody } func (g *GetAllLibrariesResponse) GetContentType() string { if g == nil { return "" } return g.ContentType } func (g *GetAllLibrariesResponse) GetStatusCode() int { if g == nil { return 0 } return g.StatusCode } func (g *GetAllLibrariesResponse) GetRawResponse() *http.Response { if g == nil { return nil } return g.RawResponse } func (g *GetAllLibrariesResponse) GetObject() *GetAllLibrariesResponseBody { if g == nil { return nil } return g.Object }