Compare commits

..

80 Commits

Author SHA1 Message Date
speakeasybot
70dbffa1d4 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.656.1 2025-11-13 00:26:46 +00:00
speakeasybot
c695dbace1 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.650.0 2025-11-06 22:25:44 +00:00
speakeasybot
835a7430fa ## Csharp SDK Changes Detected:
* `PlexApi.Butler.StartTask()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `PlexApi.Butler.StopTask()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `PlexApi.Updater.ApplyUpdates()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `PlexApi.General.GetServerInfo()`: **Added**
* `PlexApi.General.GetIdentity()`: **Added**
* `PlexApi.General.GetSourceConnectionInformation()`: **Added**
* `PlexApi.General.GetTransientToken()`: **Added**
* `PlexApi.Events.GetNotifications()`: **Added**
* `PlexApi.Events.ConnectWebSocket()`: **Added**
* `PlexApi.Preferences.GetAllPreferences()`: **Added**
* `PlexApi.Preferences.SetPreferences()`: **Added**
* `PlexApi.Preferences.GetPreference()`: **Added**
* `PlexApi.Rate.SetRating()`: **Added**
* `PlexApi.Timeline.MarkPlayed()`: **Added**
* `PlexApi.Timeline.Report()`: **Added**
* `PlexApi.Timeline.Unscrobble()`: **Added**
* `PlexApi.Activities.ListActivities()`: **Added**
* `PlexApi.Activities.CancelActivity()`: **Added**
* `PlexApi.Butler.StopTasks()`: **Added**
* `PlexApi.Butler.GetTasks()`: **Added**
* `PlexApi.Butler.StartTasks()`: **Added**
* `PlexApi.DownloadQueue.CreateDownloadQueue()`: **Added**
* `PlexApi.DownloadQueue.GetDownloadQueue()`: **Added**
* `PlexApi.DownloadQueue.AddDownloadQueueItems()`: **Added**
* `PlexApi.DownloadQueue.ListDownloadQueueItems()`: **Added**
* `PlexApi.DownloadQueue.GetItemDecision()`: **Added**
* `PlexApi.DownloadQueue.GetDownloadQueueMedia()`: **Added**
* `PlexApi.DownloadQueue.RemoveDownloadQueueItems()`: **Added**
* `PlexApi.DownloadQueue.GetDownloadQueueItems()`: **Added**
* `PlexApi.DownloadQueue.RestartProcessingDownloadQueueItems()`: **Added**
* `PlexApi.Hubs.GetAllHubs()`: **Added**
* `PlexApi.Hubs.GetContinueWatching()`: **Added**
* `PlexApi.Hubs.GetHubItems()`: **Added**
* `PlexApi.Hubs.GetPromotedHubs()`: **Added**
* `PlexApi.Hubs.GetMetadataHubs()`: **Added**
* `PlexApi.Hubs.GetPostplayHubs()`: **Added**
* `PlexApi.Hubs.GetRelatedHubs()`: **Added**
* `PlexApi.Hubs.GetSectionHubs()`: **Added**
* `PlexApi.Hubs.ResetSectionDefaults()`: **Added**
* `PlexApi.Hubs.ListHubs()`: **Added**
* `PlexApi.Hubs.CreateCustomHub()`: **Added**
* `PlexApi.Hubs.MoveHub()`: **Added**
* `PlexApi.Hubs.DeleteCustomHub()`: **Added**
* `PlexApi.Hubs.UpdateHubVisibility()`: **Added**
* `PlexApi.Search.SearchHubs()`: **Added**
* `PlexApi.Search.VoiceSearchHubs()`: **Added**
* `PlexApi.Library.GetLibraryItems()`: **Added**
* `PlexApi.Library.DeleteCaches()`: **Added**
* `PlexApi.Library.CleanBundles()`: **Added**
* `PlexApi.Library.IngestTransientItem()`: **Added**
* `PlexApi.Library.GetLibraryMatches()`: **Added**
* `PlexApi.Library.OptimizeDatabase()`: **Added**
* `PlexApi.Library.GetRandomArtwork()`: **Added**
* `PlexApi.Library.GetSections()`: **Added**
* `PlexApi.Library.AddSection()`: **Added**
* `PlexApi.Library.StopAllRefreshes()`: **Added**
* `PlexApi.Library.GetSectionsPrefs()`: **Added**
* `PlexApi.Library.RefreshSectionsMetadata()`: **Added**
* `PlexApi.Library.GetTags()`: **Added**
* `PlexApi.Library.DeleteMetadataItem()`: **Added**
* `PlexApi.Library.EditMetadataItem()`: **Added**
* `PlexApi.Library.DetectAds()`: **Added**
* `PlexApi.Library.GetAllItemLeaves()`: **Added**
* `PlexApi.Library.AnalyzeMetadata()`: **Added**
* `PlexApi.Library.GenerateThumbs()`: **Added**
* `PlexApi.Library.DetectCredits()`: **Added**
* `PlexApi.Library.GetExtras()`: **Added**
* `PlexApi.Library.AddExtras()`: **Added**
* `PlexApi.Library.GetFile()`: **Added**
* `PlexApi.Library.StartBifGeneration()`: **Added**
* `PlexApi.Library.DetectIntros()`: **Added**
* `PlexApi.Library.CreateMarker()`: **Added**
* `PlexApi.Library.MatchItem()`: **Added**
* `PlexApi.Library.ListMatches()`: **Added**
* `PlexApi.Library.MergeItems()`: **Added**
* `PlexApi.Library.ListSonicallySimilar()`: **Added**
* `PlexApi.Library.SetItemPreferences()`: **Added**
* `PlexApi.Library.RefreshItemsMetadata()`: **Added**
* `PlexApi.Library.GetRelatedItems()`: **Added**
* `PlexApi.Library.ListSimilar()`: **Added**
* `PlexApi.Library.SplitItem()`: **Added**
* `PlexApi.Library.AddSubtitles()`: **Added**
* `PlexApi.Library.GetItemTree()`: **Added**
* `PlexApi.Library.Unmatch()`: **Added**
* `PlexApi.Library.ListTopUsers()`: **Added**
* `PlexApi.Library.DetectVoiceActivity()`: **Added**
* `PlexApi.Library.GetAugmentationStatus()`: **Added**
* `PlexApi.Library.SetStreamSelection()`: **Added**
* `PlexApi.Library.GetPerson()`: **Added**
* `PlexApi.Library.ListPersonMedia()`: **Added**
* `PlexApi.Library.DeleteLibrarySection()`: **Added**
* `PlexApi.Library.GetLibraryDetails()`: **Added**
* `PlexApi.Library.EditSection()`: **Added**
* `PlexApi.Library.UpdateItems()`: **Added**
* `PlexApi.Library.StartAnalysis()`: **Added**
* `PlexApi.Library.Autocomplete()`: **Added**
* `PlexApi.Library.GetCollections()`: **Added**
* `PlexApi.Library.GetCommon()`: **Added**
* `PlexApi.Library.EmptyTrash()`: **Added**
* `PlexApi.Library.GetSectionFilters()`: **Added**
* `PlexApi.Library.GetFirstCharacters()`: **Added**
* `PlexApi.Library.DeleteIndexes()`: **Added**
* `PlexApi.Library.DeleteIntros()`: **Added**
* `PlexApi.Library.GetSectionPreferences()`: **Added**
* `PlexApi.Library.SetSectionPreferences()`: **Added**
* `PlexApi.Library.CancelRefresh()`: **Added**
* `PlexApi.Library.RefreshSection()`: **Added**
* `PlexApi.Library.GetAvailableSorts()`: **Added**
* `PlexApi.Library.GetStreamLevels()`: **Added**
* `PlexApi.Library.GetStreamLoudness()`: **Added**
* `PlexApi.Library.GetChapterImage()`: **Added**
* `PlexApi.Library.SetItemArtwork()`: **Added**
* `PlexApi.Library.UpdateItemArtwork()`: **Added**
* `PlexApi.Library.DeleteMarker()`: **Added**
* `PlexApi.Library.EditMarker()`: **Added**
* `PlexApi.Library.DeleteMediaItem()`: **Added**
* `PlexApi.Library.GetPartIndex()`: **Added**
* `PlexApi.Library.DeleteCollection()`: **Added**
* `PlexApi.Library.GetSectionImage()`: **Added**
* `PlexApi.Library.DeleteStream()`: **Added**
* `PlexApi.Library.GetStream()`: **Added**
* `PlexApi.Library.SetStreamOffset()`: **Added**
* `PlexApi.Library.GetItemArtwork()`: **Added**
* `PlexApi.Library.GetMediaPart()`: **Added**
* `PlexApi.Library.GetImageFromBif()`: **Added**
* `PlexApi.Collections.CreateCollection()`: **Added**
* `PlexApi.DvRs.ListDvRs()`: **Added**
* `PlexApi.DvRs.CreateDvr()`: **Added**
* `PlexApi.DvRs.DeleteDvr()`: **Added**
* `PlexApi.DvRs.GetDvr()`: **Added**
* `PlexApi.DvRs.DeleteLineup()`: **Added**
* `PlexApi.DvRs.AddLineup()`: **Added**
* `PlexApi.DvRs.SetDvrPreferences()`: **Added**
* `PlexApi.DvRs.StopDvrReload()`: **Added**
* `PlexApi.DvRs.ReloadGuide()`: **Added**
* `PlexApi.DvRs.TuneChannel()`: **Added**
* `PlexApi.DvRs.RemoveDeviceFromDvr()`: **Added**
* `PlexApi.DvRs.AddDeviceToDvr()`: **Added**
* `PlexApi.Epg.ComputeChannelMap()`: **Added**
* `PlexApi.Epg.GetChannels()`: **Added**
* `PlexApi.Epg.GetCountries()`: **Added**
* `PlexApi.Epg.GetAllLanguages()`: **Added**
* `PlexApi.Epg.GetLineup()`: **Added**
* `PlexApi.Epg.GetLineupChannels()`: **Added**
* `PlexApi.Epg.GetCountriesLineups()`: **Added**
* `PlexApi.Epg.GetCountryRegions()`: **Added**
* `PlexApi.Epg.ListLineups()`: **Added**
* `PlexApi.LiveTv.GetSessions()`: **Added**
* `PlexApi.LiveTv.GetLiveTvSession()`: **Added**
* `PlexApi.LiveTv.GetSessionPlaylistIndex()`: **Added**
* `PlexApi.LiveTv.GetSessionSegment()`: **Added**
* `PlexApi.Log.WriteLog()`: **Added**
* `PlexApi.Log.WriteMessage()`: **Added**
* `PlexApi.Log.EnablePapertrail()`: **Added**
* `PlexApi.Devices.GetAvailableGrabbers()`: **Added**
* `PlexApi.Devices.ListDevices()`: **Added**
* `PlexApi.Devices.AddDevice()`: **Added**
* `PlexApi.Devices.DiscoverDevices()`: **Added**
* `PlexApi.Devices.RemoveDevice()`: **Added**
* `PlexApi.Devices.GetDeviceDetails()`: **Added**
* `PlexApi.Devices.ModifyDevice()`: **Added**
* `PlexApi.Devices.SetChannelmap()`: **Added**
* `PlexApi.Devices.GetDevicesChannels()`: **Added**
* `PlexApi.Devices.SetDevicePreferences()`: **Added**
* `PlexApi.Devices.StopScan()`: **Added**
* `PlexApi.Devices.Scan()`: **Added**
* `PlexApi.Devices.GetThumb()`: **Added**
* `PlexApi.Provider.ListProviders()`: **Added**
* `PlexApi.Provider.AddProvider()`: **Added**
* `PlexApi.Provider.RefreshProviders()`: **Added**
* `PlexApi.Provider.DeleteMediaProvider()`: **Added**
* `PlexApi.Subscriptions.GetAllSubscriptions()`: **Added**
* `PlexApi.Subscriptions.CreateSubscription()`: **Added**
* `PlexApi.Subscriptions.ProcessSubscriptions()`: **Added**
* `PlexApi.Subscriptions.GetScheduledRecordings()`: **Added**
* `PlexApi.Subscriptions.GetTemplate()`: **Added**
* `PlexApi.Subscriptions.CancelGrab()`: **Added**
* `PlexApi.Subscriptions.DeleteSubscription()`: **Added**
* `PlexApi.Subscriptions.GetSubscription()`: **Added**
* `PlexApi.Subscriptions.EditSubscriptionPreferences()`: **Added**
* `PlexApi.Subscriptions.ReorderSubscription()`: **Added**
* `PlexApi.Transcoder.TranscodeImage()`: **Added**
* `PlexApi.Transcoder.MakeDecision()`: **Added**
* `PlexApi.Transcoder.TriggerFallback()`: **Added**
* `PlexApi.Transcoder.TranscodeSubtitles()`: **Added**
* `PlexApi.Transcoder.StartTranscodeSession()`: **Added**
* `PlexApi.Playlist.ListPlaylists()`: **Added**
* `PlexApi.Playlist.GetPlaylist()`: **Added**
* `PlexApi.Playlist.GetPlaylistItems()`: **Added**
* `PlexApi.LibraryPlaylists.CreatePlaylist()`: **Added**
* `PlexApi.LibraryPlaylists.UploadPlaylist()`: **Added**
* `PlexApi.LibraryPlaylists.DeletePlaylist()`: **Added**
* `PlexApi.LibraryPlaylists.UpdatePlaylist()`: **Added**
* `PlexApi.LibraryPlaylists.GetPlaylistGenerators()`: **Added**
* `PlexApi.LibraryPlaylists.ClearPlaylistItems()`: **Added**
* `PlexApi.LibraryPlaylists.AddPlaylistItems()`: **Added**
* `PlexApi.LibraryPlaylists.DeletePlaylistItem()`: **Added**
* `PlexApi.LibraryPlaylists.GetPlaylistGenerator()`: **Added**
* `PlexApi.LibraryPlaylists.GetPlaylistGeneratorItems()`: **Added**
* `PlexApi.LibraryPlaylists.MovePlaylistItem()`: **Added**
* `PlexApi.LibraryPlaylists.RefreshPlaylist()`: **Added**
* `PlexApi.PlayQueue.CreatePlayQueue()`: **Added**
* `PlexApi.PlayQueue.GetPlayQueue()`: **Added**
* `PlexApi.PlayQueue.AddToPlayQueue()`: **Added**
* `PlexApi.PlayQueue.ClearPlayQueue()`: **Added**
* `PlexApi.PlayQueue.ResetPlayQueue()`: **Added**
* `PlexApi.PlayQueue.Shuffle()`: **Added**
* `PlexApi.PlayQueue.Unshuffle()`: **Added**
* `PlexApi.PlayQueue.DeletePlayQueueItem()`: **Added**
* `PlexApi.PlayQueue.MovePlayQueueItem()`: **Added**
* `PlexApi.UltraBlur.GetColors()`: **Added**
* `PlexApi.UltraBlur.GetImage()`: **Added**
* `PlexApi.Status.ListSessions()`: **Added**
* `PlexApi.Status.GetBackgroundTasks()`: **Added**
* `PlexApi.Status.ListPlaybackHistory()`: **Added**
* `PlexApi.Status.TerminateSession()`: **Added**
* `PlexApi.Status.DeleteHistory()`: **Added**
* `PlexApi.Status.GetHistoryItem()`: **Added**
* `PlexApi.Updater.CheckUpdates()`: **Added**
* `PlexApi.Updater.GetUpdatesStatus()`: **Added**
* `PlexApi.Content.GetCollectionItems()`: **Added**
* `PlexApi.Content.GetMetadataItem()`: **Added**
* `PlexApi.Content.GetAlbums()`: **Added**
* `PlexApi.Content.ListContent()`: **Added**
* `PlexApi.Content.GetAllLeaves()`: **Added**
* `PlexApi.Content.GetArts()`: **Added**
* `PlexApi.Content.GetCategories()`: **Added**
* `PlexApi.Content.GetCluster()`: **Added**
* `PlexApi.Content.GetSonicPath()`: **Added**
* `PlexApi.Content.GetFolders()`: **Added**
* `PlexApi.Content.ListMoments()`: **Added**
* `PlexApi.Content.GetSonicallySimilar()`: **Added**
* `PlexApi.Content.GetCollectionImage()`: **Added**
* `PlexApi.LibraryCollections.AddCollectionItems()`: **Added**
* `PlexApi.LibraryCollections.DeleteCollectionItem()`: **Added**
* `PlexApi.LibraryCollections.MoveCollectionItem()`: **Added**
* `PlexApi.Server.GetServerCapabilities()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.GetServerPreferences()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.GetAvailableClients()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.GetDevices()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.Get-Server-Identity()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.GetMyPlexAccount()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.GetResizedPhoto()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.Get-Media-Providers()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Server.GetServerList()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Media.MarkPlayed()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Media.MarkUnplayed()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Media.UpdatePlayProgress()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Media.Get-Banner-Image()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Media.Get-Thumb-Image()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Video.GetTimeline()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Video.StartUniversalTranscode()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Activities.GetServerActivities()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Activities.CancelServerActivities()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Butler.GetButlerTasks()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Butler.StartAllTasks()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Butler.StopAllTasks()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.GetCompanionsData()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.GetUserFriends()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.GetGeoData()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.GetHomeData()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.Get-Server-Resources()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.GetPin()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Plex.GetTokenByPinId()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Hubs.GetGlobalHubs()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Hubs.Get-Recently-Added()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Hubs.GetLibraryHubs()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Search.PerformSearch()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Search.PerformVoiceSearch()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Search.GetSearchResults()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.GetFileHash()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Recently-Added-Library()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-All-Libraries()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Library-Details()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.DeleteLibrary()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Library-Items()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Library-Sections-All()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Refresh-Library-Metadata()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Search-Library()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Genres-Library()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Countries-Library()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Actors-Library()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Search-All-Libraries()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Media-Meta-Data()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Media-Arts()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Post-Media-Arts()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Get-Media-Posters()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.Post-Media-Poster()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.GetMetadataChildren()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Library.GetTopWatchedContent()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Watchlist.Get-Watch-List()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Log.LogLine()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Log.LogMultiLine()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Log.EnablePaperTrail()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.CreatePlaylist()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.GetPlaylists()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.GetPlaylist()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.DeletePlaylist()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.UpdatePlaylist()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.GetPlaylistContents()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.ClearPlaylistContents()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.AddPlaylistContents()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Playlists.UploadPlaylist()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Authentication.GetTransientToken()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Authentication.GetSourceConnectionInformation()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Authentication.GetTokenDetails()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Authentication.Post-Users-Sign-In-Data()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Statistics.GetStatistics()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Statistics.GetResourcesStatistics()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Statistics.GetBandwidthStatistics()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Sessions.GetSessions()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Sessions.GetSessionHistory()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Sessions.GetTranscodeSessions()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Sessions.StopTranscodeSession()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Updater.GetUpdateStatus()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Updater.CheckForUpdates()`: **Deleted** **Breaking** ⚠️
* `PlexApi.Users.Get-Users()`: **Deleted** **Breaking** ⚠️
2025-10-26 10:42:55 +00:00
Luke Hagar
8c02f6a6ae Update plexapi source location in workflow.yaml 2025-10-12 01:49:24 -05:00
speakeasybot
8563e8fef2 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.615.2 2025-09-15 00:26:45 +00:00
speakeasybot
1f5d4ff03a ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.3 2025-08-07 00:28:41 +00:00
speakeasybot
d970db3b6f ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.0 2025-08-06 00:28:40 +00:00
speakeasybot
4197184f92 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.557.0 2025-06-09 00:28:07 +00:00
speakeasybot
bc02ecef34 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.555.2 2025-06-04 00:26:20 +00:00
speakeasybot
55b5c2b3dd ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.542.1 2025-05-05 00:26:49 +00:00
speakeasybot
67a53e72d5 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.541.2 2025-05-01 00:28:06 +00:00
speakeasybot
9ccab7b22d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-19 00:24:30 +00:00
speakeasybot
eb2f6e54a2 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-14 00:26:56 +00:00
speakeasybot
4b798cbb85 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-06 00:25:51 +00:00
speakeasybot
a89870d526 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.528.1 2025-04-03 00:23:53 +00:00
speakeasybot
01b116a71c ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.526.6 2025-03-31 17:08:42 +00:00
Luke Hagar
9831457f45 Update workflow.yaml 2025-03-31 12:06:13 -05:00
speakeasybot
653b23dab6 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.4 2025-03-09 00:21:37 +00:00
speakeasybot
86c36c72b7 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.2 2025-03-07 00:23:51 +00:00
speakeasybot
3e00ddc6b1 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.487.1 2025-02-10 00:23:35 +00:00
speakeasybot
d976a079a9 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.487.0 2025-02-07 00:22:51 +00:00
speakeasybot
b10d5f7023 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1 2025-02-06 00:22:53 +00:00
speakeasybot
c431cee288 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1 2025-02-05 00:22:30 +00:00
speakeasybot
5195de1dca ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1 2025-01-27 00:23:03 +00:00
speakeasybot
43dc47a5a0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1 2025-01-26 17:23:56 +00:00
speakeasybot
53157408b3 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1 2025-01-26 16:03:29 +00:00
speakeasybot
fe81f4dff0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.474.0 2025-01-24 00:22:18 +00:00
speakeasybot
c9746b7ad8 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 2024-12-22 00:24:32 +00:00
speakeasybot
0ec48b6a1d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 2024-12-21 00:22:05 +00:00
speakeasybot
14e54fa017 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.3 2024-11-14 00:22:09 +00:00
speakeasybot
61492e5dad ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1 2024-11-12 00:21:43 +00:00
speakeasybot
f099c01940 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0 2024-10-03 12:26:13 +00:00
speakeasybot
92be5b3a91 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 11:11:07 +00:00
speakeasybot
a183f389bc ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 10:46:38 +00:00
speakeasybot
4a443f6f2e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 09:49:57 +00:00
speakeasybot
b9b7cd1146 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:36:49 +00:00
speakeasybot
81c55cb08b ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:23:32 +00:00
speakeasybot
860991f2a0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-30 08:47:49 +00:00
Jason Landbridge
d25639db53 Added dotnet_version directly 2024-09-30 10:42:22 +02:00
speakeasybot
227e2351d5 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-30 00:23:16 +00:00
JasonLandbridge
3bd4f51297 Merge remote-tracking branch 'origin/main' 2024-09-29 09:09:51 +02:00
speakeasybot
4828de2345 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-29 00:24:39 +00:00
JasonLandbridge
2beb707ed5 make project intelij compatible 2024-09-28 10:01:25 +02:00
speakeasybot
affe5d5a8c ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-28 00:21:51 +00:00
speakeasybot
d16abdad70 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14 2024-09-26 00:22:14 +00:00
speakeasybot
3e9ae76433 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14 2024-09-25 15:33:47 +00:00
speakeasybot
e7023f61d0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.401.2 2024-09-21 14:18:12 +00:00
Luke Hagar
223ab320b2 Merge pull request #8 from JasonLandbridge/patch-1 2024-09-21 09:10:24 -05:00
Jason Landbridge
5421ae0531 removing the sourceDirectory property which should default to ""
When I manually trigger the SDK generation for C# from the speakeasy dashboard. The pipeline fails, see: https://github.com/LukeHagar/plexcsharp/actions/runs/10970974198/job/30465496056 but it trips over the `sourceDirectory` property which should be allowed to be empty:

See: https://www.speakeasy.com/docs/gen-reference#sourcedirectory => C# =>  `sourceDirectory`

So it's a bug in the validating process which incorrectly marks an empty `sourceDirectory` as 
invalid
2024-09-21 12:44:01 +02:00
speakeasybot
4b10ba72ca ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.401.2 2024-09-21 00:21:00 +00:00
Luke Hagar
3b6806d2db cleaning 2024-09-19 06:10:10 +00:00
speakeasybot
5883791d10 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.399.2 2024-09-19 00:22:17 +00:00
speakeasybot
548ce2564d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.398.0 2024-09-16 22:54:32 +00:00
speakeasybot
46c35ae5e3 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.398.0 2024-09-16 21:55:23 +00:00
speakeasybot
d15c54d86f ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 21:08:18 +00:00
speakeasybot
f517fffa89 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 21:01:37 +00:00
speakeasybot
2309d5a37f ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 20:57:20 +00:00
speakeasybot
d71b1b96ea ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 20:52:44 +00:00
speakeasybot
24948e0718 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 20:45:21 +00:00
Luke Hagar
39a5a0dfb6 well I tried 2024-09-16 20:36:39 +00:00
Luke Hagar
92730cbe24 trying to trick the action 2024-09-16 20:35:18 +00:00
speakeasybot
591cddc929 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 20:20:08 +00:00
Luke Hagar
6a6c770319 Update gen.yaml 2024-09-16 15:16:07 -05:00
speakeasybot
d141934f09 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.3 2024-09-16 20:06:01 +00:00
Luke Hagar
61d12eaf66 Update workflow.yaml 2024-09-16 13:17:49 -05:00
speakeasybot
307bd0f675 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.394.0 2024-09-10 00:21:41 +00:00
speakeasybot
08dcf43f3d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.392.1 2024-09-09 00:22:35 +00:00
Luke Hagar
201fa479dd Merge branch 'main' of https://github.com/LukeHagar/plexcsharp 2024-09-08 02:31:21 +00:00
Luke Hagar
4896fe1bc1 swapped to direct updates 2024-09-08 02:30:36 +00:00
Luke Hagar
241e563440 Merge pull request #6 from LukeHagar/speakeasy-sdk-regen-1725762135
chore: 🐝 Update SDK - Generate 0.5.3
2024-09-07 21:24:16 -05:00
speakeasybot
92bc4311c1 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.392.1 2024-09-08 02:23:27 +00:00
Luke Hagar
40563a5174 adjusted gen config 2024-09-08 02:21:10 +00:00
Luke Hagar
c203fd6602 Added publishing flow and regenerated 2024-09-08 02:18:54 +00:00
Luke Hagar
c1f617f0f3 Update workflow.yaml 2024-09-07 21:14:42 -05:00
speakeasybot
d077d5e9f0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.391.3 2024-09-06 17:13:00 +00:00
Luke Hagar
2bed38d2cb Merge pull request #5 from JasonLandbridge/patch-2 2024-09-06 12:10:59 -05:00
Jason Landbridge
eb186583a6 Update gen.yaml 2024-09-06 10:46:09 +02:00
speakeasybot
2b03eae316 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.390.7 2024-09-06 00:00:16 +00:00
Luke Hagar
e2d3ad2f38 Merge pull request #3 from JasonLandbridge/patch-1 2024-09-05 14:59:12 -05:00
Jason Landbridge
5d60461459 Update workflow.yaml 2024-09-05 15:05:52 +02:00
2677 changed files with 118614 additions and 40012 deletions

31
.github/workflows/sdk_generation.yaml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Generate
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
set_version:
description: optionally set a specific SDK version
type: string
schedule:
- cron: 0 0 * * *
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with:
force: ${{ github.event.inputs.force }}
mode: direct
set_version: ${{ github.event.inputs.set_version }}
speakeasy_version: latest
dotnet_version: "8.x"
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

20
.github/workflows/sdk_publish.yaml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Publish
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
push:
branches:
- main
paths:
- RELEASES.md
- '*/RELEASES.md'
jobs:
publish:
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

View File

@@ -1,25 +0,0 @@
name: Generate
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
schedule:
- cron: 0 0 * * *
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with:
force: ${{ github.event.inputs.force }}
mode: direct
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

5
.gitignore vendored
View File

@@ -1,3 +1,8 @@
.env
.env.local
.DS_Store
**/.speakeasy/temp/
**/.speakeasy/logs/
obj/
bin/
debug/

View File

@@ -0,0 +1 @@
LukeHagar.PlexAPI.SDK

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="3" />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@@ -4,22 +4,40 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
hoistGlobalSecurity: true
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
csharp:
version: 0.4.2
version: 0.19.1
additionalDependencies: []
author: LukeHagar
baseErrorName: PlexAPIError
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKException
disableNamespacePascalCasingApr2024: true
dotnetVersion: net5.0
enableSourceLink: false
dotnetVersion: net8.0
enableCancellationToken: false
enableSourceLink: true
flattenGlobalSecurity: true
flatteningOrder: ""
httpClientPrefix: Speakeasy
imports:
option: openapi
paths:
@@ -28,10 +46,13 @@ csharp:
operations: Models/Requests
shared: Models/Components
webhooks: Models/Webhooks
includeDebugSymbols: false
includeDebugSymbols: true
inputModelSuffix: input
maxMethodParams: 4
methodArguments: infer-optional-args
outputModelSuffix: output
packageName: PlexAPI
packageTags: ""
packageName: LukeHagar.PlexAPI.SDK
packageTags: Plex Media Server SDK
responseFormat: envelope
sourceDirectory: ""
useNodatime: true

View File

@@ -1,29 +1,54 @@
speakeasyVersion: 1.383.2
speakeasyVersion: 1.656.1
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:c6e5a38f9c953eb820ac1b5cb6d5aade8ee11a7bdb5b568147fd677d61b3a3c5
sourceBlobDigest: sha256:730391fe626304e22e265f9470902fc083d5e6110d20d87cdc3ac7da6b4982de
sourceRevisionDigest: sha256:674cfdd3e98489e023ae9a80ff8753f30d1b6f625d25bd11b9897875477a4392
sourceBlobDigest: sha256:370cb4409748c4811372a81d94f1a84f60b538087c23f2cb24f72082bcc827f6
tags:
- latest
- main
plex-api:
sourceNamespace: plex-api
sourceRevisionDigest: sha256:289c5a73965c8fa779f32919d1353d0d275163982c0a0f5525ef4146c462a486
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
tags:
- latest
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:56fc783b16af019db4eb0fe52df504315e8e7c7ae41e319a61bba8823f19df4b
sourceBlobDigest: sha256:b62613477fd824bb42cf0bf5d0f9980448259c9c7456e03ca6a10eef39a3994f
tags:
- latest
- speakeasy-sdk-regen-1762993511
- 1.1.1
targets:
plexcsharp:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:c6e5a38f9c953eb820ac1b5cb6d5aade8ee11a7bdb5b568147fd677d61b3a3c5
sourceBlobDigest: sha256:730391fe626304e22e265f9470902fc083d5e6110d20d87cdc3ac7da6b4982de
outLocation: /github/workspace/repo
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:56fc783b16af019db4eb0fe52df504315e8e7c7ae41e319a61bba8823f19df4b
sourceBlobDigest: sha256:b62613477fd824bb42cf0bf5d0f9980448259c9c7456e03ca6a10eef39a3994f
codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:afd93668dc1b2d774d361d321511b4a5655cbbfa606a8a41bbe498aab600f0e9
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
plexapi:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/refs/heads/main/plex-api-spec.yaml
registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi
targets:
plexcsharp:
target: csharp
source: my-source
source: plexapi
publish:
nuget:
apiKey: $nuget_api_key
codeSamples:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
labelOverride:
fixedValue: PlexCSharp

View File

@@ -1,12 +1,21 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
plexapi:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/refs/heads/main/plex-api-spec.yaml
registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi
targets:
plexcsharp:
target: csharp
source: my-source
source: plexapi
publish:
nuget:
apiKey: $nuget_api_key
codeSamples:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
labelOverride:
fixedValue: PlexCSharp

17
LukeHagar.PlexAPI.SDK.sln Normal file
View File

@@ -0,0 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LukeHagar.PlexAPI.SDK", "LukeHagar\PlexAPI\SDK\LukeHagar.PlexAPI.SDK.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,258 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// Activities provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/>
///
/// <remarks>
/// <br/>
/// Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.<br/>
/// <br/>
/// Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint.<br/>
///
/// </remarks>
/// </summary>
public interface IActivities
{
/// <summary>
/// Get all activities
///
/// <remarks>
/// List all activities on the server. Admins can see all activities but other users can only see their own
/// </remarks>
/// </summary>
Task<ListActivitiesResponse> ListActivitiesAsync();
/// <summary>
/// Cancel a running activity
///
/// <remarks>
/// Cancel a running activity. Admins can cancel all activities but other users can only cancel their own
/// </remarks>
/// </summary>
Task<CancelActivityResponse> CancelActivityAsync(CancelActivityRequest request);
}
/// <summary>
/// Activities provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/>
///
/// <remarks>
/// <br/>
/// Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity.<br/>
/// <br/>
/// Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint.<br/>
///
/// </remarks>
/// </summary>
public class Activities: IActivities
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public Activities(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<ListActivitiesResponse> ListActivitiesAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/activities";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "listActivities", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
ListActivitiesResponseBody obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<ListActivitiesResponseBody>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into ListActivitiesResponseBody.", httpResponse, httpResponseBody, ex);
}
var response = new ListActivitiesResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<CancelActivityResponse> CancelActivityAsync(CancelActivityRequest request)
{
if (request == null)
{
request = new CancelActivityRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "cancelActivity", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new CancelActivityResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

View File

@@ -0,0 +1,507 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.
/// </summary>
public interface IButler
{
/// <summary>
/// Stop all Butler tasks
///
/// <remarks>
/// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
/// </remarks>
/// </summary>
Task<StopTasksResponse> StopTasksAsync();
/// <summary>
/// Get all Butler tasks
///
/// <remarks>
/// Get the list of butler tasks and their scheduling<br/>
///
/// </remarks>
/// </summary>
Task<GetTasksResponse> GetTasksAsync();
/// <summary>
/// Start all Butler tasks
///
/// <remarks>
/// This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server&apos;s Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:<br/>
/// <br/>
/// 1. Any tasks not scheduled to run on the current day will be skipped.<br/>
/// 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.<br/>
/// 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.<br/>
/// 4. If we are outside the configured window, the task will start immediately.<br/>
///
/// </remarks>
/// </summary>
Task<StartTasksResponse> StartTasksAsync();
/// <summary>
/// Stop a single Butler task
///
/// <remarks>
/// This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists<br/>
///
/// </remarks>
/// </summary>
Task<StopTaskResponse> StopTaskAsync(StopTaskRequest request);
/// <summary>
/// Start a single Butler task
///
/// <remarks>
/// This endpoint will attempt to start a specific Butler task by name.<br/>
///
/// </remarks>
/// </summary>
Task<StartTaskResponse> StartTaskAsync(StartTaskRequest request);
}
/// <summary>
/// The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.
/// </summary>
public class Butler: IButler
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public Butler(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<StopTasksResponse> StopTasksAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTasks", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new StopTasksResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetTasksResponse> GetTasksAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTasks", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
GetTasksResponseBody obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTasksResponseBody>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into GetTasksResponseBody.", httpResponse, httpResponseBody, ex);
}
var response = new GetTasksResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<StartTasksResponse> StartTasksAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTasks", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new StartTasksResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<StopTaskResponse> StopTaskAsync(StopTaskRequest request)
{
if (request == null)
{
request = new StopTaskRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/butler/{task}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTask", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new StopTaskResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<StartTaskResponse> StartTaskAsync(StartTaskRequest request)
{
if (request == null)
{
request = new StartTaskRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/butler/{task}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTask", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(new List<int>{200, 202}.Contains(responseStatusCode))
{
return new StartTaskResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

View File

@@ -0,0 +1,162 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// API Operations against the Collections
/// </summary>
public interface ICollections
{
/// <summary>
/// Create collection
///
/// <remarks>
/// Create a collection in the library
/// </remarks>
/// </summary>
Task<CreateCollectionResponse> CreateCollectionAsync(CreateCollectionRequest request);
}
/// <summary>
/// API Operations against the Collections
/// </summary>
public class Collections: ICollections
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public Collections(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<CreateCollectionResponse> CreateCollectionAsync(CreateCollectionRequest request)
{
if (request == null)
{
request = new CreateCollectionRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/collections", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createCollection", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithMetadata obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithMetadata>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithMetadata.", httpResponse, httpResponseBody, ex);
}
var response = new CreateCollectionResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithMetadata = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1032
LukeHagar/PlexAPI/SDK/Epg.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported.<br/>
///
/// <remarks>
/// <br/>
/// Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket.<br/>
///
/// </remarks>
/// </summary>
public interface IEvents
{
/// <summary>
/// Connect to Eventsource
///
/// <remarks>
/// Connect to the event source to get a stream of events
/// </remarks>
/// </summary>
Task<GetNotificationsResponse> GetNotificationsAsync(GetNotificationsRequest? request = null);
/// <summary>
/// Connect to WebSocket
///
/// <remarks>
/// Connect to the web socket to get a stream of events
/// </remarks>
/// </summary>
Task<ConnectWebSocketResponse> ConnectWebSocketAsync(ConnectWebSocketRequest? request = null);
}
/// <summary>
/// The server can notify clients in real-time of a wide range of events, from library scanning, to preferences being modified, to changes to media, and many other things. This is also the mechanism by which activity progress is reported.<br/>
///
/// <remarks>
/// <br/>
/// Two protocols for receiving the events are available: EventSource (also known as SSE), and WebSocket.<br/>
///
/// </remarks>
/// </summary>
public class Events: IEvents
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public Events(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<GetNotificationsResponse> GetNotificationsAsync(GetNotificationsRequest? request = null)
{
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/eventsource/notifications", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getNotifications", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/octet-stream", contentType))
{
var response = new GetNotificationsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<ConnectWebSocketResponse> ConnectWebSocketAsync(ConnectWebSocketRequest? request = null)
{
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/websocket/notifications", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "connectWebSocket", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/octet-stream", contentType))
{
var response = new ConnectWebSocketResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

View File

@@ -0,0 +1,481 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// General endpoints for basic PMS operation not specific to any media provider
/// </summary>
public interface IGeneral
{
/// <summary>
/// Get PMS info
///
/// <remarks>
/// Information about this PMS setup and configuration
/// </remarks>
/// </summary>
Task<GetServerInfoResponse> GetServerInfoAsync(GetServerInfoRequest? request = null);
/// <summary>
/// Get PMS identity
///
/// <remarks>
/// Get details about this PMS&apos;s identity
/// </remarks>
/// </summary>
Task<GetIdentityResponse> GetIdentityAsync();
/// <summary>
/// Get Source Connection Information
///
/// <remarks>
/// If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
/// </remarks>
/// </summary>
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(GetSourceConnectionInformationRequest request);
/// <summary>
/// Get Transient Tokens
///
/// <remarks>
/// This endpoint provides the caller with a temporary token with the same access level as the caller&apos;s token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.<br/>
/// Note: This endpoint responds to all HTTP verbs but POST in preferred
/// </remarks>
/// </summary>
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenRequest request);
}
/// <summary>
/// General endpoints for basic PMS operation not specific to any media provider
/// </summary>
public class General: IGeneral
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public General(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<GetServerInfoResponse> GetServerInfoAsync(GetServerInfoRequest? request = null)
{
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerInfo", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithDirectory obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithDirectory>(httpResponseBody, NullValueHandling.Include);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithDirectory.", httpResponse, httpResponseBody, ex);
}
var response = new GetServerInfoResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithDirectory = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetIdentityResponse> GetIdentityAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/identity";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getIdentity", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
GetIdentityResponseBody obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<GetIdentityResponseBody>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into GetIdentityResponseBody.", httpResponse, httpResponseBody, ex);
}
var response = new GetIdentityResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(GetSourceConnectionInformationRequest request)
{
if (request == null)
{
request = new GetSourceConnectionInformationRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
GetSourceConnectionInformationResponseBody obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationResponseBody>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationResponseBody.", httpResponse, httpResponseBody, ex);
}
var response = new GetSourceConnectionInformationResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode == 400 || responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenRequest request)
{
if (request == null)
{
request = new GetTransientTokenRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTransientToken", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
GetTransientTokenResponseBody obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenResponseBody>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into GetTransientTokenResponseBody.", httpResponse, httpResponseBody, ex);
}
var response = new GetTransientTokenResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode == 400 || responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

View File

@@ -1,5 +1,5 @@
namespace PlexAPI.Hooks
namespace LukeHagar.PlexAPI.SDK.Hooks
{
/// <summary>
/// Hook Registration File.
@@ -15,7 +15,7 @@ namespace PlexAPI.Hooks
/// Initializes hooks.
/// </summary>
/// <remarks>
/// Add hooks by calling `PlexAPI.Hooks.Register&lt;HookInterface&gt;(myHook);`
/// Add hooks by calling `LukeHagar.PlexAPI.SDK.Hooks.Register&lt;HookInterface&gt;(myHook);`
/// where `I&lt;HookInterface&gt;` is one of the following interfaces defined in HookTypes.cs:
/// - ISDKInitHook
/// - IBeforeRequestHook

View File

@@ -7,44 +7,57 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Hooks
namespace LukeHagar.PlexAPI.SDK.Hooks
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using PlexAPI.Utils;
using LukeHagar.PlexAPI.SDK.Utils;
public class HookContext
{
public SDKConfig SDKConfiguration { get; set; }
public string BaseURL { get; set; } = "";
public string OperationID { get; set; }
public List<string>? Oauth2Scopes { get; set; }
public Func<object>? SecuritySource { get; set; }
public HookContext(string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
public HookContext(SDKConfig config, string baseURL, string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
{
SDKConfiguration = config;
BaseURL = baseURL;
OperationID = operationID;
Oauth2Scopes = oauth2Scopes;
SecuritySource = securitySource;
}
public HookContext(HookContext hookCtx)
{
SDKConfiguration = hookCtx.SDKConfiguration;
BaseURL = hookCtx.BaseURL;
OperationID = hookCtx.OperationID;
Oauth2Scopes = hookCtx.Oauth2Scopes;
SecuritySource = hookCtx.SecuritySource;
}
}
public class BeforeRequestContext : HookContext
{
public BeforeRequestContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
: base(hookCtx) { }
}
public class AfterSuccessContext : HookContext
{
public AfterSuccessContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
: base(hookCtx) { }
}
public class AfterErrorContext : HookContext
{
public AfterErrorContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
: base(hookCtx) { }
}
/// <summary>

View File

@@ -7,9 +7,9 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Hooks
namespace LukeHagar.PlexAPI.SDK.Hooks
{
using PlexAPI.Utils;
using LukeHagar.PlexAPI.SDK.Utils;
using System;
using System.Collections.Generic;
using System.Net.Http;
@@ -52,7 +52,7 @@ namespace PlexAPI.Hooks
{
this.afterErrorHooks.Add(hook);
}
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
{
var urlAndClient = (baseUrl, client);
@@ -68,7 +68,7 @@ namespace PlexAPI.Hooks
}
return urlAndClient;
}
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
{
foreach (var hook in this.beforeRequestHooks)
@@ -76,7 +76,8 @@ namespace PlexAPI.Hooks
try
{
request = await hook.BeforeRequestAsync(hookCtx, request);
} catch (Exception ex)
}
catch (Exception ex)
{
throw new Exception("An error occurred while calling BeforeRequestAsync hook", ex);
}
@@ -102,17 +103,18 @@ namespace PlexAPI.Hooks
public async Task<HttpResponseMessage?> AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error)
{
(HttpResponseMessage?, Exception?) responseAndError = (response, error);
foreach (var hook in this.afterErrorHooks)
{
try
{
responseAndError = await hook.AfterErrorAsync(hookCtx, responseAndError.Item1, responseAndError.Item2);
} catch (FailEarlyException)
}
catch (FailEarlyException)
{
throw;
} catch (Exception ex)
}
catch (Exception ex)
{
throw new Exception("An error occurred while calling AfterErrorAsync hook", ex);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,390 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well.
/// </summary>
public interface ILibraryCollections
{
/// <summary>
/// Add items to a collection
///
/// <remarks>
/// Add items to a collection by uri
/// </remarks>
/// </summary>
Task<AddCollectionItemsResponse> AddCollectionItemsAsync(AddCollectionItemsRequest request);
/// <summary>
/// Delete an item from a collection
///
/// <remarks>
/// Delete an item from a collection
/// </remarks>
/// </summary>
Task<DeleteCollectionItemResponse> DeleteCollectionItemAsync(DeleteCollectionItemRequest request);
/// <summary>
/// Reorder an item in the collection
///
/// <remarks>
/// Reorder items in a collection with one item after another
/// </remarks>
/// </summary>
Task<MoveCollectionItemResponse> MoveCollectionItemAsync(MoveCollectionItemRequest request);
}
/// <summary>
/// Endpoints for manipulating collections. In addition to these endpoints, `/library/collections/:collectionId/X` will be rerouted to `/library/metadata/:collectionId/X` and respond to those endpoints as well.
/// </summary>
public class LibraryCollections: ILibraryCollections
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public LibraryCollections(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<AddCollectionItemsResponse> AddCollectionItemsAsync(AddCollectionItemsRequest request)
{
if (request == null)
{
request = new AddCollectionItemsRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/collections/{collectionId}/items", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "addCollectionItems", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithMetadata obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithMetadata>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithMetadata.", httpResponse, httpResponseBody, ex);
}
var response = new AddCollectionItemsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithMetadata = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<DeleteCollectionItemResponse> DeleteCollectionItemAsync(DeleteCollectionItemRequest request)
{
if (request == null)
{
request = new DeleteCollectionItemRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/collections/{collectionId}/items/{itemId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "deleteCollectionItem", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithMetadata obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithMetadata>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithMetadata.", httpResponse, httpResponseBody, ex);
}
var response = new DeleteCollectionItemResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithMetadata = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<MoveCollectionItemResponse> MoveCollectionItemAsync(MoveCollectionItemRequest request)
{
if (request == null)
{
request = new MoveCollectionItemRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/collections/{collectionId}/items/{itemId}/move", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "moveCollectionItem", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithMetadata obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithMetadata>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithMetadata.", httpResponse, httpResponseBody, ex);
}
var response = new MoveCollectionItemResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithMetadata = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,460 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// LiveTV contains the playback sessions of a channel from a DVR device<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public interface ILiveTV
{
/// <summary>
/// Get all sessions
///
/// <remarks>
/// Get all livetv sessions and metadata
/// </remarks>
/// </summary>
Task<GetSessionsResponse> GetSessionsAsync();
/// <summary>
/// Get a single session
///
/// <remarks>
/// Get a single livetv session and metadata
/// </remarks>
/// </summary>
Task<GetLiveTVSessionResponse> GetLiveTVSessionAsync(GetLiveTVSessionRequest request);
/// <summary>
/// Get a session playlist index
///
/// <remarks>
/// Get a playlist index for playing this session
/// </remarks>
/// </summary>
Task<GetSessionPlaylistIndexResponse> GetSessionPlaylistIndexAsync(GetSessionPlaylistIndexRequest request);
/// <summary>
/// Get a single session segment
///
/// <remarks>
/// Get a single LiveTV session segment
/// </remarks>
/// </summary>
Task<GetSessionSegmentResponse> GetSessionSegmentAsync(GetSessionSegmentRequest request);
}
/// <summary>
/// LiveTV contains the playback sessions of a channel from a DVR device<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class LiveTV: ILiveTV
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public LiveTV(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<GetSessionsResponse> GetSessionsAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/livetv/sessions";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSessions", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithMetadata obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithMetadata>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithMetadata.", httpResponse, httpResponseBody, ex);
}
var response = new GetSessionsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithMetadata = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetLiveTVSessionResponse> GetLiveTVSessionAsync(GetLiveTVSessionRequest request)
{
if (request == null)
{
request = new GetLiveTVSessionRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/livetv/sessions/{sessionId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getLiveTVSession", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
MediaContainerWithMetadata obj;
try
{
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithMetadata>(httpResponseBody, NullValueHandling.Ignore);
}
catch (Exception ex)
{
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithMetadata.", httpResponse, httpResponseBody, ex);
}
var response = new GetLiveTVSessionResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.MediaContainerWithMetadata = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetSessionPlaylistIndexResponse> GetSessionPlaylistIndexAsync(GetSessionPlaylistIndexRequest request)
{
if (request == null)
{
request = new GetSessionPlaylistIndexRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/livetv/sessions/{sessionId}/{consumerId}/index.m3u8", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSessionPlaylistIndex", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new GetSessionPlaylistIndexResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<GetSessionSegmentResponse> GetSessionSegmentAsync(GetSessionSegmentRequest request)
{
if (request == null)
{
request = new GetSessionSegmentRequest();
}
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/livetv/sessions/{sessionId}/{consumerId}/{segmentId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSessionSegment", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new GetSessionSegmentResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

View File

@@ -0,0 +1,324 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK
{
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary>
/// Logging mechanism to allow clients to log to the server
/// </summary>
public interface ILog
{
/// <summary>
/// Logging a multi-line message to the Plex Media Server log
///
/// <remarks>
/// This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above PUT endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.<br/>
///
/// </remarks>
/// </summary>
Task<WriteLogResponse> WriteLogAsync(byte[] request);
/// <summary>
/// Logging a single-line message to the Plex Media Server log
///
/// <remarks>
/// This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.<br/>
/// <br/>
/// Note: This endpoint responds to all HTTP verbs **except POST** but PUT is preferred<br/>
///
/// </remarks>
/// </summary>
Task<WriteMessageResponse> WriteMessageAsync(WriteMessageRequest? request = null);
/// <summary>
/// Enabling Papertrail
///
/// <remarks>
/// This endpoint will enable all Plex Media Server logs to be sent to the Papertrail networked logging site for a period of time<br/>
/// <br/>
/// Note: This endpoint responds to all HTTP verbs but POST is preferred<br/>
///
/// </remarks>
/// </summary>
Task<EnablePapertrailResponse> EnablePapertrailAsync(EnablePapertrailRequest? request = null);
}
/// <summary>
/// Logging mechanism to allow clients to log to the server
/// </summary>
public class Log: ILog
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.19.1";
private const string _sdkGenVersion = "2.753.1";
private const string _openapiDocVersion = "1.1.1";
public Log(SDKConfig config)
{
SDKConfiguration = config;
}
public async Task<WriteLogResponse> WriteLogAsync(byte[] request)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/log";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "raw", false, false);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "writeLog", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new WriteLogResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<WriteMessageResponse> WriteMessageAsync(WriteMessageRequest? request = null)
{
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/log", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "writeMessage", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new WriteMessageResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
public async Task<EnablePapertrailResponse> EnablePapertrailAsync(EnablePapertrailRequest? request = null)
{
request.Accepts ??= SDKConfiguration.Accepts;
request.ClientIdentifier ??= SDKConfiguration.ClientIdentifier;
request.Product ??= SDKConfiguration.Product;
request.Version ??= SDKConfiguration.Version;
request.Platform ??= SDKConfiguration.Platform;
request.PlatformVersion ??= SDKConfiguration.PlatformVersion;
request.Device ??= SDKConfiguration.Device;
request.Model ??= SDKConfiguration.Model;
request.DeviceVendor ??= SDKConfiguration.DeviceVendor;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Marketplace ??= SDKConfiguration.Marketplace;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/log/networked", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "enablePapertrail", null, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new EnablePapertrailResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
}
}
}

View File

@@ -0,0 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.19.1</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Plex Media Server SDK</PackageTags>
</PropertyGroup>
<PropertyGroup>
<Nullable>enable</Nullable>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\..\NUGET.md" Pack="true" PackagePath="README.md"/>
<None Include="..\..\..\LICENSE.md" Pack="true" PackagePath="\"/>
<None Include="..\..\..\docs\**\*" Pack="true" PackagePath="\docs" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
<PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedAllSources>true</EmbedAllSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="newtonsoft.json" Version="13.0.3" />
<PackageReference Include="nodatime" Version="3.1.9" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum Accepts
{
[JsonProperty("application/json")]
ApplicationJson,
[JsonProperty("application/xml")]
ApplicationXml,
}
public static class AcceptsExtension
{
public static string Value(this Accepts value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Accepts ToEnum(this string value)
{
foreach(var field in typeof(Accepts).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is Accepts)
{
return (Accepts)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Accepts");
}
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum AdvancedSubtitles
{
[JsonProperty("burn")]
Burn,
[JsonProperty("text")]
Text,
[JsonProperty("unknown")]
Unknown,
}
public static class AdvancedSubtitlesExtension
{
public static string Value(this AdvancedSubtitles value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static AdvancedSubtitles ToEnum(this string value)
{
foreach(var field in typeof(AdvancedSubtitles).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is AdvancedSubtitles)
{
return (AdvancedSubtitles)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum AdvancedSubtitles");
}
}
}

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum AiringsType
{
[JsonProperty("New Airings Only")]
NewAiringsOnly,
[JsonProperty("New and Repeat Airings")]
NewAndRepeatAirings,
}
public static class AiringsTypeExtension
{
public static string Value(this AiringsType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static AiringsType ToEnum(this string value)
{
foreach(var field in typeof(AiringsType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is AiringsType)
{
return (AiringsType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum AiringsType");
}
}
}

View File

@@ -0,0 +1,20 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
public enum BoolInt
{
Zero = 0,
One = 1,
}
}

View File

@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class Channel
{
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("callSign")]
public string? CallSign { get; set; }
[JsonProperty("channelVcn")]
public string? ChannelVcn { get; set; }
[JsonProperty("hd")]
public bool? Hd { get; set; }
[JsonProperty("identifier")]
public string? Identifier { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("language")]
public string? Language { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class ChannelMapping
{
[JsonProperty("channelKey")]
public string? ChannelKey { get; set; }
[JsonProperty("deviceIdentifier")]
public string? DeviceIdentifier { get; set; }
[JsonProperty("enabled")]
public string? Enabled { get; set; }
[JsonProperty("lineupIdentifier")]
public string? LineupIdentifier { get; set; }
}
}

View File

@@ -0,0 +1,84 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
public class Composite
{
/// <summary>
/// Limit composite to specified metadata types
/// </summary>
[SpeakeasyMetadata("queryParam:name=type")]
public long? Type { get; set; }
/// <summary>
/// The image type
/// </summary>
[SpeakeasyMetadata("queryParam:name=format")]
public Models.Components.Format? Format { get; set; }
/// <summary>
/// 6 character hex RGB value for background color for image
/// </summary>
[SpeakeasyMetadata("queryParam:name=backgroundColor")]
public string? BackgroundColor { get; set; }
/// <summary>
/// The width of the intra-image border
/// </summary>
[SpeakeasyMetadata("queryParam:name=border")]
public long? Border { get; set; }
/// <summary>
/// Number of columns to construct in the composite image
/// </summary>
[SpeakeasyMetadata("queryParam:name=cols")]
public long? Cols { get; set; }
/// <summary>
/// Where to crop source images to fit into composite image proportions
/// </summary>
[SpeakeasyMetadata("queryParam:name=crop")]
public Crop? Crop { get; set; }
/// <summary>
/// The height of the image
/// </summary>
[SpeakeasyMetadata("queryParam:name=height")]
public long? Height { get; set; }
/// <summary>
/// The default image type to use as the sources
/// </summary>
[SpeakeasyMetadata("queryParam:name=media")]
public CompositeMedia? Media { get; set; }
/// <summary>
/// Allow repetion of images if there are not enough source images to fill grid
/// </summary>
[SpeakeasyMetadata("queryParam:name=repeat")]
public bool? Repeat { get; set; }
/// <summary>
/// Number of rows to construct in the composite image
/// </summary>
[SpeakeasyMetadata("queryParam:name=rows")]
public long? Rows { get; set; }
/// <summary>
/// The width of the image
/// </summary>
[SpeakeasyMetadata("queryParam:name=width")]
public long? Width { get; set; }
}
}

View File

@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The default image type to use as the sources
/// </summary>
public enum CompositeMedia
{
[JsonProperty("thumb")]
Thumb,
[JsonProperty("art")]
Art,
[JsonProperty("banner")]
Banner,
}
public static class CompositeMediaExtension
{
public static string Value(this CompositeMedia value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static CompositeMedia ToEnum(this string value)
{
foreach(var field in typeof(CompositeMedia).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is CompositeMedia)
{
return (CompositeMedia)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum CompositeMedia");
}
}
}

View File

@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Where to crop source images to fit into composite image proportions
/// </summary>
public enum Crop
{
[JsonProperty("center")]
Center,
[JsonProperty("top")]
Top,
}
public static class CropExtension
{
public static string Value(this Crop value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Crop ToEnum(this string value)
{
foreach(var field in typeof(Crop).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is Crop)
{
return (Crop)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Crop");
}
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum Decision
{
[JsonProperty("directplay")]
Directplay,
[JsonProperty("transcode")]
Transcode,
[JsonProperty("none")]
None,
}
public static class DecisionExtension
{
public static string Value(this Decision value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Decision ToEnum(this string value)
{
foreach(var field in typeof(Decision).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is Decision)
{
return (Decision)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Decision");
}
}
}

View File

@@ -0,0 +1,207 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Reflection;
public class DefaultType
{
private DefaultType(string value) { Value = value; }
public string Value { get; private set; }
public static DefaultType Str { get { return new DefaultType("str"); } }
public static DefaultType Number { get { return new DefaultType("number"); } }
public static DefaultType Boolean { get { return new DefaultType("boolean"); } }
public override string ToString() { return Value; }
public static implicit operator String(DefaultType v) { return v.Value; }
public static DefaultType FromString(string v) {
switch(v) {
case "str": return Str;
case "number": return Number;
case "boolean": return Boolean;
default: throw new ArgumentException("Invalid value for DefaultType");
}
}
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
return Value.Equals(((DefaultType)obj).Value);
}
public override int GetHashCode()
{
return Value.GetHashCode();
}
}
/// <summary>
/// The default value of this setting
/// </summary>
[JsonConverter(typeof(Default.DefaultConverter))]
public class Default
{
public Default(DefaultType type)
{
Type = type;
}
[SpeakeasyMetadata("form:explode=true")]
public string? Str { get; set; }
[SpeakeasyMetadata("form:explode=true")]
public double? Number { get; set; }
[SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; }
public DefaultType Type { get; set; }
public static Default CreateStr(string str)
{
DefaultType typ = DefaultType.Str;
Default res = new Default(typ);
res.Str = str;
return res;
}
public static Default CreateNumber(double number)
{
DefaultType typ = DefaultType.Number;
Default res = new Default(typ);
res.Number = number;
return res;
}
public static Default CreateBoolean(bool boolean)
{
DefaultType typ = DefaultType.Boolean;
Default res = new Default(typ);
res.Boolean = boolean;
return res;
}
public class DefaultConverter : JsonConverter
{
public override bool CanConvert(System.Type objectType) => objectType == typeof(Default);
public override bool CanRead => true;
public override object? ReadJson(JsonReader reader, System.Type objectType, object? existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null)
{
throw new InvalidOperationException("Received unexpected null JSON value");
}
var json = JRaw.Create(reader).ToString();
var fallbackCandidates = new List<(System.Type, object, string)>();
if (json[0] == '"' && json[^1] == '"'){
return new Default(DefaultType.Str)
{
Str = json[1..^1]
};
}
try
{
var converted = Convert.ToDouble(json);
return new Default(DefaultType.Number)
{
Number = converted
};
}
catch (System.FormatException)
{
// try next option
}
try
{
var converted = Convert.ToBoolean(json);
return new Default(DefaultType.Boolean)
{
Boolean = converted
};
}
catch (System.FormatException)
{
// try next option
}
if (fallbackCandidates.Count > 0)
{
fallbackCandidates.Sort((a, b) => ResponseBodyDeserializer.CompareFallbackCandidates(a.Item1, b.Item1, json));
foreach(var (deserializationType, returnObject, propertyName) in fallbackCandidates)
{
try
{
return ResponseBodyDeserializer.DeserializeUndiscriminatedUnionFallback(deserializationType, returnObject, propertyName, json);
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next fallback option
}
catch (Exception)
{
throw;
}
}
}
throw new InvalidOperationException("Could not deserialize into any supported types.");
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
if (value == null)
{
throw new InvalidOperationException("Unexpected null JSON value.");
}
Default res = (Default)value;
if (res.Str != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.Str));
return;
}
if (res.Number != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.Number));
return;
}
if (res.Boolean != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.Boolean));
return;
}
}
}
}
}

View File

@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// This default diction of this sort
/// </summary>
public enum DefaultDirection
{
[JsonProperty("asc")]
Asc,
[JsonProperty("desc")]
Desc,
}
public static class DefaultDirectionExtension
{
public static string Value(this DefaultDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static DefaultDirection ToEnum(this string value)
{
foreach(var field in typeof(DefaultDirection).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is DefaultDirection)
{
return (DefaultDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum DefaultDirection");
}
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class Device
{
[JsonProperty("ChannelMapping")]
public List<Models.Components.ChannelMapping>? ChannelMapping { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("lastSeenAt")]
public long? LastSeenAt { get; set; }
[JsonProperty("make")]
public string? Make { get; set; }
[JsonProperty("model")]
public string? Model { get; set; }
[JsonProperty("modelNumber")]
public string? ModelNumber { get; set; }
[JsonProperty("protocol")]
public string? Protocol { get; set; }
[JsonProperty("sources")]
public string? Sources { get; set; }
[JsonProperty("state")]
public string? State { get; set; }
[JsonProperty("status")]
public string? Status { get; set; }
[JsonProperty("tuners")]
public string? Tuners { get; set; }
[JsonProperty("uri")]
public string? Uri { get; set; }
[JsonProperty("uuid")]
public string? Uuid { get; set; }
}
}

View File

@@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class Directory
{
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("content")]
public bool? Content { get; set; }
[JsonProperty("filter")]
public string? Filter { get; set; }
[JsonProperty("hasPrefs")]
public bool? HasPrefs { get; set; }
[JsonProperty("hasStoreServices")]
public bool? HasStoreServices { get; set; }
[JsonProperty("hubKey")]
public string? HubKey { get; set; }
[JsonProperty("identifier")]
public string? Identifier { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("lastAccessedAt")]
public long? LastAccessedAt { get; set; }
[JsonProperty("Pivot")]
public List<Pivot>? Pivot { get; set; }
[JsonProperty("share")]
public long? Share { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("titleBar")]
public string? TitleBar { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class Dvr
{
[JsonProperty("Device")]
public List<Models.Components.Device>? Device { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("language")]
public string? Language { get; set; }
[JsonProperty("lineup")]
public string? Lineup { get; set; }
[JsonProperty("uuid")]
public string? Uuid { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// OK
/// </summary>
public class DvrRequestHandlerSlashGetResponses200
{
[JsonProperty("MediaContainer")]
public DvrRequestHandlerSlashGetResponses200MediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class DvrRequestHandlerSlashGetResponses200MediaContainer
{
[JsonProperty("MediaContainer")]
public DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer? MediaContainer { get; set; }
[JsonProperty("DVR")]
public List<Models.Components.Dvr>? Dvr { get; set; }
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class DvrRequestHandlerSlashGetResponses200MediaContainerMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
/// <summary>
/// A status indicator. If present and non-zero, indicates an error
/// </summary>
[JsonProperty("status")]
public long? Status { get; set; }
}
}

View File

@@ -0,0 +1,90 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an important subset useful for top-level API.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class Filter
{
/// <summary>
/// The title for the filter.
/// </summary>
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("content")]
public bool? Content { get; set; }
/// <summary>
/// This represents the filter name used for the filter, which can be used to construct complex media queries with.
/// </summary>
[JsonProperty("filter")]
public string? FilterValue { get; set; }
[JsonProperty("hasPrefs")]
public bool? HasPrefs { get; set; }
[JsonProperty("hasStoreServices")]
public bool? HasStoreServices { get; set; }
[JsonProperty("hubKey")]
public string? HubKey { get; set; }
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a &quot;Genre&quot; filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("lastAccessedAt")]
public long? LastAccessedAt { get; set; }
[JsonProperty("Pivot")]
public List<FilterPivot>? Pivot { get; set; }
[JsonProperty("share")]
public long? Share { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("titleBar")]
public string? TitleBar { get; set; }
/// <summary>
/// This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.
/// </summary>
[JsonProperty("filterType")]
public string? FilterType { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class FilterPivot
{
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("context")]
public string? Context { get; set; }
[JsonProperty("id")]
public string? Id { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("symbol")]
public string? Symbol { get; set; }
}
}

View File

@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The image type
/// </summary>
public enum Format
{
[JsonProperty("jpg")]
Jpg,
[JsonProperty("png")]
Png,
}
public static class FormatExtension
{
public static string Value(this Format value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Format ToEnum(this string value)
{
foreach(var field in typeof(Format).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is Format)
{
return (Format)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Format");
}
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// OK
/// </summary>
public class GetResponses200
{
[JsonProperty("MediaContainer")]
public GetResponses200MediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,77 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetResponses200Hub
{
/// <summary>
/// Whether this hub is visible on the home screen<br/>
///
/// <remarks>
/// - all: Visible to all users<br/>
/// - none: Visible to no users<br/>
/// - admin: Visible to only admin users<br/>
/// - shared: Visible to shared users<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("homeVisibility")]
public Models.Components.HomeVisibility? HomeVisibility { get; set; }
/// <summary>
/// The identifier for this hub
/// </summary>
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// Whether this hub is visible to admin user home
/// </summary>
[JsonProperty("promotedToOwnHome")]
public bool? PromotedToOwnHome { get; set; }
/// <summary>
/// Whether this hub is promoted to all for recommendations
/// </summary>
[JsonProperty("promotedToRecommended")]
public bool? PromotedToRecommended { get; set; }
/// <summary>
/// Whether this hub is visible to shared user&apos;s home
/// </summary>
[JsonProperty("promotedToSharedHome")]
public bool? PromotedToSharedHome { get; set; }
/// <summary>
/// The visibility of this hub in recommendations:<br/>
///
/// <remarks>
/// - all: Visible to all users<br/>
/// - none: Visible to no users<br/>
/// - admin: Visible to only admin users<br/>
/// - shared: Visible to shared users<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("recommendationsVisibility")]
public Models.Components.RecommendationsVisibility? RecommendationsVisibility { get; set; }
/// <summary>
/// The title of this hub
/// </summary>
[JsonProperty("title")]
public string? Title { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class GetResponses200MediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Hub")]
public List<GetResponses200Hub>? Hub { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// OK
/// </summary>
public class HistoryAllGetResponses200
{
[JsonProperty("MediaContainer")]
public HistoryAllGetResponses200MediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class HistoryAllGetResponses200MediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Metadata")]
public List<HistoryAllGetResponses200Metadata>? Metadata { get; set; }
}
}

View File

@@ -0,0 +1,84 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class HistoryAllGetResponses200Metadata
{
/// <summary>
/// The account id of this playback
/// </summary>
[JsonProperty("accountID")]
public long? AccountID { get; set; }
/// <summary>
/// The device id which played the item
/// </summary>
[JsonProperty("deviceID")]
public long? DeviceID { get; set; }
/// <summary>
/// The key for this individual history item
/// </summary>
[JsonProperty("historyKey")]
public string? HistoryKey { get; set; }
/// <summary>
/// The metadata key for the item played
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
/// <summary>
/// The library section id containing the item played
/// </summary>
[JsonProperty("librarySectionID")]
public string? LibrarySectionID { get; set; }
/// <summary>
/// The originally available at of the item played
/// </summary>
[JsonProperty("originallyAvailableAt")]
public string? OriginallyAvailableAt { get; set; }
/// <summary>
/// The rating key for the item played
/// </summary>
[JsonProperty("ratingKey")]
public string? RatingKey { get; set; }
/// <summary>
/// The thumb of the item played
/// </summary>
[JsonProperty("thumb")]
public string? Thumb { get; set; }
/// <summary>
/// The title of the item played
/// </summary>
[JsonProperty("title")]
public string? Title { get; set; }
/// <summary>
/// The metadata type of the item played
/// </summary>
[JsonProperty("type")]
public string? Type { get; set; }
/// <summary>
/// The time when the item was played
/// </summary>
[JsonProperty("viewedAt")]
public long? ViewedAt { get; set; }
}
}

View File

@@ -0,0 +1,72 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Whether this hub is visible on the home screen<br/>
///
/// <remarks>
/// - all: Visible to all users<br/>
/// - none: Visible to no users<br/>
/// - admin: Visible to only admin users<br/>
/// - shared: Visible to shared users<br/>
///
/// </remarks>
/// </summary>
public enum HomeVisibility
{
[JsonProperty("all")]
All,
[JsonProperty("none")]
None,
[JsonProperty("admin")]
Admin,
[JsonProperty("shared")]
Shared,
}
public static class HomeVisibilityExtension
{
public static string Value(this HomeVisibility value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static HomeVisibility ToEnum(this string value)
{
foreach(var field in typeof(HomeVisibility).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is HomeVisibility)
{
return (HomeVisibility)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum HomeVisibility");
}
}
}

View File

@@ -0,0 +1,103 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class Hub
{
/// <summary>
/// A title for this grouping of content
/// </summary>
[JsonProperty("title")]
public string? Title { get; set; }
/// <summary>
/// The type of the items contained in this hub, or possibly `mixed` if there are multiple types
/// </summary>
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("context")]
public string? Context { get; set; }
/// <summary>
/// A unique identifier for the hub
/// </summary>
[JsonProperty("hubIdentifier")]
public string? HubIdentifier { get; set; }
/// <summary>
/// A key at which the exact content currently displayed can be fetched again. This is particularly important when a hub is marked as random and requesting the `key` may get different results. It&apos;s otherwise optional.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("hubKey")]
public string? HubKey { get; set; }
/// <summary>
/// The key at which all of the content for this hub can be retrieved
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("Metadata")]
public List<Models.Components.Metadata>? Metadata { get; set; }
/// <summary>
/// &quot;A boolean indicating that the hub contains more than what&apos;s included in the current response.&quot;<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("more")]
public bool? More { get; set; }
/// <summary>
/// Indicating if the hub should be promoted to the user&apos;s homescreen
/// </summary>
[JsonProperty("promoted")]
public bool? Promoted { get; set; }
/// <summary>
/// Indicating that the contents of the hub may change on each request
/// </summary>
[JsonProperty("random")]
public bool? Random { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// A suggestion on how this hub&apos;s contents might be displayed by a client. Some examples include `hero`, `list`, `spotlight`, and `upsell`
/// </summary>
[JsonProperty("style")]
public string? Style { get; set; }
/// <summary>
/// The subtype of the items contained in this hub, or possibly `mixed` if there are multiple types
/// </summary>
[JsonProperty("subtype")]
public string? Subtype { get; set; }
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// Images such as movie posters and background artwork are represented by Image elements.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class Image
{
/// <summary>
/// Describes both the purpose and intended presentation of the image.
/// </summary>
[JsonProperty("type")]
public ImageType? Type { get; set; }
/// <summary>
/// Title to use for accessibility.
/// </summary>
[JsonProperty("alt")]
public string? Alt { get; set; }
/// <summary>
/// The relative path or absolute url for the image.
/// </summary>
[JsonProperty("url")]
public string? Url { get; set; }
}
}

View File

@@ -0,0 +1,66 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Describes both the purpose and intended presentation of the image.
/// </summary>
public enum ImageType
{
[JsonProperty("background")]
Background,
[JsonProperty("banner")]
Banner,
[JsonProperty("clearLogo")]
ClearLogo,
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("snapshot")]
Snapshot,
}
public static class ImageTypeExtension
{
public static string Value(this ImageType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static ImageType ToEnum(this string value)
{
foreach(var field in typeof(ImageType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is ImageType)
{
return (ImageType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum ImageType");
}
}
}

View File

@@ -0,0 +1,409 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// Items in a library are referred to as &quot;metadata items.&quot; These metadata items are distinct from &quot;media items&quot; which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a &quot;media item&quot; will have one or more &quot;media parts&quot; where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie.<br/>
///
/// <remarks>
/// <br/>
/// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director&apos;s cut vs. unrated version on the other hand would be separate metadata items.<br/>
/// <br/>
/// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, &quot;leaves&quot; refer to metadata items which has associated media (there is no media for a season nor show). A show will have &quot;children&quot; in the form of seasons and a season will have &quot;children&quot; in the form of episodes and episodes have &quot;parent&quot; in the form of a season which has a &quot;parent&quot; in the form of a show. Similarly, a show has &quot;grandchildren&quot; in the form of episodse and an episode has a &quot;grandparent&quot; in the form of a show.<br/>
///
/// </remarks>
/// </summary>
public class Items
{
/// <summary>
/// The title of the item (e.g. “300” or “The Simpsons”)
/// </summary>
[JsonProperty("title")]
public object? Title { get; set; }
/// <summary>
/// The type of the video item, such as `movie`, `episode`, or `clip`.
/// </summary>
[JsonProperty("type")]
public object? Type { get; set; }
/// <summary>
/// When present, contains the disc number for a track on multi-disc albums.
/// </summary>
[JsonProperty("absoluteIndex")]
public long? AbsoluteIndex { get; set; }
/// <summary>
/// In units of seconds since the epoch, returns the time at which the item was added to the library.
/// </summary>
[JsonProperty("addedAt")]
public long? AddedAt { get; set; }
/// <summary>
/// When present, the URL for the background artwork for the item.
/// </summary>
[JsonProperty("art")]
public object? Art { get; set; }
/// <summary>
/// Some rating systems separate reviewer ratings from audience ratings
/// </summary>
[JsonProperty("audienceRating")]
public double? AudienceRating { get; set; }
/// <summary>
/// A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled).
/// </summary>
[JsonProperty("audienceRatingImage")]
public object? AudienceRatingImage { get; set; }
[JsonProperty("Autotag")]
public List<Tag>? Autotag { get; set; }
/// <summary>
/// When present, the URL for a banner graphic for the item.
/// </summary>
[JsonProperty("banner")]
public object? Banner { get; set; }
/// <summary>
/// When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two).
/// </summary>
[JsonProperty("chapterSource")]
public object? ChapterSource { get; set; }
/// <summary>
/// When present, the URL for a composite image for descendent items (e.g. photo albums or playlists).
/// </summary>
[JsonProperty("composite")]
public object? Composite { get; set; }
/// <summary>
/// If known, the content rating (e.g. MPAA) for an item.
/// </summary>
[JsonProperty("contentRating")]
public object? ContentRating { get; set; }
[JsonProperty("Country")]
public List<Tag>? Country { get; set; }
[JsonProperty("Director")]
public List<Tag>? Director { get; set; }
/// <summary>
/// When present, the duration for the item, in units of milliseconds.
/// </summary>
[JsonProperty("duration")]
public long? Duration { get; set; }
/// <summary>
/// Typically only seen in metadata at a library&apos;s top level
/// </summary>
[JsonProperty("Filter")]
public List<Filter>? Filter { get; set; }
[JsonProperty("Genre")]
public List<Tag>? Genre { get; set; }
/// <summary>
/// The `art` of the grandparent
/// </summary>
[JsonProperty("grandparentArt")]
public string? GrandparentArt { get; set; }
/// <summary>
/// The `hero` of the grandparent
/// </summary>
[JsonProperty("grandparentHero")]
public string? GrandparentHero { get; set; }
/// <summary>
/// The `key` of the grandparent
/// </summary>
[JsonProperty("grandparentKey")]
public string? GrandparentKey { get; set; }
/// <summary>
/// The `ratingKey` of the grandparent
/// </summary>
[JsonProperty("grandparentRatingKey")]
public string? GrandparentRatingKey { get; set; }
/// <summary>
/// The `theme` of the grandparent
/// </summary>
[JsonProperty("grandparentTheme")]
public string? GrandparentTheme { get; set; }
/// <summary>
/// The `thumb` of the grandparent
/// </summary>
[JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; }
/// <summary>
/// The `title` of the grandparent
/// </summary>
[JsonProperty("grandparentTitle")]
public string? GrandparentTitle { get; set; }
[JsonProperty("Guid")]
public List<Tag>? Guid { get; set; }
/// <summary>
/// When present, the URL for a hero image for the item.
/// </summary>
[JsonProperty("hero")]
public object? Hero { get; set; }
[JsonProperty("Image")]
public List<Image>? Image { get; set; }
/// <summary>
/// When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks.
/// </summary>
[JsonProperty("index")]
public long? Index { get; set; }
/// <summary>
/// The key at which the item&apos;s details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details.
/// </summary>
[JsonProperty("key")]
public object? Key { get; set; }
/// <summary>
/// When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time.
/// </summary>
[JsonProperty("lastViewedAt")]
public long? LastViewedAt { get; set; }
/// <summary>
/// For shows and seasons, contains the number of total episodes.
/// </summary>
[JsonProperty("leafCount")]
public long? LeafCount { get; set; }
[JsonProperty("Media")]
public List<Media>? Media { get; set; }
/// <summary>
/// When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don&apos;t use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well.
/// </summary>
[JsonProperty("originallyAvailableAt")]
public object? OriginallyAvailableAt { get; set; }
/// <summary>
/// When present, used to indicate an item&apos;s original title, e.g. a movie&apos;s foreign title.
/// </summary>
[JsonProperty("originalTitle")]
public object? OriginalTitle { get; set; }
/// <summary>
/// The `hero` of the parent
/// </summary>
[JsonProperty("parentHero")]
public string? ParentHero { get; set; }
/// <summary>
/// The `index` of the parent
/// </summary>
[JsonProperty("parentIndex")]
public long? ParentIndex { get; set; }
/// <summary>
/// The `key` of the parent
/// </summary>
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
/// <summary>
/// The `ratingKey` of the parent
/// </summary>
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
/// <summary>
/// The `thumb` of the parent
/// </summary>
[JsonProperty("parentThumb")]
public string? ParentThumb { get; set; }
/// <summary>
/// The `title` of the parent
/// </summary>
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
/// <summary>
/// Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item.
/// </summary>
[JsonProperty("primaryExtraKey")]
public object? PrimaryExtraKey { get; set; }
/// <summary>
/// Prompt to give the user for this directory (such as `Search Movies`)
/// </summary>
[JsonProperty("prompt")]
public string? Prompt { get; set; }
/// <summary>
/// When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from.
/// </summary>
[JsonProperty("rating")]
public double? Rating { get; set; }
[JsonProperty("Rating")]
public List<Tag>? RatingArray { get; set; }
/// <summary>
/// Number of ratings under this metadata
/// </summary>
[JsonProperty("ratingCount")]
public long? RatingCount { get; set; }
/// <summary>
/// When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten.
/// </summary>
[JsonProperty("ratingImage")]
public object? RatingImage { get; set; }
/// <summary>
/// This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed.
/// </summary>
[JsonProperty("ratingKey")]
public object? RatingKey { get; set; }
[JsonProperty("Role")]
public List<Tag>? Role { get; set; }
/// <summary>
/// Indicates this is a search directory
/// </summary>
[JsonProperty("search")]
public bool? Search { get; set; }
/// <summary>
/// Used by old clients to provide nested menus allowing for primative (but structured) navigation.
/// </summary>
[JsonProperty("secondary")]
public bool? Secondary { get; set; }
/// <summary>
/// When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc.
/// </summary>
[JsonProperty("skipChildren")]
public bool? SkipChildren { get; set; }
/// <summary>
/// When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show).
/// </summary>
[JsonProperty("skipParent")]
public bool? SkipParent { get; set; }
/// <summary>
/// Typically only seen in metadata at a library&apos;s top level
/// </summary>
[JsonProperty("Sort")]
public List<Sort>? Sort { get; set; }
/// <summary>
/// When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums).
/// </summary>
[JsonProperty("studio")]
public object? Studio { get; set; }
/// <summary>
/// The subtype of the video item, such as `photo` when the video item is in a photo library
/// </summary>
[JsonProperty("subtype")]
public object? Subtype { get; set; }
/// <summary>
/// When present, the extended textual information about the item (e.g. movie plot, artist biography, album review).
/// </summary>
[JsonProperty("summary")]
public object? Summary { get; set; }
/// <summary>
/// When present, a pithy one-liner about the item (usually only seen for movies).
/// </summary>
[JsonProperty("tagline")]
public object? Tagline { get; set; }
/// <summary>
/// When present, the URL for theme music for the item (usually only for TV shows).
/// </summary>
[JsonProperty("theme")]
public object? Theme { get; set; }
/// <summary>
/// When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail.
/// </summary>
[JsonProperty("thumb")]
public object? Thumb { get; set; }
/// <summary>
/// Whene present, this is the string used for sorting the item. It&apos;s usually the title with any leading articles removed (e.g. “Simpsons”).
/// </summary>
[JsonProperty("titleSort")]
public object? TitleSort { get; set; }
/// <summary>
/// In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated).
/// </summary>
[JsonProperty("updatedAt")]
public long? UpdatedAt { get; set; }
/// <summary>
/// When the user has rated an item, this contains the user rating
/// </summary>
[JsonProperty("userRating")]
public double? UserRating { get; set; }
/// <summary>
/// When a users has completed watched or listened to an item, this attribute contains the number of consumptions.
/// </summary>
[JsonProperty("viewCount")]
public long? ViewCount { get; set; }
/// <summary>
/// For shows and seasons, contains the number of viewed episodes.
/// </summary>
[JsonProperty("viewedLeafCount")]
public long? ViewedLeafCount { get; set; }
/// <summary>
/// When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds.
/// </summary>
[JsonProperty("viewOffset")]
public long? ViewOffset { get; set; }
[JsonProperty("Writer")]
public List<Tag>? Writer { get; set; }
/// <summary>
/// When present, the year associated with the item&apos;s release (e.g. release year for a movie).
/// </summary>
[JsonProperty("year")]
public long? Year { get; set; }
[JsonProperty("MetadataItem")]
public List<Items>? MetadataItem { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,86 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class LibrarySection
{
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("agent")]
public string? Agent { get; set; }
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("composite")]
public string? Composite { get; set; }
[JsonProperty("content")]
public bool? Content { get; set; }
[JsonProperty("contentChangedAt")]
public long? ContentChangedAt { get; set; }
[JsonProperty("createdAt")]
public long? CreatedAt { get; set; }
[JsonProperty("directory")]
public bool? Directory { get; set; }
/// <summary>
/// Indicates whether this section has filtering capabilities
/// </summary>
[JsonProperty("filters")]
public bool? Filters { get; set; }
[JsonProperty("hidden")]
public bool? Hidden { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("language")]
public string? Language { get; set; }
[JsonProperty("Location")]
public List<LibrarySectionLocation>? Location { get; set; }
/// <summary>
/// Indicates whether this library section is currently scanning
/// </summary>
[JsonProperty("refreshing")]
public bool? Refreshing { get; set; }
[JsonProperty("scannedAt")]
public long? ScannedAt { get; set; }
[JsonProperty("scanner")]
public string? Scanner { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("updatedAt")]
public long? UpdatedAt { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// Represents a top-level location on disk where media in this library section is stored
/// </summary>
public class LibrarySectionLocation
{
[JsonProperty("id")]
public long? Id { get; set; }
/// <summary>
/// The path of where this directory exists on disk
/// </summary>
[JsonProperty("path")]
public object? Path { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// OK
/// </summary>
public class LibrarySections
{
[JsonProperty("MediaContainer")]
public LibrarySectionsMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class LibrarySectionsDirectory
{
[JsonProperty("count")]
public long? Count { get; set; }
/// <summary>
/// The key where this directory is found
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
}
}

View File

@@ -0,0 +1,211 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class LibrarySectionsMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("allowCameraUpload")]
public bool? AllowCameraUpload { get; set; }
[JsonProperty("allowChannelAccess")]
public bool? AllowChannelAccess { get; set; }
[JsonProperty("allowMediaDeletion")]
public bool? AllowMediaDeletion { get; set; }
[JsonProperty("allowSharing")]
public bool? AllowSharing { get; set; }
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
[JsonProperty("allowTuners")]
public bool? AllowTuners { get; set; }
[JsonProperty("backgroundProcessing")]
public bool? BackgroundProcessing { get; set; }
[JsonProperty("certificate")]
public bool? Certificate { get; set; }
[JsonProperty("companionProxy")]
public bool? CompanionProxy { get; set; }
[JsonProperty("countryCode")]
public string? CountryCode { get; set; }
[JsonProperty("diagnostics")]
public string? Diagnostics { get; set; }
[JsonProperty("eventStream")]
public bool? EventStream { get; set; }
[JsonProperty("friendlyName")]
public string? FriendlyName { get; set; }
[JsonProperty("hubSearch")]
public bool? HubSearch { get; set; }
[JsonProperty("itemClusters")]
public bool? ItemClusters { get; set; }
[JsonProperty("livetv")]
public long? Livetv { get; set; }
[JsonProperty("machineIdentifier")]
public object? MachineIdentifier { get; set; }
[JsonProperty("mediaProviders")]
public bool? MediaProviders { get; set; }
[JsonProperty("multiuser")]
public bool? Multiuser { get; set; }
[JsonProperty("musicAnalysis")]
public long? MusicAnalysis { get; set; }
[JsonProperty("myPlex")]
public bool? MyPlex { get; set; }
[JsonProperty("myPlexMappingState")]
public object? MyPlexMappingState { get; set; }
[JsonProperty("myPlexSigninState")]
public object? MyPlexSigninState { get; set; }
[JsonProperty("myPlexSubscription")]
public bool? MyPlexSubscription { get; set; }
[JsonProperty("myPlexUsername")]
public string? MyPlexUsername { get; set; }
[JsonProperty("offlineTranscode")]
public object? OfflineTranscode { get; set; }
/// <summary>
/// A comma-separated list of features which are enabled for the server owner
/// </summary>
[JsonProperty("ownerFeatures")]
public string? OwnerFeatures { get; set; }
[JsonProperty("platform")]
public string? Platform { get; set; }
[JsonProperty("platformVersion")]
public string? PlatformVersion { get; set; }
[JsonProperty("pluginHost")]
public bool? PluginHost { get; set; }
[JsonProperty("pushNotifications")]
public bool? PushNotifications { get; set; }
[JsonProperty("readOnlyLibraries")]
public bool? ReadOnlyLibraries { get; set; }
[JsonProperty("streamingBrainABRVersion")]
public long? StreamingBrainABRVersion { get; set; }
[JsonProperty("streamingBrainVersion")]
public long? StreamingBrainVersion { get; set; }
[JsonProperty("sync")]
public bool? Sync { get; set; }
[JsonProperty("transcoderActiveVideoSessions")]
public long? TranscoderActiveVideoSessions { get; set; }
[JsonProperty("transcoderAudio")]
public bool? TranscoderAudio { get; set; }
[JsonProperty("transcoderLyrics")]
public bool? TranscoderLyrics { get; set; }
[JsonProperty("transcoderPhoto")]
public bool? TranscoderPhoto { get; set; }
[JsonProperty("transcoderSubtitles")]
public bool? TranscoderSubtitles { get; set; }
[JsonProperty("transcoderVideo")]
public bool? TranscoderVideo { get; set; }
/// <summary>
/// The suggested video quality bitrates to present to the user
/// </summary>
[JsonProperty("transcoderVideoBitrates")]
public object? TranscoderVideoBitrates { get; set; }
[JsonProperty("transcoderVideoQualities")]
public string? TranscoderVideoQualities { get; set; }
/// <summary>
/// The suggested video resolutions to the above quality bitrates
/// </summary>
[JsonProperty("transcoderVideoResolutions")]
public object? TranscoderVideoResolutions { get; set; }
[JsonProperty("updatedAt")]
public long? UpdatedAt { get; set; }
[JsonProperty("updater")]
public bool? Updater { get; set; }
[JsonProperty("version")]
public string? Version { get; set; }
[JsonProperty("voiceSearch")]
public bool? VoiceSearch { get; set; }
[JsonProperty("Directory")]
public List<LibrarySectionsDirectory>? Directory { get; set; }
}
}

View File

@@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class Lineup
{
[JsonProperty("title")]
public string? Title { get; set; }
/// <summary>
/// The type of this object (`lineup` in this case)
/// </summary>
[JsonProperty("type")]
public string? Type { get; set; }
/// <summary>
/// - `-1`: N/A<br/>
///
/// <remarks>
/// - `0`: Over the air<br/>
/// - `1`: Cable<br/>
/// - `2`: Satellite<br/>
/// - `3`: IPTV<br/>
/// - `4`: Virtual<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("lineupType")]
public Models.Components.LineupType? LineupType { get; set; }
[JsonProperty("location")]
public string? Location { get; set; }
/// <summary>
/// The uuid of this lineup
/// </summary>
[JsonProperty("uuid")]
public string? Uuid { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
/// <summary>
/// - `-1`: N/A<br/>
///
/// <remarks>
/// - `0`: Over the air<br/>
/// - `1`: Cable<br/>
/// - `2`: Satellite<br/>
/// - `3`: IPTV<br/>
/// - `4`: Virtual<br/>
///
/// </remarks>
/// </summary>
public enum LineupType
{
Minus1 = -1,
Zero = 0,
One = 1,
Two = 2,
Three = 3,
Four = 4,
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum Location
{
[JsonProperty("lan")]
Lan,
[JsonProperty("wan")]
Wan,
[JsonProperty("cellular")]
Cellular,
}
public static class LocationExtension
{
public static string Value(this Location value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Location ToEnum(this string value)
{
foreach(var field in typeof(Location).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is Location)
{
return (Location)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Location");
}
}
}

View File

@@ -0,0 +1,84 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `Media` represents an one or more media files (parts) and is a child of a metadata item. There aren&apos;t necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class Media
{
[JsonProperty("aspectRatio")]
public double? AspectRatio { get; set; }
[JsonProperty("audioChannels")]
public long? AudioChannels { get; set; }
[JsonProperty("audioCodec")]
public object? AudioCodec { get; set; }
[JsonProperty("audioProfile")]
public object? AudioProfile { get; set; }
[JsonProperty("bitrate")]
public long? Bitrate { get; set; }
[JsonProperty("container")]
public object? Container { get; set; }
[JsonProperty("duration")]
public long? Duration { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("hasVoiceActivity")]
public bool? HasVoiceActivity { get; set; }
[JsonProperty("height")]
public long? Height { get; set; }
[JsonProperty("id")]
public long? Id { get; set; }
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
[JsonProperty("Part")]
public List<Part>? Part { get; set; }
[JsonProperty("videoCodec")]
public object? VideoCodec { get; set; }
[JsonProperty("videoFrameRate")]
public object? VideoFrameRate { get; set; }
[JsonProperty("videoProfile")]
public object? VideoProfile { get; set; }
[JsonProperty("videoResolution")]
public object? VideoResolution { get; set; }
[JsonProperty("width")]
public long? Width { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,53 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaContainerWithArtwork
{
[JsonProperty("MediaContainer")]
public MediaContainerWithArtworkMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithArtworkMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Metadata")]
public List<MediaContainerWithArtworkMetadata>? Metadata { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class MediaContainerWithArtworkMetadata
{
/// <summary>
/// The title of the item
/// </summary>
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("type")]
public MediaContainerWithArtworkType? Type { get; set; }
/// <summary>
/// The path to the artwork
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,55 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum MediaContainerWithArtworkType
{
[JsonProperty("image")]
Image,
}
public static class MediaContainerWithArtworkTypeExtension
{
public static string Value(this MediaContainerWithArtworkType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static MediaContainerWithArtworkType ToEnum(this string value)
{
foreach(var field in typeof(MediaContainerWithArtworkType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is MediaContainerWithArtworkType)
{
return (MediaContainerWithArtworkType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum MediaContainerWithArtworkType");
}
}
}

View File

@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// `MediaContainer` is commonly found as the root of a response and is a pretty generic container. Common attributes include `identifier` and things related to paging (`offset`, `size`, `totalSize`).<br/>
///
/// <remarks>
/// <br/>
/// It is also common for a `MediaContainer` to contain attributes &quot;hoisted&quot; from its children. If every element in the container would have had the same attribute, then that attribute can be present on the container instead of being repeated on every element. For example, an album&apos;s list of tracks might include `parentTitle` on the container since all of the tracks have the same album title. A container may have a `source` attribute when all of the items came from the same source. Generally speaking, when looking for an attribute on an item, if the attribute wasn&apos;t found then the container should be checked for that attribute as well.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDecision
{
[JsonProperty("MediaContainer")]
public MediaContainerWithDecisionMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,65 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum MediaContainerWithDecisionDecision
{
[JsonProperty("copy")]
Copy,
[JsonProperty("transcode")]
Transcode,
[JsonProperty("burn")]
Burn,
[JsonProperty("unavailable")]
Unavailable,
[JsonProperty("ignore")]
Ignore,
[JsonProperty("none")]
None,
}
public static class MediaContainerWithDecisionDecisionExtension
{
public static string Value(this MediaContainerWithDecisionDecision value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static MediaContainerWithDecisionDecision ToEnum(this string value)
{
foreach(var field in typeof(MediaContainerWithDecisionDecision).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is MediaContainerWithDecisionDecision)
{
return (MediaContainerWithDecisionDecision)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum MediaContainerWithDecisionDecision");
}
}
}

View File

@@ -0,0 +1,69 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum MediaContainerWithDecisionLocation
{
[JsonProperty("direct")]
Direct,
[JsonProperty("sidecar-subs")]
SidecarSubs,
[JsonProperty("segments-video")]
SegmentsVideo,
[JsonProperty("segments-audio")]
SegmentsAudio,
[JsonProperty("segments-av")]
SegmentsAv,
[JsonProperty("segments-subs")]
SegmentsSubs,
[JsonProperty("embedded")]
Embedded,
[JsonProperty("sidecar")]
Sidecar,
}
public static class MediaContainerWithDecisionLocationExtension
{
public static string Value(this MediaContainerWithDecisionLocation value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static MediaContainerWithDecisionLocation ToEnum(this string value)
{
foreach(var field in typeof(MediaContainerWithDecisionLocation).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is MediaContainerWithDecisionLocation)
{
return (MediaContainerWithDecisionLocation)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum MediaContainerWithDecisionLocation");
}
}
}

View File

@@ -0,0 +1,93 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `Media` represents an one or more media files (parts) and is a child of a metadata item. There aren&apos;t necessarily any guaranteed attributes on media elements since the attributes will vary based on the type. The possible attributes are not documented here, but they typically have self-evident names. High-level media information that can be used for badging and flagging, such as `videoResolution` and codecs, is included on the media element.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDecisionMedia
{
[JsonProperty("aspectRatio")]
public double? AspectRatio { get; set; }
[JsonProperty("audioChannels")]
public long? AudioChannels { get; set; }
[JsonProperty("audioCodec")]
public object? AudioCodec { get; set; }
[JsonProperty("audioProfile")]
public object? AudioProfile { get; set; }
[JsonProperty("bitrate")]
public long? Bitrate { get; set; }
[JsonProperty("container")]
public object? Container { get; set; }
[JsonProperty("duration")]
public long? Duration { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("hasVoiceActivity")]
public bool? HasVoiceActivity { get; set; }
[JsonProperty("height")]
public long? Height { get; set; }
[JsonProperty("id")]
public long? Id { get; set; }
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
[JsonProperty("Part")]
public List<MediaContainerWithDecisionPart>? Part { get; set; }
[JsonProperty("videoCodec")]
public object? VideoCodec { get; set; }
[JsonProperty("videoFrameRate")]
public object? VideoFrameRate { get; set; }
[JsonProperty("videoProfile")]
public object? VideoProfile { get; set; }
[JsonProperty("videoResolution")]
public object? VideoResolution { get; set; }
[JsonProperty("width")]
public long? Width { get; set; }
[JsonProperty("abr")]
public bool? Abr { get; set; }
[JsonProperty("resourceSession")]
public string? ResourceSession { get; set; }
[JsonProperty("selected")]
public bool? Selected { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,97 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDecisionMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
/// <summary>
/// The maximum available bitrate when the decision was rendered.
/// </summary>
[JsonProperty("availableBandwidth")]
public long? AvailableBandwidth { get; set; }
[JsonProperty("directPlayDecisionCode")]
public long? DirectPlayDecisionCode { get; set; }
[JsonProperty("directPlayDecisionText")]
public string? DirectPlayDecisionText { get; set; }
/// <summary>
/// The overall decision. 1xxx are playback can succeed, 2xxx are a general error (such as insufficient bandwidth), 3xxx are errors in direct play, and 4xxx are errors in transcodes. Same codes are used in all.
/// </summary>
[JsonProperty("generalDecisionCode")]
public long? GeneralDecisionCode { get; set; }
[JsonProperty("generalDecisionText")]
public string? GeneralDecisionText { get; set; }
/// <summary>
/// The code indicating the status of evaluation of playback when client indicates `hasMDE=1`
/// </summary>
[JsonProperty("mdeDecisionCode")]
public long? MdeDecisionCode { get; set; }
/// <summary>
/// Descriptive text for the above code
/// </summary>
[JsonProperty("mdeDecisionText")]
public string? MdeDecisionText { get; set; }
[JsonProperty("Metadata")]
public List<MediaContainerWithDecisionMetadata>? Metadata { get; set; }
[JsonProperty("transcodeDecisionCode")]
public long? TranscodeDecisionCode { get; set; }
[JsonProperty("transcodeDecisionText")]
public string? TranscodeDecisionText { get; set; }
}
}

View File

@@ -0,0 +1,406 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// Items in a library are referred to as &quot;metadata items.&quot; These metadata items are distinct from &quot;media items&quot; which represent actual instances of media that can be consumed. Consider a TV library that has a single video file in it for a particular episode of a show. The library has a single media item, but it has three metadata items: one for the show, one for the season, and one for the episode. Consider a movie library that has two video files in it: the same movie, but two different resolutions. The library has a single metadata item for the movie, but that metadata item has two media items, one for each resolution. Additionally a &quot;media item&quot; will have one or more &quot;media parts&quot; where the the parts are intended to be watched together, such as a CD1 and CD2 parts of the same movie.<br/>
///
/// <remarks>
/// <br/>
/// Note that when a metadata item has multiple media items, those media items should be isomorphic. That is, a 4K version and 1080p version of a movie are different versions of the same movie. They have the same duration, same summary, same rating, etc. and they can generally be considered interchangeable. A theatrical release vs. director&apos;s cut vs. unrated version on the other hand would be separate metadata items.<br/>
/// <br/>
/// Metadata items can often live in a hierarchy with relationships between them. For example, the metadata item for an episodes is associated with a season metadata item which is associated with a show metadata item. A similar hierarchy exists with track, album, and artist and photos and photo album. The relationships may be expressed via relative terms and absolute terms. For example, &quot;leaves&quot; refer to metadata items which has associated media (there is no media for a season nor show). A show will have &quot;children&quot; in the form of seasons and a season will have &quot;children&quot; in the form of episodes and episodes have &quot;parent&quot; in the form of a season which has a &quot;parent&quot; in the form of a show. Similarly, a show has &quot;grandchildren&quot; in the form of episodse and an episode has a &quot;grandparent&quot; in the form of a show.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDecisionMetadata
{
/// <summary>
/// The title of the item (e.g. “300” or “The Simpsons”)
/// </summary>
[JsonProperty("title")]
public object? Title { get; set; }
/// <summary>
/// The type of the video item, such as `movie`, `episode`, or `clip`.
/// </summary>
[JsonProperty("type")]
public object? Type { get; set; }
/// <summary>
/// When present, contains the disc number for a track on multi-disc albums.
/// </summary>
[JsonProperty("absoluteIndex")]
public long? AbsoluteIndex { get; set; }
/// <summary>
/// In units of seconds since the epoch, returns the time at which the item was added to the library.
/// </summary>
[JsonProperty("addedAt")]
public long? AddedAt { get; set; }
/// <summary>
/// When present, the URL for the background artwork for the item.
/// </summary>
[JsonProperty("art")]
public object? Art { get; set; }
/// <summary>
/// Some rating systems separate reviewer ratings from audience ratings
/// </summary>
[JsonProperty("audienceRating")]
public double? AudienceRating { get; set; }
/// <summary>
/// A URI representing the image to be shown with the audience rating (e.g. rottentomatoes://image.rating.spilled).
/// </summary>
[JsonProperty("audienceRatingImage")]
public object? AudienceRatingImage { get; set; }
[JsonProperty("Autotag")]
public List<Tag>? Autotag { get; set; }
/// <summary>
/// When present, the URL for a banner graphic for the item.
/// </summary>
[JsonProperty("banner")]
public object? Banner { get; set; }
/// <summary>
/// When present, indicates the source for the chapters in the media file. Can be media (the chapters were embedded in the media itself), agent (a metadata agent computed them), or mixed (a combination of the two).
/// </summary>
[JsonProperty("chapterSource")]
public object? ChapterSource { get; set; }
/// <summary>
/// When present, the URL for a composite image for descendent items (e.g. photo albums or playlists).
/// </summary>
[JsonProperty("composite")]
public object? Composite { get; set; }
/// <summary>
/// If known, the content rating (e.g. MPAA) for an item.
/// </summary>
[JsonProperty("contentRating")]
public object? ContentRating { get; set; }
[JsonProperty("Country")]
public List<Tag>? Country { get; set; }
[JsonProperty("Director")]
public List<Tag>? Director { get; set; }
/// <summary>
/// When present, the duration for the item, in units of milliseconds.
/// </summary>
[JsonProperty("duration")]
public long? Duration { get; set; }
/// <summary>
/// Typically only seen in metadata at a library&apos;s top level
/// </summary>
[JsonProperty("Filter")]
public List<Filter>? Filter { get; set; }
[JsonProperty("Genre")]
public List<Tag>? Genre { get; set; }
/// <summary>
/// The `art` of the grandparent
/// </summary>
[JsonProperty("grandparentArt")]
public string? GrandparentArt { get; set; }
/// <summary>
/// The `hero` of the grandparent
/// </summary>
[JsonProperty("grandparentHero")]
public string? GrandparentHero { get; set; }
/// <summary>
/// The `key` of the grandparent
/// </summary>
[JsonProperty("grandparentKey")]
public string? GrandparentKey { get; set; }
/// <summary>
/// The `ratingKey` of the grandparent
/// </summary>
[JsonProperty("grandparentRatingKey")]
public string? GrandparentRatingKey { get; set; }
/// <summary>
/// The `theme` of the grandparent
/// </summary>
[JsonProperty("grandparentTheme")]
public string? GrandparentTheme { get; set; }
/// <summary>
/// The `thumb` of the grandparent
/// </summary>
[JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; }
/// <summary>
/// The `title` of the grandparent
/// </summary>
[JsonProperty("grandparentTitle")]
public string? GrandparentTitle { get; set; }
[JsonProperty("Guid")]
public List<Tag>? Guid { get; set; }
/// <summary>
/// When present, the URL for a hero image for the item.
/// </summary>
[JsonProperty("hero")]
public object? Hero { get; set; }
[JsonProperty("Image")]
public List<Image>? Image { get; set; }
/// <summary>
/// When present, this represents the episode number for episodes, season number for seasons, or track number for audio tracks.
/// </summary>
[JsonProperty("index")]
public long? Index { get; set; }
/// <summary>
/// The key at which the item&apos;s details can be fetched. In many cases a metadata item may be passed without all the details (such as in a hub) and this key corresponds to the endpoint to fetch additional details.
/// </summary>
[JsonProperty("key")]
public object? Key { get; set; }
/// <summary>
/// When a user has watched or listened to an item, this contains a timestamp (epoch seconds) for that last consumption time.
/// </summary>
[JsonProperty("lastViewedAt")]
public long? LastViewedAt { get; set; }
/// <summary>
/// For shows and seasons, contains the number of total episodes.
/// </summary>
[JsonProperty("leafCount")]
public long? LeafCount { get; set; }
[JsonProperty("Media")]
public List<MediaContainerWithDecisionMedia>? Media { get; set; }
/// <summary>
/// When present, in the format YYYY-MM-DD [HH:MM:SS] (the hours/minutes/seconds part is not always present). The air date, or a higher resolution release date for an item, depending on type. For example, episodes usually have air date like 1979-08-10 (we don&apos;t use epoch seconds because media existed prior to 1970). In some cases, recorded over-the-air content has higher resolution air date which includes a time component. Albums and movies may have day-resolution release dates as well.
/// </summary>
[JsonProperty("originallyAvailableAt")]
public object? OriginallyAvailableAt { get; set; }
/// <summary>
/// When present, used to indicate an item&apos;s original title, e.g. a movie&apos;s foreign title.
/// </summary>
[JsonProperty("originalTitle")]
public object? OriginalTitle { get; set; }
/// <summary>
/// The `hero` of the parent
/// </summary>
[JsonProperty("parentHero")]
public string? ParentHero { get; set; }
/// <summary>
/// The `index` of the parent
/// </summary>
[JsonProperty("parentIndex")]
public long? ParentIndex { get; set; }
/// <summary>
/// The `key` of the parent
/// </summary>
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
/// <summary>
/// The `ratingKey` of the parent
/// </summary>
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
/// <summary>
/// The `thumb` of the parent
/// </summary>
[JsonProperty("parentThumb")]
public string? ParentThumb { get; set; }
/// <summary>
/// The `title` of the parent
/// </summary>
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
/// <summary>
/// Indicates that the item has a primary extra; for a movie, this is a trailer, and for a music track it is a music video. The URL points to the metadata details endpoint for the item.
/// </summary>
[JsonProperty("primaryExtraKey")]
public object? PrimaryExtraKey { get; set; }
/// <summary>
/// Prompt to give the user for this directory (such as `Search Movies`)
/// </summary>
[JsonProperty("prompt")]
public string? Prompt { get; set; }
/// <summary>
/// When present, the rating for the item. The exact meaning and representation depends on where the rating was sourced from.
/// </summary>
[JsonProperty("rating")]
public double? Rating { get; set; }
[JsonProperty("Rating")]
public List<Tag>? RatingArray { get; set; }
/// <summary>
/// Number of ratings under this metadata
/// </summary>
[JsonProperty("ratingCount")]
public long? RatingCount { get; set; }
/// <summary>
/// When present, indicates an image to be shown with the rating. This is passed back as a small set of defined URI values, e.g. rottentomatoes://image.rating.rotten.
/// </summary>
[JsonProperty("ratingImage")]
public object? RatingImage { get; set; }
/// <summary>
/// This is the opaque string to be passed into timeline, scrobble, and rating endpoints to identify them. While it often appears to be numeric, this is not guaranteed.
/// </summary>
[JsonProperty("ratingKey")]
public object? RatingKey { get; set; }
[JsonProperty("Role")]
public List<Tag>? Role { get; set; }
/// <summary>
/// Indicates this is a search directory
/// </summary>
[JsonProperty("search")]
public bool? Search { get; set; }
/// <summary>
/// Used by old clients to provide nested menus allowing for primative (but structured) navigation.
/// </summary>
[JsonProperty("secondary")]
public bool? Secondary { get; set; }
/// <summary>
/// When found on a show item, indicates that the children (seasons) should be skipped in favor of the grandchildren (episodes). Useful for mini-series, etc.
/// </summary>
[JsonProperty("skipChildren")]
public bool? SkipChildren { get; set; }
/// <summary>
/// When present on an episode or track item, indicates parent should be skipped in favor of grandparent (show).
/// </summary>
[JsonProperty("skipParent")]
public bool? SkipParent { get; set; }
/// <summary>
/// Typically only seen in metadata at a library&apos;s top level
/// </summary>
[JsonProperty("Sort")]
public List<Sort>? Sort { get; set; }
/// <summary>
/// When present, the studio or label which produced an item (e.g. movie studio for movies, record label for albums).
/// </summary>
[JsonProperty("studio")]
public object? Studio { get; set; }
/// <summary>
/// The subtype of the video item, such as `photo` when the video item is in a photo library
/// </summary>
[JsonProperty("subtype")]
public object? Subtype { get; set; }
/// <summary>
/// When present, the extended textual information about the item (e.g. movie plot, artist biography, album review).
/// </summary>
[JsonProperty("summary")]
public object? Summary { get; set; }
/// <summary>
/// When present, a pithy one-liner about the item (usually only seen for movies).
/// </summary>
[JsonProperty("tagline")]
public object? Tagline { get; set; }
/// <summary>
/// When present, the URL for theme music for the item (usually only for TV shows).
/// </summary>
[JsonProperty("theme")]
public object? Theme { get; set; }
/// <summary>
/// When present, the URL for the poster or thumbnail for the item. When available for types like movie, it will be the poster graphic, but fall-back to the extracted media thumbnail.
/// </summary>
[JsonProperty("thumb")]
public object? Thumb { get; set; }
/// <summary>
/// Whene present, this is the string used for sorting the item. It&apos;s usually the title with any leading articles removed (e.g. “Simpsons”).
/// </summary>
[JsonProperty("titleSort")]
public object? TitleSort { get; set; }
/// <summary>
/// In units of seconds since the epoch, returns the time at which the item was last changed (e.g. had its metadata updated).
/// </summary>
[JsonProperty("updatedAt")]
public long? UpdatedAt { get; set; }
/// <summary>
/// When the user has rated an item, this contains the user rating
/// </summary>
[JsonProperty("userRating")]
public double? UserRating { get; set; }
/// <summary>
/// When a users has completed watched or listened to an item, this attribute contains the number of consumptions.
/// </summary>
[JsonProperty("viewCount")]
public long? ViewCount { get; set; }
/// <summary>
/// For shows and seasons, contains the number of viewed episodes.
/// </summary>
[JsonProperty("viewedLeafCount")]
public long? ViewedLeafCount { get; set; }
/// <summary>
/// When a user is in the process of viewing or listening to this item, this attribute contains the current offset, in units of milliseconds.
/// </summary>
[JsonProperty("viewOffset")]
public long? ViewOffset { get; set; }
[JsonProperty("Writer")]
public List<Tag>? Writer { get; set; }
/// <summary>
/// When present, the year associated with the item&apos;s release (e.g. release year for a movie).
/// </summary>
[JsonProperty("year")]
public long? Year { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,84 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `Part` represents a particular file or &quot;part&quot; of a media item. The part is the playable unit of the media hierarchy. Suppose that a movie library contains a movie that is broken up into files, reminiscent of a movie split across two BDs. The metadata item represents information about the movie, the media item represents this instance of the movie at this resolution and quality, and the part items represent the two playable files. If another media were added which contained the joining of these two parts transcoded down to a lower resolution, then this metadata would contain 2 medias, one with 2 parts and one with 1 part.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDecisionPart
{
[JsonProperty("audioProfile")]
public object? AudioProfile { get; set; }
/// <summary>
/// The container of the media file, such as `mp4` or `mkv`
/// </summary>
[JsonProperty("container")]
public object? Container { get; set; }
/// <summary>
/// The duration of the media item, in milliseconds
/// </summary>
[JsonProperty("duration")]
public long? Duration { get; set; }
/// <summary>
/// The local file path at which the part is stored on the server
/// </summary>
[JsonProperty("file")]
public object? File { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("id")]
public long? Id { get; set; }
/// <summary>
/// The key from which the media can be streamed
/// </summary>
[JsonProperty("key")]
public object? Key { get; set; }
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
/// <summary>
/// The size of the media, in bytes
/// </summary>
[JsonProperty("size")]
public long? Size { get; set; }
[JsonProperty("Stream")]
public List<MediaContainerWithDecisionStream>? Stream { get; set; }
[JsonProperty("videoProfile")]
public object? VideoProfile { get; set; }
[JsonProperty("decision")]
public Decision? Decision { get; set; }
[JsonProperty("selected")]
public bool? Selected { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,144 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `Stream` represents a particular stream from a media item, such as the video stream, audio stream, or subtitle stream. The stream may either be part of the file represented by the parent `Part` or, especially for subtitles, an external file. The stream contains more detailed information about the specific stream. For example, a video may include the `aspectRatio` at the `Media` level, but detailed information about the video stream like the color space will be included on the `Stream` for the video stream. Note that photos do not have streams (mostly as an optimization).<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDecisionStream
{
[JsonProperty("default")]
public bool? Default { get; set; }
[JsonProperty("audioChannelLayout")]
public object? AudioChannelLayout { get; set; }
[JsonProperty("bitDepth")]
public long? BitDepth { get; set; }
[JsonProperty("bitrate")]
public long? Bitrate { get; set; }
/// <summary>
/// For subtitle streams only. If `true` then the server can attempt to automatically sync the subtitle timestamps with the video.
/// </summary>
[JsonProperty("canAutoSync")]
public bool? CanAutoSync { get; set; }
[JsonProperty("chromaLocation")]
public object? ChromaLocation { get; set; }
[JsonProperty("chromaSubsampling")]
public object? ChromaSubsampling { get; set; }
/// <summary>
/// The codec of the stream, such as `h264` or `aac`
/// </summary>
[JsonProperty("codec")]
public object? Codec { get; set; }
[JsonProperty("colorPrimaries")]
public object? ColorPrimaries { get; set; }
[JsonProperty("colorRange")]
public object? ColorRange { get; set; }
[JsonProperty("colorSpace")]
public object? ColorSpace { get; set; }
[JsonProperty("colorTrc")]
public object? ColorTrc { get; set; }
/// <summary>
/// A friendly name for the stream, often comprised of the language and codec information
/// </summary>
[JsonProperty("displayTitle")]
public object? DisplayTitle { get; set; }
[JsonProperty("frameRate")]
public double? FrameRate { get; set; }
[JsonProperty("hasScalingMatrix")]
public object? HasScalingMatrix { get; set; }
[JsonProperty("height")]
public long? Height { get; set; }
[JsonProperty("id")]
public long? Id { get; set; }
/// <summary>
/// If the stream is part of the `Part` and not an external resource, the index of the stream within that part
/// </summary>
[JsonProperty("index")]
public long? Index { get; set; }
/// <summary>
/// If the stream is independently streamable, the key from which it can be streamed
/// </summary>
[JsonProperty("key")]
public object? Key { get; set; }
[JsonProperty("language")]
public object? Language { get; set; }
/// <summary>
/// The three character language code for the stream contents
/// </summary>
[JsonProperty("languageCode")]
public object? LanguageCode { get; set; }
[JsonProperty("level")]
public long? Level { get; set; }
[JsonProperty("profile")]
public object? Profile { get; set; }
[JsonProperty("refFrames")]
public long? RefFrames { get; set; }
[JsonProperty("samplingRate")]
public long? SamplingRate { get; set; }
[JsonProperty("selected")]
public bool? Selected { get; set; }
[JsonProperty("streamIdentifier")]
public long? StreamIdentifier { get; set; }
/// <summary>
/// A number indicating the type of the stream. `1` for video, `2` for audio, `3` for subtitles, `4` for lyrics
/// </summary>
[JsonProperty("streamType")]
public long? StreamType { get; set; }
[JsonProperty("width")]
public long? Width { get; set; }
[JsonProperty("decision")]
public MediaContainerWithDecisionDecision? Decision { get; set; }
[JsonProperty("location")]
public MediaContainerWithDecisionLocation? Location { get; set; }
[JsonProperty("additionalProperties")]
public Dictionary<string, object>? AdditionalProperties { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaContainerWithDevice
{
[JsonProperty("MediaContainer")]
public MediaContainerWithDeviceMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class MediaContainerWithDeviceDevice
{
[JsonProperty("ChannelMapping")]
public List<Models.Components.ChannelMapping>? ChannelMapping { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("lastSeenAt")]
public long? LastSeenAt { get; set; }
[JsonProperty("make")]
public string? Make { get; set; }
[JsonProperty("model")]
public string? Model { get; set; }
[JsonProperty("modelNumber")]
public string? ModelNumber { get; set; }
[JsonProperty("protocol")]
public string? Protocol { get; set; }
[JsonProperty("sources")]
public string? Sources { get; set; }
[JsonProperty("state")]
public string? State { get; set; }
[JsonProperty("status")]
public string? Status { get; set; }
[JsonProperty("tuners")]
public string? Tuners { get; set; }
[JsonProperty("uri")]
public string? Uri { get; set; }
[JsonProperty("uuid")]
public string? Uuid { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDeviceMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Device")]
public List<MediaContainerWithDeviceDevice>? Device { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaContainerWithDirectory
{
[JsonProperty("MediaContainer")]
public MediaContainerWithDirectoryMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithDirectoryMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Directory")]
public List<Models.Components.Directory>? Directory { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// OK
/// </summary>
public class MediaContainerWithHubs
{
[JsonProperty("MediaContainer")]
public MediaContainerWithHubsMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithHubsMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Hub")]
public List<Models.Components.Hub>? Hub { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaContainerWithLineup
{
[JsonProperty("MediaContainer")]
public MediaContainerWithLineupMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithLineupMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Lineup")]
public List<Models.Components.Lineup>? Lineup { get; set; }
/// <summary>
/// The UUID of this set lineups
/// </summary>
[JsonProperty("uuid")]
public string? Uuid { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaContainerWithMetadata
{
[JsonProperty("MediaContainer")]
public MediaContainerWithMetadataMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.<br/>
///
/// <remarks>
/// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)<br/>
/// The container often &quot;hoists&quot; common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.<br/>
///
/// </remarks>
/// </summary>
public class MediaContainerWithMetadataMediaContainer
{
[JsonProperty("identifier")]
public string? Identifier { get; set; }
/// <summary>
/// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("offset")]
public long? Offset { get; set; }
[JsonProperty("size")]
public long? Size { get; set; }
/// <summary>
/// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("totalSize")]
public long? TotalSize { get; set; }
[JsonProperty("Metadata")]
public List<Models.Components.Metadata>? Metadata { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Components
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaContainerWithNestedMetadata
{
[JsonProperty("MediaContainer")]
public MediaContainerWithNestedMetadataMediaContainer? MediaContainer { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More