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:
@@ -23,15 +23,13 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <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/>
|
||||
/// 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>
|
||||
@@ -39,34 +37,32 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Get Server Activities
|
||||
/// Get all activities
|
||||
///
|
||||
/// <remarks>
|
||||
/// Get Server Activities
|
||||
/// List all activities on the server. Admins can see all activities but other users can only see their own
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerActivitiesResponse> GetServerActivitiesAsync();
|
||||
Task<ListActivitiesResponse> ListActivitiesAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Cancel Server Activities
|
||||
/// Cancel a running activity
|
||||
///
|
||||
/// <remarks>
|
||||
/// Cancel Server Activities
|
||||
/// Cancel a running activity. Admins can cancel all activities but other users can only cancel their own
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID);
|
||||
Task<CancelActivityResponse> CancelActivityAsync(CancelActivityRequest request);
|
||||
}
|
||||
|
||||
/// <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/>
|
||||
/// 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>
|
||||
@@ -74,16 +70,16 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
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";
|
||||
private const string _sdkVersion = "0.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
private const string _openapiDocVersion = "1.1.1";
|
||||
|
||||
public Activities(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
|
||||
public async Task<ListActivitiesResponse> ListActivitiesAsync()
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -97,7 +93,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "listActivities", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -107,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
@@ -138,17 +134,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetServerActivitiesResponseBody obj;
|
||||
ListActivitiesResponseBody obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<ListActivitiesResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetServerActivitiesResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
throw new ResponseValidationException("Failed to deserialize response body into ListActivitiesResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetServerActivitiesResponse()
|
||||
var response = new ListActivitiesResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
@@ -160,48 +156,6 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetServerActivitiesBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetServerActivitiesBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetServerActivitiesBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetServerActivitiesUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetServerActivitiesUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetServerActivitiesUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -214,24 +168,37 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
||||
public async Task<CancelActivityResponse> CancelActivityAsync(CancelActivityRequest request)
|
||||
{
|
||||
var request = new CancelServerActivitiesRequest()
|
||||
if (request == null)
|
||||
{
|
||||
ActivityUUID = activityUUID,
|
||||
};
|
||||
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/{activityUUID}", request);
|
||||
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, "cancelServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "cancelActivity", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -241,7 +208,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
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)
|
||||
@@ -269,56 +236,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
return new CancelServerActivitiesResponse()
|
||||
return new CancelActivityResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
CancelServerActivitiesBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<CancelServerActivitiesBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into CancelServerActivitiesBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new CancelServerActivitiesBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
CancelServerActivitiesUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<CancelServerActivitiesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into CancelServerActivitiesUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new CancelServerActivitiesUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
@@ -1,614 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Calls regarding authentication for Plex Media Server<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public interface IAuthentication
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Get a Transient Token
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope);
|
||||
|
||||
/// <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.<br/>
|
||||
/// Note: requires Plex Media Server >= 1.15.4.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
|
||||
|
||||
/// <summary>
|
||||
/// Get Token Details
|
||||
///
|
||||
/// <remarks>
|
||||
/// Get the User data from the provided X-Plex-Token
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get User Sign In Data
|
||||
///
|
||||
/// <remarks>
|
||||
/// Sign in user with username and password and return user data with Plex authentication token
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API Calls regarding authentication for Plex Media Server<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class Authentication: IAuthentication
|
||||
{
|
||||
/// <summary>
|
||||
/// List of server URLs available for the getTokenDetails operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetTokenDetailsServerList = {
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the post-users-sign-in-data operation.
|
||||
/// </summary>
|
||||
public static readonly string[] PostUsersSignInDataServerList = {
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
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 Authentication(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope)
|
||||
{
|
||||
var request = new GetTransientTokenRequest()
|
||||
{
|
||||
Type = type,
|
||||
Scope = scope,
|
||||
};
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
|
||||
|
||||
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, "getTransientToken", new List<string> { }, 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 == 401 || _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 GetTransientTokenResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTransientTokenBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTransientTokenBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetTransientTokenBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTransientTokenUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTransientTokenUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetTransientTokenUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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(string source)
|
||||
{
|
||||
var request = new GetSourceConnectionInformationRequest()
|
||||
{
|
||||
Source = source,
|
||||
};
|
||||
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);
|
||||
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", new List<string> { }, 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 == 401 || _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 GetSourceConnectionInformationResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetSourceConnectionInformationBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetSourceConnectionInformationBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetSourceConnectionInformationUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetSourceConnectionInformationUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
if (serverUrl != null)
|
||||
{
|
||||
baseUrl = serverUrl;
|
||||
}
|
||||
|
||||
var urlString = baseUrl + "/user";
|
||||
|
||||
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, "getTokenDetails", new List<string> { }, 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 == 401 || _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();
|
||||
GetTokenDetailsUserPlexAccount obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsUserPlexAccount>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsUserPlexAccount.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetTokenDetailsResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
response.UserPlexAccount = obj;
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTokenDetailsBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetTokenDetailsBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTokenDetailsUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetTokenDetailsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
if (serverUrl != null)
|
||||
{
|
||||
baseUrl = serverUrl;
|
||||
}
|
||||
|
||||
var urlString = baseUrl + "/users/signin";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||
if (serializedBody != null)
|
||||
{
|
||||
httpRequest.Content = serializedBody;
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-users-sign-in-data", new List<string> { }, 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 == 401 || _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 == 201)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
PostUsersSignInDataUserPlexAccount obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataUserPlexAccount>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into PostUsersSignInDataUserPlexAccount.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new PostUsersSignInDataResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
response.UserPlexAccount = obj;
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
PostUsersSignInDataBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into PostUsersSignInDataBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new PostUsersSignInDataBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
PostUsersSignInDataUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into PostUsersSignInDataUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new PostUsersSignInDataUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,102 +17,160 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <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 interface IButler
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Get Butler tasks
|
||||
/// Stop all Butler tasks
|
||||
///
|
||||
/// <remarks>
|
||||
/// Returns a list of butler tasks
|
||||
/// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetButlerTasksResponse> GetButlerTasksAsync();
|
||||
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's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:<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/>
|
||||
/// <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<StartAllTasksResponse> StartAllTasksAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Stop all Butler tasks
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StopAllTasksResponse> StopAllTasksAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Start a single Butler task
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:<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<StartTaskResponse> StartTaskAsync(TaskName taskName);
|
||||
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. See the section above for a list of task names for this endpoint.<br/>
|
||||
/// 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(PathParamTaskName taskName);
|
||||
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>
|
||||
/// 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 class Butler: IButler
|
||||
{
|
||||
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";
|
||||
private const string _sdkVersion = "0.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
private const string _openapiDocVersion = "1.1.1";
|
||||
|
||||
public Butler(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
|
||||
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();
|
||||
|
||||
@@ -126,7 +184,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getButlerTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTasks", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -136,7 +194,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
@@ -167,17 +225,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetButlerTasksResponseBody obj;
|
||||
GetTasksResponseBody obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTasksResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetButlerTasksResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTasksResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetButlerTasksResponse()
|
||||
var response = new GetTasksResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
@@ -189,48 +247,6 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetButlerTasksBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetButlerTasksBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetButlerTasksBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetButlerTasksUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetButlerTasksUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetButlerTasksUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -243,7 +259,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
||||
public async Task<StartTasksResponse> StartTasksAsync()
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -257,7 +273,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTasks", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -267,7 +283,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
@@ -295,55 +311,13 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
return new StartAllTasksResponse()
|
||||
return new StartTasksResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StartAllTasksBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StartAllTasksBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StartAllTasksBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StartAllTasksBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StartAllTasksUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StartAllTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StartAllTasksUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StartAllTasksUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -356,21 +330,37 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
||||
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 = baseUrl + "/butler";
|
||||
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, "stopAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTask", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -380,239 +370,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _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 StopAllTasksResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StopAllTasksBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StopAllTasksBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StopAllTasksBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StopAllTasksBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StopAllTasksUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StopAllTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StopAllTasksUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StopAllTasksUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
||||
{
|
||||
var request = new StartTaskRequest()
|
||||
{
|
||||
TaskName = taskName,
|
||||
};
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||
|
||||
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, "startTask", new List<string> { }, 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 == 401 || _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 == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StartTaskBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StartTaskBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StartTaskBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StartTaskBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StartTaskUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StartTaskUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StartTaskUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StartTaskUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
||||
{
|
||||
var request = new StopTaskRequest()
|
||||
{
|
||||
TaskName = taskName,
|
||||
};
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||
|
||||
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, "stopTask", new List<string> { }, 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 == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
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)
|
||||
@@ -647,47 +405,92 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StopTaskBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StopTaskBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StopTaskBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StopTaskBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
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 httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
StopTaskUnauthorizedPayload payload;
|
||||
try
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<StopTaskUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into StopTaskUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new StopTaskUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -22,54 +22,69 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IUsers
|
||||
/// <summary>
|
||||
/// API Operations against the Collections
|
||||
/// </summary>
|
||||
public interface ICollections
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Get list of all connected users
|
||||
/// Create collection
|
||||
///
|
||||
/// <remarks>
|
||||
/// Get list of all users that are friends and have library access with the provided Plex authentication token
|
||||
/// Create a collection in the library
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetUsersResponse> GetUsersAsync(GetUsersRequest request, string? serverUrl = null);
|
||||
Task<CreateCollectionResponse> CreateCollectionAsync(CreateCollectionRequest request);
|
||||
}
|
||||
|
||||
public class Users: IUsers
|
||||
/// <summary>
|
||||
/// API Operations against the Collections
|
||||
/// </summary>
|
||||
public class Collections: ICollections
|
||||
{
|
||||
/// <summary>
|
||||
/// List of server URLs available for the get-users operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetUsersServerList = {
|
||||
"https://plex.tv/api",
|
||||
};
|
||||
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";
|
||||
private const string _sdkVersion = "0.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
private const string _openapiDocVersion = "1.1.1";
|
||||
|
||||
public Users(SDKConfig config)
|
||||
public Collections(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetUsersResponse> GetUsersAsync(GetUsersRequest request, string? serverUrl = null)
|
||||
public async Task<CreateCollectionResponse> CreateCollectionAsync(CreateCollectionRequest request)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetUsersServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
if (serverUrl != null)
|
||||
if (request == null)
|
||||
{
|
||||
baseUrl = serverUrl;
|
||||
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 urlString = baseUrl + "/users";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-users", new List<string> { }, null);
|
||||
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);
|
||||
|
||||
@@ -79,7 +94,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
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)
|
||||
@@ -107,63 +122,32 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/xml", contentType))
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var response = new GetUsersResponse()
|
||||
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.Body = await httpResponse.Content.ReadAsByteArrayAsync();
|
||||
response.MediaContainerWithMetadata = obj;
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetUsersBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetUsersBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetUsersBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetUsersBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetUsersUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetUsersUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetUsersUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetUsersUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
1519
LukeHagar/PlexAPI/SDK/Content.cs
Normal file
1519
LukeHagar/PlexAPI/SDK/Content.cs
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1537
LukeHagar/PlexAPI/SDK/Devices.cs
Normal file
1537
LukeHagar/PlexAPI/SDK/Devices.cs
Normal file
File diff suppressed because it is too large
Load Diff
1032
LukeHagar/PlexAPI/SDK/DownloadQueue.cs
Normal file
1032
LukeHagar/PlexAPI/SDK/DownloadQueue.cs
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
257
LukeHagar/PlexAPI/SDK/Events.cs
Normal file
257
LukeHagar/PlexAPI/SDK/Events.cs
Normal 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.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,81 +23,93 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations with Plex Media Server Statistics<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// General endpoints for basic PMS operation not specific to any media provider
|
||||
/// </summary>
|
||||
public interface IStatistics
|
||||
public interface IGeneral
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Get Media Statistics
|
||||
/// Get PMS info
|
||||
///
|
||||
/// <remarks>
|
||||
/// This will return the media statistics for the server
|
||||
/// Information about this PMS setup and configuration
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null);
|
||||
Task<GetServerInfoResponse> GetServerInfoAsync(GetServerInfoRequest? request = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Resources Statistics
|
||||
/// Get PMS identity
|
||||
///
|
||||
/// <remarks>
|
||||
/// This will return the resources for the server
|
||||
/// Get details about this PMS's identity
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null);
|
||||
Task<GetIdentityResponse> GetIdentityAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Get Bandwidth Statistics
|
||||
/// Get Source Connection Information
|
||||
///
|
||||
/// <remarks>
|
||||
/// This will return the bandwidth statistics for the server
|
||||
/// 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<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null);
|
||||
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'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>
|
||||
/// API Calls that perform operations with Plex Media Server Statistics<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// General endpoints for basic PMS operation not specific to any media provider
|
||||
/// </summary>
|
||||
public class Statistics: IStatistics
|
||||
public class General: IGeneral
|
||||
{
|
||||
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";
|
||||
private const string _sdkVersion = "0.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
private const string _openapiDocVersion = "1.1.1";
|
||||
|
||||
public Statistics(SDKConfig config)
|
||||
public General(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null)
|
||||
public async Task<GetServerInfoResponse> GetServerInfoAsync(GetServerInfoRequest? request = null)
|
||||
{
|
||||
var request = new GetStatisticsRequest()
|
||||
{
|
||||
Timespan = timespan,
|
||||
};
|
||||
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, "/statistics/media", request);
|
||||
|
||||
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, "getStatistics", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerInfo", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -107,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
@@ -138,70 +150,28 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetStatisticsResponseBody obj;
|
||||
MediaContainerWithDirectory obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetStatisticsResponseBody>(httpResponseBody, NullValueHandling.Include);
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<MediaContainerWithDirectory>(httpResponseBody, NullValueHandling.Include);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetStatisticsResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
throw new ResponseValidationException("Failed to deserialize response body into MediaContainerWithDirectory.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetStatisticsResponse()
|
||||
var response = new GetServerInfoResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
response.Object = obj;
|
||||
response.MediaContainerWithDirectory = obj;
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetStatisticsBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetStatisticsBadRequestPayload>(httpResponseBody, NullValueHandling.Include);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetStatisticsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetStatisticsBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetStatisticsUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetStatisticsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Include);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetStatisticsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetStatisticsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -214,24 +184,16 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null)
|
||||
public async Task<GetIdentityResponse> GetIdentityAsync()
|
||||
{
|
||||
var request = new GetResourcesStatisticsRequest()
|
||||
{
|
||||
Timespan = timespan,
|
||||
};
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/statistics/resources", request);
|
||||
|
||||
var urlString = baseUrl + "/identity";
|
||||
|
||||
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, "getResourcesStatistics", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getIdentity", null, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -241,7 +203,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
@@ -272,17 +234,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetResourcesStatisticsResponseBody obj;
|
||||
GetIdentityResponseBody obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetResourcesStatisticsResponseBody>(httpResponseBody, NullValueHandling.Include);
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetIdentityResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetResourcesStatisticsResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetIdentityResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetResourcesStatisticsResponse()
|
||||
var response = new GetIdentityResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
@@ -294,48 +256,6 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetResourcesStatisticsBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetResourcesStatisticsBadRequestPayload>(httpResponseBody, NullValueHandling.Include);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetResourcesStatisticsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetResourcesStatisticsBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetResourcesStatisticsUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetResourcesStatisticsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Include);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetResourcesStatisticsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetResourcesStatisticsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -348,24 +268,37 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null)
|
||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(GetSourceConnectionInformationRequest request)
|
||||
{
|
||||
var request = new GetBandwidthStatisticsRequest()
|
||||
if (request == null)
|
||||
{
|
||||
Timespan = timespan,
|
||||
};
|
||||
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, "/statistics/bandwidth", request);
|
||||
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, "getBandwidthStatistics", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -375,7 +308,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
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)
|
||||
@@ -406,17 +339,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetBandwidthStatisticsResponseBody obj;
|
||||
GetSourceConnectionInformationResponseBody obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetBandwidthStatisticsResponseBody>(httpResponseBody, NullValueHandling.Include);
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetBandwidthStatisticsResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetBandwidthStatisticsResponse()
|
||||
var response = new GetSourceConnectionInformationResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
@@ -428,49 +361,112 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
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();
|
||||
GetBandwidthStatisticsBadRequestPayload payload;
|
||||
GetTransientTokenResponseBody obj;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetBandwidthStatisticsBadRequestPayload>(httpResponseBody, NullValueHandling.Include);
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetBandwidthStatisticsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTransientTokenResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetBandwidthStatisticsBadRequest(payload, httpResponse, httpResponseBody);
|
||||
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 == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetBandwidthStatisticsUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetBandwidthStatisticsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Include);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetBandwidthStatisticsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetBandwidthStatisticsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
else if(responseStatusCode == 400 || responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
@@ -76,7 +76,8 @@ namespace LukeHagar.PlexAPI.SDK.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 LukeHagar.PlexAPI.SDK.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
390
LukeHagar/PlexAPI/SDK/LibraryCollections.cs
Normal file
390
LukeHagar/PlexAPI/SDK/LibraryCollections.cs
Normal 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.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
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
460
LukeHagar/PlexAPI/SDK/LiveTV.cs
Normal file
460
LukeHagar/PlexAPI/SDK/LiveTV.cs
Normal 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.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,215 +15,70 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Submit logs to the Log Handler for Plex Media Server<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// Logging mechanism to allow clients to log to the server
|
||||
/// </summary>
|
||||
public interface ILog
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Logging a single line message.
|
||||
/// 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<LogLineResponse> LogLineAsync(Level level, string message, string source);
|
||||
|
||||
/// <summary>
|
||||
/// Logging a multi-line message
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint allows for the batch addition of log entries to the main Plex Media Server log.<br/>
|
||||
/// It accepts a text/plain request body, where each line represents a distinct log entry.<br/>
|
||||
/// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.<br/>
|
||||
/// <br/>
|
||||
/// Log entries are separated by a newline character (`\n`).<br/>
|
||||
/// Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.<br/>
|
||||
/// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.<br/>
|
||||
/// <br/>
|
||||
/// The 'level' parameter specifies the log entry's severity or importance, with the following integer values:<br/>
|
||||
/// - `0`: Error - Critical issues that require immediate attention.<br/>
|
||||
/// - `1`: Warning - Important events that are not critical but may indicate potential issues.<br/>
|
||||
/// - `2`: Info - General informational messages about system operation.<br/>
|
||||
/// - `3`: Debug - Detailed information useful for debugging purposes.<br/>
|
||||
/// - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.<br/>
|
||||
/// <br/>
|
||||
/// The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).<br/>
|
||||
/// <br/>
|
||||
/// Example of a single log entry format:<br/>
|
||||
/// `level=4&message=Sample%20log%20entry&source=applicationName`<br/>
|
||||
/// <br/>
|
||||
/// Ensure each parameter is properly URL-encoded to avoid interpretation issues.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<LogMultiLineResponse> LogMultiLineAsync(string request);
|
||||
Task<WriteMessageResponse> WriteMessageAsync(WriteMessageRequest? request = null);
|
||||
|
||||
/// <summary>
|
||||
/// Enabling Papertrail
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.<br/>
|
||||
/// 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();
|
||||
Task<EnablePapertrailResponse> EnablePapertrailAsync(EnablePapertrailRequest? request = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Submit logs to the Log Handler for Plex Media Server<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// 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.17.0";
|
||||
private const string _sdkGenVersion = "2.698.4";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _sdkVersion = "0.18.0";
|
||||
private const string _sdkGenVersion = "2.730.5";
|
||||
private const string _openapiDocVersion = "1.1.1";
|
||||
|
||||
public Log(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source)
|
||||
{
|
||||
var request = new LogLineRequest()
|
||||
{
|
||||
Level = level,
|
||||
Message = message,
|
||||
Source = source,
|
||||
};
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/log", request);
|
||||
|
||||
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, "logLine", new List<string> { }, 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 == 401 || _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 LogLineResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
LogLineBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<LogLineBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into LogLineBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new LogLineBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
LogLineUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<LogLineUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into LogLineUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new LogLineUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
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<LogMultiLineResponse> LogMultiLineAsync(string request)
|
||||
public async Task<WriteLogResponse> WriteLogAsync(byte[] request)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -232,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "raw", false, false);
|
||||
if (serializedBody != null)
|
||||
{
|
||||
httpRequest.Content = serializedBody;
|
||||
@@ -243,7 +98,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logMultiLine", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "writeLog", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -253,7 +108,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
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)
|
||||
@@ -281,54 +136,95 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
return new LogMultiLineResponse()
|
||||
return new WriteLogResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
LogMultiLineBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<LogMultiLineBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into LogMultiLineBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new LogMultiLineBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
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 httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
LogMultiLineUnauthorizedPayload payload;
|
||||
try
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<LogMultiLineUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into LogMultiLineUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new LogMultiLineUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
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)
|
||||
{
|
||||
@@ -342,21 +238,33 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
||||
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 urlString = baseUrl + "/log/networked";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
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", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "enablePapertrail", null, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
@@ -366,7 +274,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
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)
|
||||
@@ -394,55 +302,13 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
return new EnablePaperTrailResponse()
|
||||
return new EnablePapertrailResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
EnablePaperTrailBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<EnablePaperTrailBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into EnablePaperTrailBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new EnablePaperTrailBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
EnablePaperTrailUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<EnablePaperTrailUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into EnablePaperTrailUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new EnablePaperTrailUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
|
||||
@@ -3,38 +3,13 @@
|
||||
<PropertyGroup>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||
<Version>0.17.0</Version>
|
||||
<Version>0.18.0</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>
|
||||
<Description># 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/>
|
||||
</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
57
LukeHagar/PlexAPI/SDK/Models/Components/Accepts.cs
Normal file
57
LukeHagar/PlexAPI/SDK/Models/Components/Accepts.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
59
LukeHagar/PlexAPI/SDK/Models/Components/AdvancedSubtitles.cs
Normal file
59
LukeHagar/PlexAPI/SDK/Models/Components/AdvancedSubtitles.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
57
LukeHagar/PlexAPI/SDK/Models/Components/AiringsType.cs
Normal file
57
LukeHagar/PlexAPI/SDK/Models/Components/AiringsType.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,11 +7,11 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
|
||||
public enum OptimizedForStreaming1
|
||||
public enum BoolInt
|
||||
{
|
||||
Zero = 0,
|
||||
One = 1,
|
||||
@@ -7,27 +7,36 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetMetadataChildrenDirectory
|
||||
public class Channel
|
||||
{
|
||||
|
||||
[JsonProperty("leafCount")]
|
||||
public int? LeafCount { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
[JsonProperty("callSign")]
|
||||
public string? CallSign { get; set; }
|
||||
|
||||
[JsonProperty("viewedLeafCount")]
|
||||
public int? ViewedLeafCount { 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("title")]
|
||||
public string? Title { get; set; }
|
||||
[JsonProperty("language")]
|
||||
public string? Language { get; set; }
|
||||
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,24 +7,24 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class Field
|
||||
public class ChannelMapping
|
||||
{
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; } = default!;
|
||||
[JsonProperty("channelKey")]
|
||||
public string? ChannelKey { get; set; }
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; } = default!;
|
||||
[JsonProperty("deviceIdentifier")]
|
||||
public string? DeviceIdentifier { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
[JsonProperty("enabled")]
|
||||
public string? Enabled { get; set; }
|
||||
|
||||
[JsonProperty("subType")]
|
||||
public string? SubType { get; set; }
|
||||
[JsonProperty("lineupIdentifier")]
|
||||
public string? LineupIdentifier { get; set; }
|
||||
}
|
||||
}
|
||||
84
LukeHagar/PlexAPI/SDK/Models/Components/Composite.cs
Normal file
84
LukeHagar/PlexAPI/SDK/Models/Components/Composite.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
62
LukeHagar/PlexAPI/SDK/Models/Components/CompositeMedia.cs
Normal file
62
LukeHagar/PlexAPI/SDK/Models/Components/CompositeMedia.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
60
LukeHagar/PlexAPI/SDK/Models/Components/Crop.cs
Normal file
60
LukeHagar/PlexAPI/SDK/Models/Components/Crop.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
59
LukeHagar/PlexAPI/SDK/Models/Components/Decision.cs
Normal file
59
LukeHagar/PlexAPI/SDK/Models/Components/Decision.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,9 +7,8 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -18,26 +17,26 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
|
||||
public class OptimizedForStreamingType
|
||||
public class DefaultType
|
||||
{
|
||||
private OptimizedForStreamingType(string value) { Value = value; }
|
||||
private DefaultType(string value) { Value = value; }
|
||||
|
||||
public string Value { get; private set; }
|
||||
|
||||
public static OptimizedForStreamingType One { get { return new OptimizedForStreamingType("1"); } }
|
||||
public static DefaultType Str { get { return new DefaultType("str"); } }
|
||||
|
||||
public static OptimizedForStreamingType Boolean { get { return new OptimizedForStreamingType("boolean"); } }
|
||||
public static DefaultType Number { get { return new DefaultType("number"); } }
|
||||
|
||||
public static OptimizedForStreamingType Null { get { return new OptimizedForStreamingType("null"); } }
|
||||
public static DefaultType Boolean { get { return new DefaultType("boolean"); } }
|
||||
|
||||
public override string ToString() { return Value; }
|
||||
public static implicit operator String(OptimizedForStreamingType v) { return v.Value; }
|
||||
public static OptimizedForStreamingType FromString(string v) {
|
||||
public static implicit operator String(DefaultType v) { return v.Value; }
|
||||
public static DefaultType FromString(string v) {
|
||||
switch(v) {
|
||||
case "1": return One;
|
||||
case "str": return Str;
|
||||
case "number": return Number;
|
||||
case "boolean": return Boolean;
|
||||
case "null": return Null;
|
||||
default: throw new ArgumentException("Invalid value for OptimizedForStreamingType");
|
||||
default: throw new ArgumentException("Invalid value for DefaultType");
|
||||
}
|
||||
}
|
||||
public override bool Equals(object? obj)
|
||||
@@ -46,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Value.Equals(((OptimizedForStreamingType)obj).Value);
|
||||
return Value.Equals(((DefaultType)obj).Value);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@@ -57,87 +56,91 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
/// The default value of this setting
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(OptimizedForStreaming.OptimizedForStreamingConverter))]
|
||||
public class OptimizedForStreaming
|
||||
[JsonConverter(typeof(Default.DefaultConverter))]
|
||||
public class Default
|
||||
{
|
||||
public OptimizedForStreaming(OptimizedForStreamingType type)
|
||||
public Default(DefaultType type)
|
||||
{
|
||||
Type = type;
|
||||
}
|
||||
|
||||
[SpeakeasyMetadata("form:explode=true")]
|
||||
public One? One { get; set; }
|
||||
public string? Str { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("form:explode=true")]
|
||||
public double? Number { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("form:explode=true")]
|
||||
public bool? Boolean { get; set; }
|
||||
|
||||
public OptimizedForStreamingType Type { get; set; }
|
||||
public static OptimizedForStreaming CreateOne(One one)
|
||||
public DefaultType Type { get; set; }
|
||||
public static Default CreateStr(string str)
|
||||
{
|
||||
OptimizedForStreamingType typ = OptimizedForStreamingType.One;
|
||||
DefaultType typ = DefaultType.Str;
|
||||
|
||||
OptimizedForStreaming res = new OptimizedForStreaming(typ);
|
||||
res.One = one;
|
||||
Default res = new Default(typ);
|
||||
res.Str = str;
|
||||
return res;
|
||||
}
|
||||
public static OptimizedForStreaming CreateBoolean(bool boolean)
|
||||
public static Default CreateNumber(double number)
|
||||
{
|
||||
OptimizedForStreamingType typ = OptimizedForStreamingType.Boolean;
|
||||
DefaultType typ = DefaultType.Number;
|
||||
|
||||
OptimizedForStreaming res = new OptimizedForStreaming(typ);
|
||||
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 static OptimizedForStreaming CreateNull()
|
||||
public class DefaultConverter : JsonConverter
|
||||
{
|
||||
OptimizedForStreamingType typ = OptimizedForStreamingType.Null;
|
||||
return new OptimizedForStreaming(typ);
|
||||
}
|
||||
|
||||
public class OptimizedForStreamingConverter : JsonConverter
|
||||
{
|
||||
|
||||
public override bool CanConvert(System.Type objectType) => objectType == typeof(OptimizedForStreaming);
|
||||
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)
|
||||
{
|
||||
var json = JRaw.Create(reader).ToString();
|
||||
if (json == "null")
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
return 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
|
||||
{
|
||||
return new OptimizedForStreaming(OptimizedForStreamingType.One)
|
||||
var converted = Convert.ToDouble(json);
|
||||
return new Default(DefaultType.Number)
|
||||
{
|
||||
One = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<One>(json)
|
||||
Number = converted
|
||||
};
|
||||
}
|
||||
catch (ResponseBodyDeserializer.MissingMemberException)
|
||||
{
|
||||
fallbackCandidates.Add((typeof(One), new OptimizedForStreaming(OptimizedForStreamingType.One), "One"));
|
||||
}
|
||||
catch (ResponseBodyDeserializer.DeserializationException)
|
||||
catch (System.FormatException)
|
||||
{
|
||||
// try next option
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var converted = Convert.ToBoolean(json);
|
||||
return new OptimizedForStreaming(OptimizedForStreamingType.Boolean)
|
||||
return new Default(DefaultType.Boolean)
|
||||
{
|
||||
Boolean = converted
|
||||
};
|
||||
@@ -172,21 +175,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
|
||||
{
|
||||
if (value == null) {
|
||||
writer.WriteRawValue("null");
|
||||
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;
|
||||
}
|
||||
|
||||
OptimizedForStreaming res = (OptimizedForStreaming)value;
|
||||
if (OptimizedForStreamingType.FromString(res.Type).Equals(OptimizedForStreamingType.Null))
|
||||
if (res.Number != null)
|
||||
{
|
||||
writer.WriteRawValue("null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.One != null)
|
||||
{
|
||||
writer.WriteRawValue(Utilities.SerializeJSON(res.One));
|
||||
writer.WriteRawValue(Utilities.SerializeJSON(res.Number));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,25 +7,21 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// This default diction of this sort
|
||||
/// </summary>
|
||||
public enum DefaultDirection
|
||||
{
|
||||
[JsonProperty("asc")]
|
||||
Ascending,
|
||||
Asc,
|
||||
[JsonProperty("desc")]
|
||||
Descending,
|
||||
Desc,
|
||||
}
|
||||
|
||||
public static class DefaultDirectionExtension
|
||||
59
LukeHagar/PlexAPI/SDK/Models/Components/Device.cs
Normal file
59
LukeHagar/PlexAPI/SDK/Models/Components/Device.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
68
LukeHagar/PlexAPI/SDK/Models/Components/Directory.cs
Normal file
68
LukeHagar/PlexAPI/SDK/Models/Components/Directory.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
35
LukeHagar/PlexAPI/SDK/Models/Components/Dvr.cs
Normal file
35
LukeHagar/PlexAPI/SDK/Models/Components/Dvr.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
90
LukeHagar/PlexAPI/SDK/Models/Components/Filter.cs
Normal file
90
LukeHagar/PlexAPI/SDK/Models/Components/Filter.cs
Normal 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 "Genre" 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; }
|
||||
}
|
||||
}
|
||||
@@ -7,27 +7,30 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetLibraryDetailsDirectory
|
||||
public class FilterPivot
|
||||
{
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[JsonProperty("secondary")]
|
||||
public bool? Secondary { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
[JsonProperty("prompt")]
|
||||
public string? Prompt { get; set; }
|
||||
[JsonProperty("context")]
|
||||
public string? Context { get; set; }
|
||||
|
||||
[JsonProperty("search")]
|
||||
public bool? Search { get; set; }
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("symbol")]
|
||||
public string? Symbol { get; set; }
|
||||
}
|
||||
}
|
||||
60
LukeHagar/PlexAPI/SDK/Models/Components/Format.cs
Normal file
60
LukeHagar/PlexAPI/SDK/Models/Components/Format.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
25
LukeHagar/PlexAPI/SDK/Models/Components/GetResponses200.cs
Normal file
25
LukeHagar/PlexAPI/SDK/Models/Components/GetResponses200.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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'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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
72
LukeHagar/PlexAPI/SDK/Models/Components/HomeVisibility.cs
Normal file
72
LukeHagar/PlexAPI/SDK/Models/Components/HomeVisibility.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
103
LukeHagar/PlexAPI/SDK/Models/Components/Hub.cs
Normal file
103
LukeHagar/PlexAPI/SDK/Models/Components/Hub.cs
Normal 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'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>
|
||||
/// "A boolean indicating that the hub contains more than what's included in the current response."<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("more")]
|
||||
public bool? More { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicating if the hub should be promoted to the user'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'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; }
|
||||
}
|
||||
}
|
||||
@@ -7,20 +7,37 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
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; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The relative path or absolute url for the image.
|
||||
/// </summary>
|
||||
[JsonProperty("url")]
|
||||
public string? Url { get; set; }
|
||||
}
|
||||
@@ -7,37 +7,39 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the part has a thumbnail.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// Describes both the purpose and intended presentation of the image.
|
||||
/// </summary>
|
||||
public enum GetMediaMetaDataHasThumbnail
|
||||
public enum ImageType
|
||||
{
|
||||
[JsonProperty("0")]
|
||||
False,
|
||||
[JsonProperty("1")]
|
||||
True,
|
||||
[JsonProperty("background")]
|
||||
Background,
|
||||
[JsonProperty("banner")]
|
||||
Banner,
|
||||
[JsonProperty("clearLogo")]
|
||||
ClearLogo,
|
||||
[JsonProperty("coverPoster")]
|
||||
CoverPoster,
|
||||
[JsonProperty("snapshot")]
|
||||
Snapshot,
|
||||
}
|
||||
|
||||
public static class GetMediaMetaDataHasThumbnailExtension
|
||||
public static class ImageTypeExtension
|
||||
{
|
||||
public static string Value(this GetMediaMetaDataHasThumbnail value)
|
||||
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 GetMediaMetaDataHasThumbnail ToEnum(this string value)
|
||||
public static ImageType ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(GetMediaMetaDataHasThumbnail).GetFields())
|
||||
foreach(var field in typeof(ImageType).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
@@ -50,14 +52,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is GetMediaMetaDataHasThumbnail)
|
||||
if (enumVal is ImageType)
|
||||
{
|
||||
return (GetMediaMetaDataHasThumbnail)enumVal;
|
||||
return (ImageType)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum GetMediaMetaDataHasThumbnail");
|
||||
throw new Exception($"Unknown value {value} for enum ImageType");
|
||||
}
|
||||
}
|
||||
|
||||
409
LukeHagar/PlexAPI/SDK/Models/Components/Items.cs
Normal file
409
LukeHagar/PlexAPI/SDK/Models/Components/Items.cs
Normal 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 "metadata items." These metadata items are distinct from "media items" 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 "media item" will have one or more "media parts" 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'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, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" 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'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'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'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's original title, e.g. a movie'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'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'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'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; }
|
||||
}
|
||||
}
|
||||
86
LukeHagar/PlexAPI/SDK/Models/Components/LibrarySection.cs
Normal file
86
LukeHagar/PlexAPI/SDK/Models/Components/LibrarySection.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -7,27 +7,24 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
/// <summary>
|
||||
/// Attributes associated with the marker.
|
||||
/// Represents a top-level location on disk where media in this library section is stored
|
||||
/// </summary>
|
||||
public class GetMediaMetaDataAttributes
|
||||
public class LibrarySectionLocation
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The identifier for the attributes.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; } = default!;
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The version number of the marker attributes.
|
||||
/// The path of where this directory exists on disk
|
||||
/// </summary>
|
||||
[JsonProperty("version")]
|
||||
public long? Version { get; set; }
|
||||
[JsonProperty("path")]
|
||||
public object? Path { get; set; }
|
||||
}
|
||||
}
|
||||
52
LukeHagar/PlexAPI/SDK/Models/Components/Lineup.cs
Normal file
52
LukeHagar/PlexAPI/SDK/Models/Components/Lineup.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
36
LukeHagar/PlexAPI/SDK/Models/Components/LineupType.cs
Normal file
36
LukeHagar/PlexAPI/SDK/Models/Components/LineupType.cs
Normal 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,
|
||||
}
|
||||
|
||||
}
|
||||
59
LukeHagar/PlexAPI/SDK/Models/Components/Location.cs
Normal file
59
LukeHagar/PlexAPI/SDK/Models/Components/Location.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
84
LukeHagar/PlexAPI/SDK/Models/Components/Media.cs
Normal file
84
LukeHagar/PlexAPI/SDK/Models/Components/Media.cs
Normal 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'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; }
|
||||
}
|
||||
}
|
||||
53
LukeHagar/PlexAPI/SDK/Models/Components/MediaContainer.cs
Normal file
53
LukeHagar/PlexAPI/SDK/Models/Components/MediaContainer.cs
Normal 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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -7,35 +7,32 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GetLibraryDetailsType
|
||||
public class MediaContainerWithArtworkMetadata
|
||||
{
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The title of the item
|
||||
/// </summary>
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[JsonProperty("active")]
|
||||
public bool? Active { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public MediaContainerWithArtworkType? Type { get; set; }
|
||||
|
||||
[JsonProperty("Filter")]
|
||||
public List<GetLibraryDetailsFilter>? Filter { get; set; }
|
||||
/// <summary>
|
||||
/// The path to the artwork
|
||||
/// </summary>
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("Sort")]
|
||||
public List<GetLibraryDetailsSort>? Sort { get; set; }
|
||||
|
||||
[JsonProperty("Field")]
|
||||
public List<GetLibraryDetailsField>? Field { get; set; }
|
||||
[JsonProperty("additionalProperties")]
|
||||
public Dictionary<string, object>? AdditionalProperties { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 "hoisted" 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'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'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; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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'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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "metadata items." These metadata items are distinct from "media items" 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 "media item" will have one or more "media parts" 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'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, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" 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'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'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'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's original title, e.g. a movie'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'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'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'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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "part" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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 MediaContainerWithNestedMetadataMediaContainer
|
||||
{
|
||||
|
||||
[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("MetadataItem")]
|
||||
public List<MetadataItem>? MetadataItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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 MediaContainerWithPlaylistMetadata
|
||||
{
|
||||
|
||||
[JsonProperty("MediaContainer")]
|
||||
public MediaContainerWithPlaylistMetadataMediaContainer? MediaContainer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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 MediaContainerWithPlaylistMetadataMediaContainer
|
||||
{
|
||||
|
||||
[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<MediaContainerWithPlaylistMetadataMetadata>? Metadata { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,430 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 "metadata items." These metadata items are distinct from "media items" 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 "media item" will have one or more "media parts" 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'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, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class MediaContainerWithPlaylistMetadataMetadata
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// If we return this as true then this playlist cannot be altered or deleted directly by the client.
|
||||
/// </summary>
|
||||
[JsonProperty("readOnly")]
|
||||
public bool? ReadOnly { 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>
|
||||
/// When present, the duration for the item, in units of milliseconds.
|
||||
/// </summary>
|
||||
[JsonProperty("duration")]
|
||||
public long? Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key at which the item'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>
|
||||
/// For shows and seasons, contains the number of total episodes.
|
||||
/// </summary>
|
||||
[JsonProperty("leafCount")]
|
||||
public long? LeafCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of the playlist.
|
||||
/// </summary>
|
||||
[JsonProperty("playlistType")]
|
||||
public Models.Components.PlaylistType? PlaylistType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the playlist is smart.
|
||||
/// </summary>
|
||||
[JsonProperty("smart")]
|
||||
public bool? Smart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If this is a special playlist, this returns its type (e.g. favorites).
|
||||
/// </summary>
|
||||
[JsonProperty("specialPlaylistType")]
|
||||
public string? SpecialPlaylistType { get; set; }
|
||||
|
||||
/// <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>
|
||||
/// 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>
|
||||
/// Typically only seen in metadata at a library'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>
|
||||
/// 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; }
|
||||
|
||||
[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'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's original title, e.g. a movie'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'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'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'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; }
|
||||
}
|
||||
}
|
||||
@@ -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 MediaContainerWithSettings
|
||||
{
|
||||
|
||||
[JsonProperty("MediaContainer")]
|
||||
public MediaContainerWithSettingsMediaContainer? MediaContainer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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 MediaContainerWithSettingsMediaContainer
|
||||
{
|
||||
|
||||
[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("Setting")]
|
||||
public List<Setting>? Setting { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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 MediaContainerWithSubscription
|
||||
{
|
||||
|
||||
[JsonProperty("MediaContainer")]
|
||||
public MediaContainerWithSubscriptionMediaContainer? MediaContainer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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 "hoists" 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 MediaContainerWithSubscriptionMediaContainer
|
||||
{
|
||||
|
||||
[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("MediaSubscription")]
|
||||
public List<Models.Components.MediaSubscription>? MediaSubscription { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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>
|
||||
/// A media grab opration represents a scheduled or active recording of media<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class MediaGrabOperation
|
||||
{
|
||||
|
||||
[JsonProperty("currentSize")]
|
||||
public long? CurrentSize { get; set; }
|
||||
|
||||
[JsonProperty("grabberIdentifier")]
|
||||
public string? GrabberIdentifier { get; set; }
|
||||
|
||||
[JsonProperty("grabberProtocol")]
|
||||
public string? GrabberProtocol { get; set; }
|
||||
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("mediaIndex")]
|
||||
public long? MediaIndex { get; set; }
|
||||
|
||||
[JsonProperty("mediaSubscriptionID")]
|
||||
public long? MediaSubscriptionID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Items in a library are referred to as "metadata items." These metadata items are distinct from "media items" 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 "media item" will have one or more "media parts" 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'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, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("Metadata")]
|
||||
public Models.Components.Metadata? Metadata { get; set; }
|
||||
|
||||
[JsonProperty("percent")]
|
||||
public double? Percent { get; set; }
|
||||
|
||||
[JsonProperty("provider")]
|
||||
public string? Provider { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public Models.Components.Status? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
|
||||
public class SharedSources
|
||||
public class MediaQuery
|
||||
{
|
||||
}
|
||||
}
|
||||
99
LukeHagar/PlexAPI/SDK/Models/Components/MediaSubscription.cs
Normal file
99
LukeHagar/PlexAPI/SDK/Models/Components/MediaSubscription.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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>
|
||||
/// A media subscription contains a representation of metadata desired to be recorded<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class MediaSubscription
|
||||
{
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The metadata type of the root item of the subscription
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
public long? Type { get; set; }
|
||||
|
||||
[JsonProperty("airingsType")]
|
||||
public AiringsType? AiringsType { get; set; }
|
||||
|
||||
[JsonProperty("createdAt")]
|
||||
public long? CreatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Media Matching Hints
|
||||
/// </summary>
|
||||
[JsonProperty("Directory")]
|
||||
public Dictionary<string, object>? Directory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Only included if `includeStorage` is specified
|
||||
/// </summary>
|
||||
[JsonProperty("durationTotal")]
|
||||
public long? DurationTotal { get; set; }
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("librarySectionTitle")]
|
||||
public string? LibrarySectionTitle { get; set; }
|
||||
|
||||
[JsonProperty("locationPath")]
|
||||
public string? LocationPath { get; set; }
|
||||
|
||||
[JsonProperty("MediaGrabOperation")]
|
||||
public List<MediaGrabOperation>? MediaGrabOperation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Media Matching Hints
|
||||
/// </summary>
|
||||
[JsonProperty("Playlist")]
|
||||
public Dictionary<string, object>? Playlist { get; set; }
|
||||
|
||||
[JsonProperty("Setting")]
|
||||
public List<Setting>? Setting { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Only included if `includeStorage` is specified
|
||||
/// </summary>
|
||||
[JsonProperty("storageTotal")]
|
||||
public long? StorageTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The library section id for where the item is to be recorded
|
||||
/// </summary>
|
||||
[JsonProperty("targetLibrarySectionID")]
|
||||
public long? TargetLibrarySectionID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The library section location id for where the item is to be recorded
|
||||
/// </summary>
|
||||
[JsonProperty("targetSectionLocationID")]
|
||||
public long? TargetSectionLocationID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Media Matching Hints
|
||||
/// </summary>
|
||||
[JsonProperty("Video")]
|
||||
public Dictionary<string, object>? Video { get; set; }
|
||||
}
|
||||
}
|
||||
406
LukeHagar/PlexAPI/SDK/Models/Components/Metadata.cs
Normal file
406
LukeHagar/PlexAPI/SDK/Models/Components/Metadata.cs
Normal 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 "metadata items." These metadata items are distinct from "media items" 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 "media item" will have one or more "media parts" 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'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, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class Metadata
|
||||
{
|
||||
|
||||
/// <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'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'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'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's original title, e.g. a movie'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'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'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'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; }
|
||||
}
|
||||
}
|
||||
409
LukeHagar/PlexAPI/SDK/Models/Components/MetadataItem.cs
Normal file
409
LukeHagar/PlexAPI/SDK/Models/Components/MetadataItem.cs
Normal 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 "metadata items." These metadata items are distinct from "media items" 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 "media item" will have one or more "media parts" 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'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, "leaves" refer to metadata items which has associated media (there is no media for a season nor show). A show will have "children" in the form of seasons and a season will have "children" in the form of episodes and episodes have "parent" in the form of a season which has a "parent" in the form of a show. Similarly, a show has "grandchildren" in the form of episodse and an episode has a "grandparent" in the form of a show.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class MetadataItem
|
||||
{
|
||||
|
||||
/// <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'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'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'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's original title, e.g. a movie'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'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'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's release (e.g. release year for a movie).
|
||||
/// </summary>
|
||||
[JsonProperty("year")]
|
||||
public long? Year { get; set; }
|
||||
|
||||
[JsonProperty("MetadataItem")]
|
||||
public List<Items>? MetadataItemValue { get; set; }
|
||||
|
||||
[JsonProperty("additionalProperties")]
|
||||
public Dictionary<string, object>? AdditionalProperties { get; set; }
|
||||
}
|
||||
}
|
||||
78
LukeHagar/PlexAPI/SDK/Models/Components/Part.cs
Normal file
78
LukeHagar/PlexAPI/SDK/Models/Components/Part.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 "part" 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 Part
|
||||
{
|
||||
|
||||
[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<Stream>? Stream { get; set; }
|
||||
|
||||
[JsonProperty("videoProfile")]
|
||||
public object? VideoProfile { get; set; }
|
||||
|
||||
[JsonProperty("additionalProperties")]
|
||||
public Dictionary<string, object>? AdditionalProperties { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
@@ -15,21 +15,21 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class Pivot
|
||||
{
|
||||
|
||||
[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("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[JsonProperty("context")]
|
||||
public string? Context { get; set; }
|
||||
|
||||
[JsonProperty("symbol")]
|
||||
public string? Symbol { get; set; }
|
||||
}
|
||||
@@ -7,57 +7,105 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
/// <summary>
|
||||
/// Information about the player being used for playback
|
||||
/// </summary>
|
||||
public class Player
|
||||
{
|
||||
|
||||
[JsonProperty("address")]
|
||||
public string? Address { get; set; }
|
||||
|
||||
[JsonProperty("machineIdentifier")]
|
||||
public string? MachineIdentifier { get; set; }
|
||||
|
||||
[JsonProperty("model")]
|
||||
public string? Model { get; set; }
|
||||
|
||||
[JsonProperty("platform")]
|
||||
public string? Platform { get; set; }
|
||||
|
||||
[JsonProperty("platformVersion")]
|
||||
public string? PlatformVersion { get; set; }
|
||||
|
||||
[JsonProperty("product")]
|
||||
public string? Product { get; set; }
|
||||
|
||||
[JsonProperty("profile")]
|
||||
public string? Profile { get; set; }
|
||||
|
||||
[JsonProperty("remotePublicAddress")]
|
||||
public string? RemotePublicAddress { get; set; }
|
||||
|
||||
[JsonProperty("state")]
|
||||
public string? State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The title of the client
|
||||
/// </summary>
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[JsonProperty("version")]
|
||||
public string? Version { get; set; }
|
||||
/// <summary>
|
||||
/// The remote address
|
||||
/// </summary>
|
||||
[JsonProperty("address")]
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicating if the client is playing from the local LAN
|
||||
/// </summary>
|
||||
[JsonProperty("local")]
|
||||
public bool? Local { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The identifier of the client
|
||||
/// </summary>
|
||||
[JsonProperty("machineIdentifier")]
|
||||
public string? MachineIdentifier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The model of the client
|
||||
/// </summary>
|
||||
[JsonProperty("model")]
|
||||
public string? Model { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The platform of the client
|
||||
/// </summary>
|
||||
[JsonProperty("platform")]
|
||||
public string? Platform { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The platformVersion of the client
|
||||
/// </summary>
|
||||
[JsonProperty("platformVersion")]
|
||||
public string? PlatformVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The product name of the client
|
||||
/// </summary>
|
||||
[JsonProperty("product")]
|
||||
public string? Product { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicating if the client is playing over a relay connection
|
||||
/// </summary>
|
||||
[JsonProperty("relayed")]
|
||||
public bool? Relayed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client's public address
|
||||
/// </summary>
|
||||
[JsonProperty("remotePublicAddress")]
|
||||
public string? RemotePublicAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicating if the client is playing over HTTPS
|
||||
/// </summary>
|
||||
[JsonProperty("secure")]
|
||||
public bool? Secure { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client's last reported state
|
||||
/// </summary>
|
||||
[JsonProperty("state")]
|
||||
public string? State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The id of the user
|
||||
/// </summary>
|
||||
[JsonProperty("userID")]
|
||||
public int? UserID { get; set; }
|
||||
public long? UserID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The vendor of the client
|
||||
/// </summary>
|
||||
[JsonProperty("vendor")]
|
||||
public string? Vendor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The version of the client
|
||||
/// </summary>
|
||||
[JsonProperty("version")]
|
||||
public string? Version { get; set; }
|
||||
}
|
||||
}
|
||||
62
LukeHagar/PlexAPI/SDK/Models/Components/PlaylistType.cs
Normal file
62
LukeHagar/PlexAPI/SDK/Models/Components/PlaylistType.cs
Normal 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 type of the playlist.
|
||||
/// </summary>
|
||||
public enum PlaylistType
|
||||
{
|
||||
[JsonProperty("audio")]
|
||||
Audio,
|
||||
[JsonProperty("video")]
|
||||
Video,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
}
|
||||
|
||||
public static class PlaylistTypeExtension
|
||||
{
|
||||
public static string Value(this PlaylistType value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static PlaylistType ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(PlaylistType).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 PlaylistType)
|
||||
{
|
||||
return (PlaylistType)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum PlaylistType");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
25
LukeHagar/PlexAPI/SDK/Models/Components/PostResponses200.cs
Normal file
25
LukeHagar/PlexAPI/SDK/Models/Components/PostResponses200.cs
Normal 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 PostResponses200
|
||||
{
|
||||
|
||||
[JsonProperty("MediaContainer")]
|
||||
public PostResponses200MediaContainer? MediaContainer { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user