mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 12:37:46 +00:00
## 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** ⚠️
This commit is contained in:
@@ -21,227 +21,208 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The protocol to use for the server connection
|
||||
/// </summary>
|
||||
public enum ServerProtocol
|
||||
{
|
||||
[JsonProperty("http")]
|
||||
Http,
|
||||
[JsonProperty("https")]
|
||||
Https,
|
||||
}
|
||||
|
||||
public static class ServerProtocolExtension
|
||||
{
|
||||
public static string Value(this ServerProtocol value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static ServerProtocol ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(ServerProtocol).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 ServerProtocol)
|
||||
{
|
||||
return (ServerProtocol)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum ServerProtocol");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
///
|
||||
/// <remarks>
|
||||
/// # Plex Media Server OpenAPI Specification<br/>
|
||||
/// <br/>
|
||||
/// An Open Source OpenAPI Specification for Plex Media Server<br/>
|
||||
/// <br/>
|
||||
/// Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
|
||||
/// <br/>
|
||||
/// ## Documentation<br/>
|
||||
/// <br/>
|
||||
/// <a href="https://plexapi.dev">API Documentation</a><br/>
|
||||
/// <br/>
|
||||
/// ## SDKs<br/>
|
||||
/// <br/>
|
||||
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
|
||||
/// <br/>
|
||||
/// | Language | Repository | Releases | Other |<br/>
|
||||
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
|
||||
/// | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
|
||||
/// | JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
|
||||
/// | Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
|
||||
/// | Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
|
||||
/// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
|
||||
/// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
|
||||
/// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
|
||||
/// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public interface IPlexAPI
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Operations against the Plex Media Server System.<br/>
|
||||
/// General endpoints for basic PMS operation not specific to any media provider
|
||||
/// </summary>
|
||||
public IGeneral General { get; }
|
||||
|
||||
/// <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 IServer Server { get; }
|
||||
public IEvents Events { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls interacting with Plex Media Server Media<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// API Operations against the Preferences
|
||||
/// </summary>
|
||||
public IMedia Media { get; }
|
||||
public IPreferences Preferences { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations with Plex Media Server Videos<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// Operations for rating media items (thumbs up/down, star ratings, etc.)
|
||||
/// </summary>
|
||||
public IVideo Video { get; }
|
||||
public IRate Rate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Activities are awesome. They 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/>
|
||||
/// The actions feature within a media provider
|
||||
/// </summary>
|
||||
public ITimeline Timeline { get; }
|
||||
|
||||
/// <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/>
|
||||
/// Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:<br/>
|
||||
/// - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.<br/>
|
||||
/// - They must contain an `type` which is used by clients to distinguish the specific activity.<br/>
|
||||
/// - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)<br/>
|
||||
/// - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.<br/>
|
||||
/// <br/>
|
||||
/// Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IActivities Activities { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Butler is the task manager of the Plex Media Server Ecosystem.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// 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 IButler Butler { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations directly against https://Plex.tv<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// API Operations against the Download Queue
|
||||
/// </summary>
|
||||
public IPlex Plex { get; }
|
||||
public IDownloadQueue DownloadQueue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// The hubs within a media provider
|
||||
/// </summary>
|
||||
public IHubs Hubs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform search operations with Plex Media Server<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// The search feature within a media provider
|
||||
/// </summary>
|
||||
public ISearch Search { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls interacting with Plex Media Server Libraries<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc).
|
||||
/// </summary>
|
||||
public ILibrary Library { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations with Plex Media Server Watchlists<br/>
|
||||
/// API Operations against the Collections
|
||||
/// </summary>
|
||||
public ICollections Collections { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IWatchlist Watchlist { get; }
|
||||
public IDVRs DVRs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Submit logs to the Log Handler for Plex Media Server<br/>
|
||||
/// The EPG (Electronic Program Guide) is responsible for obtaining metadata for what is airing on each channel and when<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IEpg Epg { get; }
|
||||
|
||||
/// <summary>
|
||||
/// LiveTV contains the playback sessions of a channel from a DVR device<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public ILiveTV LiveTV { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Logging mechanism to allow clients to log to the server
|
||||
/// </summary>
|
||||
public ILog Log { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").<br/>
|
||||
/// Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are `stream` and `download`. More complex grabbers can have associated devices<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// They can be organized in (optionally nesting) folders.<br/>
|
||||
/// Retrieving a playlist, or its items, will trigger a refresh of its metadata.<br/>
|
||||
/// This may cause the duration and number of items to change.<br/>
|
||||
/// <br/>
|
||||
/// Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The `deviceType`, `serviceType`, and `serviceId` values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below.<br/>
|
||||
/// <br/>
|
||||
/// Example SSDP output<br/>
|
||||
/// ```<br/>
|
||||
/// <root xmlns="urn:schemas-upnp-org:device-1-0"><br/>
|
||||
/// <specVersion><br/>
|
||||
/// <major>1</major><br/>
|
||||
/// <minor>0</minor><br/>
|
||||
/// </specVersion><br/>
|
||||
/// <device><br/>
|
||||
/// <deviceType>urn:plex-tv:device:Media:1</deviceType><br/>
|
||||
/// <friendlyName>Turing Hopper 3000</friendlyName><br/>
|
||||
/// <manufacturer>Plex, Inc.</manufacturer><br/>
|
||||
/// <manufacturerURL>https://plex.tv/</manufacturerURL><br/>
|
||||
/// <modelDescription>Turing Hopper 3000 Media Grabber</modelDescription><br/>
|
||||
/// <modelName>Plex Media Grabber</modelName><br/>
|
||||
/// <modelNumber>1</modelNumber><br/>
|
||||
/// <modelURL>https://plex.tv</modelURL><br/>
|
||||
/// <UDN>uuid:42fde8e4-93b6-41e5-8a63-12d848655811</UDN><br/>
|
||||
/// <serviceList><br/>
|
||||
/// <service><br/>
|
||||
/// <URLBase>http://10.0.0.5:8088</URLBase><br/>
|
||||
/// <serviceType>urn:plex-tv:service:MediaGrabber:1</serviceType><br/>
|
||||
/// <serviceId>urn:plex-tv:serviceId:MediaGrabber</serviceId><br/>
|
||||
/// </service><br/>
|
||||
/// </serviceList><br/>
|
||||
/// </device><br/>
|
||||
/// </root><br/>
|
||||
/// ```<br/>
|
||||
/// <br/>
|
||||
/// - UDN: (string) A UUID for the device. This should be unique across models of a device at minimum.<br/>
|
||||
/// - URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IPlaylists Playlists { get; }
|
||||
public IDevices Devices { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls regarding authentication for Plex Media Server<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// Media providers are the starting points for the entire Plex Media Server media library API. It defines the paths for the groups of endpoints. The `/media/providers` should be the only hard-coded path in clients when accessing the media library. Non-media library endpoints are outside the scope of the media provider. See the description in See <a href="#section/API-Info/Media-Providers">the section in API Info</a> for more information on how to use media providers.
|
||||
/// </summary>
|
||||
public IAuthentication Authentication { get; }
|
||||
public IProvider Provider { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations with Plex Media Server Statistics<br/>
|
||||
/// Subscriptions determine which media will be recorded and the criteria for selecting an airing when multiple are available<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IStatistics Statistics { get; }
|
||||
public ISubscriptions Subscriptions { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform search operations with Plex Media Server Sessions<br/>
|
||||
/// API Operations against the Transcoder
|
||||
/// </summary>
|
||||
public ITranscoder Transcoder { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Media playlists that can be created and played back
|
||||
/// </summary>
|
||||
public IPlaylist Playlist { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Endpoints for manipulating playlists.
|
||||
/// </summary>
|
||||
public ILibraryPlaylists LibraryPlaylists { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The playqueue feature within a media provider<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// A play queue represents the current list of media for playback. Although queues are persisted by the server, they should be regarded by the user as a fairly lightweight, an ephemeral list of items queued up for playback in a session. There is generally one active queue for each type of media (music, video, photos) that can be added to or destroyed and replaced with a fresh queue.<br/>
|
||||
/// Play Queues has a region, which we refer to in this doc (partially for historical reasons) as "Up Next". This region is defined by `playQueueLastAddedItemID` existing on the media container. This follows iTunes' terminology. It is a special region after the currently playing item but before the originally-played items. This enables "Party Mode" listening/viewing, where items can be added on-the-fly, and normal queue playback resumed when completed. <br/>
|
||||
/// You can visualize the play queue as a sliding window in the complete list of media queued for playback. This model is important when scaling to larger play queues (e.g. shuffling 40,000 audio tracks). The client only needs visibility into small areas of the queue at any given time, and the server can optimize access in this fashion.<br/>
|
||||
/// All created play queues will have an empty "Up Next" area - unless the item is an album and no `key` is provided. In this case the "Up Next" area will be populated by the contents of the album. This is to allow queueing of multiple albums - since the 'Add to Up Next' will insert after all the tracks. This means that If you're creating a PQ from an album, you can only shuffle it if you set `key`. This is due to the above implicit queueing of albums when no `key` is provided as well as the current limitation that you cannot shuffle a PQ with an "Up Next" area.<br/>
|
||||
/// The play queue window advances as the server receives timeline requests. The client needs to retrieve the play queue as the “now playing” item changes. There is no play queue API to update the playing item.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public ISessions Sessions { get; }
|
||||
public IPlayQueue PlayQueue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Service provided to compute UltraBlur colors and images.
|
||||
/// </summary>
|
||||
public IUltraBlur UltraBlur { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The status endpoints give you information about current playbacks, play history, and even terminating sessions.
|
||||
/// </summary>
|
||||
public IStatus Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// This describes the API for searching and applying updates to the Plex Media Server.<br/>
|
||||
@@ -252,83 +233,76 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IUpdater Updater { get; }
|
||||
public IUsers Users { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The actual content of the media provider
|
||||
/// </summary>
|
||||
public IContent Content { get; }
|
||||
|
||||
/// <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 ILibraryCollections LibraryCollections { get; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
///
|
||||
/// <remarks>
|
||||
/// # Plex Media Server OpenAPI Specification<br/>
|
||||
/// <br/>
|
||||
/// An Open Source OpenAPI Specification for Plex Media Server<br/>
|
||||
/// <br/>
|
||||
/// Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
|
||||
/// <br/>
|
||||
/// ## Documentation<br/>
|
||||
/// <br/>
|
||||
/// <a href="https://plexapi.dev">API Documentation</a><br/>
|
||||
/// <br/>
|
||||
/// ## SDKs<br/>
|
||||
/// <br/>
|
||||
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
|
||||
/// <br/>
|
||||
/// | Language | Repository | Releases | Other |<br/>
|
||||
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
|
||||
/// | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
|
||||
/// | JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
|
||||
/// | Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
|
||||
/// | Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
|
||||
/// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
|
||||
/// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
|
||||
/// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
|
||||
/// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class PlexAPI: IPlexAPI
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.17.0";
|
||||
private const string _sdkGenVersion = "2.698.4";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
public IServer Server { get; private set; }
|
||||
public IMedia Media { get; private set; }
|
||||
public IVideo Video { get; private set; }
|
||||
private const string _sdkVersion = "0.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
private const string _openapiDocVersion = "1.1.1";
|
||||
public IGeneral General { get; private set; }
|
||||
public IEvents Events { get; private set; }
|
||||
public IPreferences Preferences { get; private set; }
|
||||
public IRate Rate { get; private set; }
|
||||
public ITimeline Timeline { get; private set; }
|
||||
public IActivities Activities { get; private set; }
|
||||
public IButler Butler { get; private set; }
|
||||
public IPlex Plex { get; private set; }
|
||||
public IDownloadQueue DownloadQueue { get; private set; }
|
||||
public IHubs Hubs { get; private set; }
|
||||
public ISearch Search { get; private set; }
|
||||
public ILibrary Library { get; private set; }
|
||||
public IWatchlist Watchlist { get; private set; }
|
||||
public ICollections Collections { get; private set; }
|
||||
public IDVRs DVRs { get; private set; }
|
||||
public IEpg Epg { get; private set; }
|
||||
public ILiveTV LiveTV { get; private set; }
|
||||
public ILog Log { get; private set; }
|
||||
public IPlaylists Playlists { get; private set; }
|
||||
public IAuthentication Authentication { get; private set; }
|
||||
public IStatistics Statistics { get; private set; }
|
||||
public ISessions Sessions { get; private set; }
|
||||
public IDevices Devices { get; private set; }
|
||||
public IProvider Provider { get; private set; }
|
||||
public ISubscriptions Subscriptions { get; private set; }
|
||||
public ITranscoder Transcoder { get; private set; }
|
||||
public IPlaylist Playlist { get; private set; }
|
||||
public ILibraryPlaylists LibraryPlaylists { get; private set; }
|
||||
public IPlayQueue PlayQueue { get; private set; }
|
||||
public IUltraBlur UltraBlur { get; private set; }
|
||||
public IStatus Status { get; private set; }
|
||||
public IUpdater Updater { get; private set; }
|
||||
public IUsers Users { get; private set; }
|
||||
public IContent Content { get; private set; }
|
||||
public ILibraryCollections LibraryCollections { get; private set; }
|
||||
|
||||
public PlexAPI(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
InitHooks();
|
||||
|
||||
Server = new Server(SDKConfiguration);
|
||||
General = new General(SDKConfiguration);
|
||||
|
||||
Media = new Media(SDKConfiguration);
|
||||
Events = new Events(SDKConfiguration);
|
||||
|
||||
Video = new Video(SDKConfiguration);
|
||||
Preferences = new Preferences(SDKConfiguration);
|
||||
|
||||
Rate = new Rate(SDKConfiguration);
|
||||
|
||||
Timeline = new Timeline(SDKConfiguration);
|
||||
|
||||
Activities = new Activities(SDKConfiguration);
|
||||
|
||||
Butler = new Butler(SDKConfiguration);
|
||||
|
||||
Plex = new Plex(SDKConfiguration);
|
||||
DownloadQueue = new DownloadQueue(SDKConfiguration);
|
||||
|
||||
Hubs = new Hubs(SDKConfiguration);
|
||||
|
||||
@@ -336,24 +310,70 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
Library = new Library(SDKConfiguration);
|
||||
|
||||
Watchlist = new Watchlist(SDKConfiguration);
|
||||
Collections = new Collections(SDKConfiguration);
|
||||
|
||||
DVRs = new DVRs(SDKConfiguration);
|
||||
|
||||
Epg = new Epg(SDKConfiguration);
|
||||
|
||||
LiveTV = new LiveTV(SDKConfiguration);
|
||||
|
||||
Log = new Log(SDKConfiguration);
|
||||
|
||||
Playlists = new Playlists(SDKConfiguration);
|
||||
Devices = new Devices(SDKConfiguration);
|
||||
|
||||
Authentication = new Authentication(SDKConfiguration);
|
||||
Provider = new Provider(SDKConfiguration);
|
||||
|
||||
Statistics = new Statistics(SDKConfiguration);
|
||||
Subscriptions = new Subscriptions(SDKConfiguration);
|
||||
|
||||
Sessions = new Sessions(SDKConfiguration);
|
||||
Transcoder = new Transcoder(SDKConfiguration);
|
||||
|
||||
Playlist = new Playlist(SDKConfiguration);
|
||||
|
||||
LibraryPlaylists = new LibraryPlaylists(SDKConfiguration);
|
||||
|
||||
PlayQueue = new PlayQueue(SDKConfiguration);
|
||||
|
||||
UltraBlur = new UltraBlur(SDKConfiguration);
|
||||
|
||||
Status = new Status(SDKConfiguration);
|
||||
|
||||
Updater = new Updater(SDKConfiguration);
|
||||
|
||||
Users = new Users(SDKConfiguration);
|
||||
Content = new Content(SDKConfiguration);
|
||||
|
||||
LibraryCollections = new LibraryCollections(SDKConfiguration);
|
||||
}
|
||||
|
||||
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the SDK with optional configuration parameters.
|
||||
/// </summary>
|
||||
/// <param name="token">The security configuration to use for API requests. If provided, this will be used as a static security configuration.</param>
|
||||
/// <param name="tokenSource">A function that returns the security configuration dynamically. This takes precedence over the static security parameter if both are provided.</param>
|
||||
/// <param name="accepts">Indicates the client accepts the indicated media types</param>
|
||||
/// <param name="clientIdentifier">An opaque identifier unique to the client</param>
|
||||
/// <param name="product">The name of the client product</param>
|
||||
/// <param name="version">The version of the client application</param>
|
||||
/// <param name="platform">The platform of the client</param>
|
||||
/// <param name="platformVersion">The version of the platform</param>
|
||||
/// <param name="device">A relatively friendly name for the client device</param>
|
||||
/// <param name="model">A potentially less friendly identifier for the device model</param>
|
||||
/// <param name="deviceVendor">The device vendor</param>
|
||||
/// <param name="deviceName">A friendly name for the client</param>
|
||||
/// <param name="marketplace">The marketplace on which the client application is distributed</param>
|
||||
/// <param name="serverIndex">The index of the server to use from the predefined server list. Must be between 0 and the length of the server list. Defaults to 0 if not specified.</param>
|
||||
/// <param name="identifier">Server variable for identifier. This will replace the {identifier} placeholder in server URLs.</param>
|
||||
/// <param name="ipDescription">Server variable for IP-description. This will replace the {IP-description} placeholder in server URLs.</param>
|
||||
/// <param name="port">Server variable for port. This will replace the {port} placeholder in server URLs.</param>
|
||||
/// <param name="protocol">Server variable for protocol. This will replace the {protocol} placeholder in server URLs.</param>
|
||||
/// <param name="host">Server variable for host. This will replace the {host} placeholder in server URLs.</param>
|
||||
/// <param name="fullServerUrl">Server variable for full_server_url. This will replace the {full_server_url} placeholder in server URLs.</param>
|
||||
/// <param name="serverUrl">A custom server URL to use instead of the predefined server list. If provided with urlParams, the URL will be templated with the provided parameters.</param>
|
||||
/// <param name="urlParams">A dictionary of parameters to use for templating the serverUrl. Only used when serverUrl is provided.</param>
|
||||
/// <param name="client">A custom HTTP client implementation to use for making API requests. If not provided, the default SpeakeasyHttpClient will be used.</param>
|
||||
/// <param name="retryConfig">Configuration for retry behavior when API requests fail. Defines retry strategies, backoff policies, and maximum retry attempts.</param>
|
||||
/// <exception cref="Exception">Thrown when the serverIndex is out of range (less than 0 or greater than or equal to the server list length).</exception>
|
||||
public PlexAPI(string? token = null, Func<string>? tokenSource = null, Accepts? accepts = null, string? clientIdentifier = null, string? product = null, string? version = null, string? platform = null, string? platformVersion = null, string? device = null, string? model = null, string? deviceVendor = null, string? deviceName = null, string? marketplace = null, int? serverIndex = null, string? identifier = null, string? ipDescription = null, string? port = null, string? protocol = null, string? host = null, string? fullServerUrl = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
if (serverIndex != null)
|
||||
{
|
||||
@@ -372,31 +392,42 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
}
|
||||
Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource = null;
|
||||
|
||||
if(accessTokenSource != null)
|
||||
if(tokenSource != null)
|
||||
{
|
||||
_securitySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessTokenSource() };
|
||||
_securitySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { Token = tokenSource() };
|
||||
}
|
||||
else if(accessToken != null)
|
||||
else if(token != null)
|
||||
{
|
||||
_securitySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessToken };
|
||||
_securitySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { Token = token };
|
||||
}
|
||||
|
||||
SDKConfiguration = new SDKConfig(client)
|
||||
{
|
||||
Accepts = accepts,
|
||||
ClientIdentifier = clientIdentifier,
|
||||
Product = product,
|
||||
Version = version,
|
||||
Platform = platform,
|
||||
PlatformVersion = platformVersion,
|
||||
Device = device,
|
||||
Model = model,
|
||||
DeviceVendor = deviceVendor,
|
||||
DeviceName = deviceName,
|
||||
Marketplace = marketplace,
|
||||
ServerIndex = serverIndex == null ? 0 : serverIndex.Value,
|
||||
ServerUrl = serverUrl == null ? "" : serverUrl,
|
||||
SecuritySource = _securitySource,
|
||||
RetryConfig = retryConfig
|
||||
};
|
||||
|
||||
if (protocol != null)
|
||||
if (identifier != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("protocol", ServerProtocolExtension.Value(protocol.Value));
|
||||
SDKConfiguration.SetServerVariable("identifier", identifier);
|
||||
}
|
||||
|
||||
if (ip != null)
|
||||
if (ipDescription != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("ip", ip);
|
||||
SDKConfiguration.SetServerVariable("IP-description", ipDescription);
|
||||
}
|
||||
|
||||
if (port != null)
|
||||
@@ -404,19 +435,38 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration.SetServerVariable("port", port);
|
||||
}
|
||||
|
||||
if (protocol != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("protocol", protocol);
|
||||
}
|
||||
|
||||
if (host != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("host", host);
|
||||
}
|
||||
|
||||
if (fullServerUrl != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("full_server_url", fullServerUrl);
|
||||
}
|
||||
|
||||
InitHooks();
|
||||
|
||||
Server = new Server(SDKConfiguration);
|
||||
General = new General(SDKConfiguration);
|
||||
|
||||
Media = new Media(SDKConfiguration);
|
||||
Events = new Events(SDKConfiguration);
|
||||
|
||||
Video = new Video(SDKConfiguration);
|
||||
Preferences = new Preferences(SDKConfiguration);
|
||||
|
||||
Rate = new Rate(SDKConfiguration);
|
||||
|
||||
Timeline = new Timeline(SDKConfiguration);
|
||||
|
||||
Activities = new Activities(SDKConfiguration);
|
||||
|
||||
Butler = new Butler(SDKConfiguration);
|
||||
|
||||
Plex = new Plex(SDKConfiguration);
|
||||
DownloadQueue = new DownloadQueue(SDKConfiguration);
|
||||
|
||||
Hubs = new Hubs(SDKConfiguration);
|
||||
|
||||
@@ -424,21 +474,39 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
Library = new Library(SDKConfiguration);
|
||||
|
||||
Watchlist = new Watchlist(SDKConfiguration);
|
||||
Collections = new Collections(SDKConfiguration);
|
||||
|
||||
DVRs = new DVRs(SDKConfiguration);
|
||||
|
||||
Epg = new Epg(SDKConfiguration);
|
||||
|
||||
LiveTV = new LiveTV(SDKConfiguration);
|
||||
|
||||
Log = new Log(SDKConfiguration);
|
||||
|
||||
Playlists = new Playlists(SDKConfiguration);
|
||||
Devices = new Devices(SDKConfiguration);
|
||||
|
||||
Authentication = new Authentication(SDKConfiguration);
|
||||
Provider = new Provider(SDKConfiguration);
|
||||
|
||||
Statistics = new Statistics(SDKConfiguration);
|
||||
Subscriptions = new Subscriptions(SDKConfiguration);
|
||||
|
||||
Sessions = new Sessions(SDKConfiguration);
|
||||
Transcoder = new Transcoder(SDKConfiguration);
|
||||
|
||||
Playlist = new Playlist(SDKConfiguration);
|
||||
|
||||
LibraryPlaylists = new LibraryPlaylists(SDKConfiguration);
|
||||
|
||||
PlayQueue = new PlayQueue(SDKConfiguration);
|
||||
|
||||
UltraBlur = new UltraBlur(SDKConfiguration);
|
||||
|
||||
Status = new Status(SDKConfiguration);
|
||||
|
||||
Updater = new Updater(SDKConfiguration);
|
||||
|
||||
Users = new Users(SDKConfiguration);
|
||||
Content = new Content(SDKConfiguration);
|
||||
|
||||
LibraryCollections = new LibraryCollections(SDKConfiguration);
|
||||
}
|
||||
|
||||
private void InitHooks()
|
||||
@@ -470,15 +538,15 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithProtocol(ServerProtocol protocol)
|
||||
public SDKBuilder WithIdentifier(string identifier)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("protocol", ServerProtocolExtension.Value(protocol));
|
||||
_sdkConfig.SetServerVariable("identifier", identifier);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithIp(string ip)
|
||||
public SDKBuilder WithIPDescription(string ipDescription)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("ip", ip);
|
||||
_sdkConfig.SetServerVariable("IP-description", ipDescription);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -488,6 +556,24 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithProtocol(string protocol)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("protocol", protocol);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithHost(string host)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("host", host);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithFullServerUrl(string fullServerUrl)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("full_server_url", fullServerUrl);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithServerUrl(string serverUrl, Dictionary<string, string>? serverVariables = null)
|
||||
{
|
||||
if (serverVariables != null)
|
||||
@@ -498,15 +584,81 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithAccessTokenSource(Func<string> accessTokenSource)
|
||||
public SDKBuilder WithAccepts(Accepts accepts)
|
||||
{
|
||||
_sdkConfig.SecuritySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessTokenSource() };
|
||||
_sdkConfig.Accepts = accepts;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithAccessToken(string accessToken)
|
||||
public SDKBuilder WithClientIdentifier(string clientIdentifier)
|
||||
{
|
||||
_sdkConfig.SecuritySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessToken };
|
||||
_sdkConfig.ClientIdentifier = clientIdentifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithProduct(string product)
|
||||
{
|
||||
_sdkConfig.Product = product;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithVersion(string version)
|
||||
{
|
||||
_sdkConfig.Version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithPlatform(string platform)
|
||||
{
|
||||
_sdkConfig.Platform = platform;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithPlatformVersion(string platformVersion)
|
||||
{
|
||||
_sdkConfig.PlatformVersion = platformVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithDevice(string device)
|
||||
{
|
||||
_sdkConfig.Device = device;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithModel(string model)
|
||||
{
|
||||
_sdkConfig.Model = model;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithDeviceVendor(string deviceVendor)
|
||||
{
|
||||
_sdkConfig.DeviceVendor = deviceVendor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithDeviceName(string deviceName)
|
||||
{
|
||||
_sdkConfig.DeviceName = deviceName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithMarketplace(string marketplace)
|
||||
{
|
||||
_sdkConfig.Marketplace = marketplace;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithTokenSource(Func<string> tokenSource)
|
||||
{
|
||||
_sdkConfig.SecuritySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { Token = tokenSource() };
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithToken(string token)
|
||||
{
|
||||
_sdkConfig.SecuritySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { Token = token };
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user