mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-09 12:37:46 +00:00
Regenerated SDK with small changes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
@@ -11,7 +10,10 @@
|
||||
namespace PlexAPI
|
||||
{
|
||||
using Newtonsoft.Json;
|
||||
using PlexAPI.Hooks;
|
||||
using PlexAPI.Models.Components;
|
||||
using PlexAPI.Models.Errors;
|
||||
using PlexAPI.Utils.Retries;
|
||||
using PlexAPI.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
@@ -19,9 +21,6 @@ namespace PlexAPI
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The protocol to use when connecting to your plex server.
|
||||
/// </summary>
|
||||
public enum ServerProtocol
|
||||
{
|
||||
[JsonProperty("http")]
|
||||
@@ -124,6 +123,15 @@ namespace PlexAPI
|
||||
/// </summary>
|
||||
public IButler Butler { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations directly against https://Plex.tv<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IPlex Plex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/>
|
||||
///
|
||||
@@ -160,15 +168,6 @@ namespace PlexAPI
|
||||
/// </summary>
|
||||
public ILog Log { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations directly against https://Plex.tv<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IPlex Plex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). <br/>
|
||||
///
|
||||
@@ -217,6 +216,15 @@ namespace PlexAPI
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IUpdater Updater { get; }
|
||||
|
||||
/// <summary>
|
||||
/// API Calls that perform operations with Plex Media Server Watchlists<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public IWatchlist Watchlist { get; }
|
||||
}
|
||||
|
||||
public class SDKConfig
|
||||
@@ -228,17 +236,31 @@ namespace PlexAPI
|
||||
"{protocol}://{ip}:{port}",
|
||||
};
|
||||
|
||||
public string serverUrl = "";
|
||||
public int serverIndex = 0;
|
||||
public string ServerUrl = "";
|
||||
public int ServerIndex = 0;
|
||||
public List<Dictionary<string, string>> ServerDefaults = new List<Dictionary<string, string>>();
|
||||
public string? XPlexClientIdentifier;
|
||||
public SDKHooks Hooks = new SDKHooks();
|
||||
public RetryConfig? RetryConfig = null;
|
||||
|
||||
public string GetTemplatedServerDetails()
|
||||
public string GetTemplatedServerUrl()
|
||||
{
|
||||
if (!String.IsNullOrEmpty(this.serverUrl))
|
||||
if (!String.IsNullOrEmpty(this.ServerUrl))
|
||||
{
|
||||
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.serverUrl, "/"), new Dictionary<string, string>());
|
||||
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
|
||||
}
|
||||
return Utilities.TemplateUrl(SDKConfig.ServerList[this.serverIndex], this.ServerDefaults[this.serverIndex]);
|
||||
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], this.ServerDefaults[this.ServerIndex]);
|
||||
}
|
||||
|
||||
public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client)
|
||||
{
|
||||
string preHooksUrl = GetTemplatedServerUrl();
|
||||
var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client);
|
||||
if (preHooksUrl != postHooksUrl)
|
||||
{
|
||||
this.ServerUrl = postHooksUrl;
|
||||
}
|
||||
return postHooksClient;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,31 +276,32 @@ namespace PlexAPI
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.2.1";
|
||||
private const string _sdkGenVersion = "2.281.2";
|
||||
private const string _sdkVersion = "0.3.0";
|
||||
private const string _sdkGenVersion = "2.354.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
|
||||
private string _serverUrl = "";
|
||||
private int _serverIndex = 0;
|
||||
private ISpeakeasyHttpClient _defaultClient;
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<Security>? _securitySource;
|
||||
public IServer Server { get; private set; }
|
||||
public IMedia Media { get; private set; }
|
||||
public IVideo Video { get; private set; }
|
||||
public IActivities Activities { get; private set; }
|
||||
public IButler Butler { get; private set; }
|
||||
public IPlex Plex { get; private set; }
|
||||
public IHubs Hubs { get; private set; }
|
||||
public ISearch Search { get; private set; }
|
||||
public ILibrary Library { get; private set; }
|
||||
public ILog Log { get; private set; }
|
||||
public IPlex Plex { get; private set; }
|
||||
public IPlaylists Playlists { get; private set; }
|
||||
public IAuthentication Authentication { get; private set; }
|
||||
public IStatistics Statistics { get; private set; }
|
||||
public ISessions Sessions { get; private set; }
|
||||
public IUpdater Updater { get; private set; }
|
||||
public IWatchlist Watchlist { get; private set; }
|
||||
|
||||
public PlexAPISDK(string? accessToken = null, Func<string>? accessTokenSource = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null)
|
||||
public PlexAPISDK(string? accessToken = null, Func<string>? accessTokenSource = null, string? xPlexClientIdentifier = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
if (serverIndex != null)
|
||||
{
|
||||
@@ -307,7 +330,7 @@ namespace PlexAPI
|
||||
},
|
||||
};
|
||||
|
||||
_defaultClient = new SpeakeasyHttpClient(client);
|
||||
_client = client ?? new SpeakeasyHttpClient();
|
||||
|
||||
if(accessTokenSource != null)
|
||||
{
|
||||
@@ -324,26 +347,62 @@ namespace PlexAPI
|
||||
|
||||
SDKConfiguration = new SDKConfig()
|
||||
{
|
||||
XPlexClientIdentifier = xPlexClientIdentifier,
|
||||
ServerDefaults = serverDefaults,
|
||||
serverIndex = _serverIndex,
|
||||
serverUrl = _serverUrl
|
||||
ServerIndex = _serverIndex,
|
||||
ServerUrl = _serverUrl,
|
||||
RetryConfig = retryConfig
|
||||
};
|
||||
|
||||
Server = new Server(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Media = new Media(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Video = new Video(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Activities = new Activities(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Butler = new Butler(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Hubs = new Hubs(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Search = new Search(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Library = new Library(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Log = new Log(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Plex = new Plex(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Playlists = new Playlists(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Authentication = new Authentication(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Statistics = new Statistics(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Sessions = new Sessions(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Updater = new Updater(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||
_client = SDKConfiguration.InitHooks(_client);
|
||||
|
||||
|
||||
Server = new Server(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Media = new Media(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Video = new Video(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Activities = new Activities(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Butler = new Butler(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Plex = new Plex(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Hubs = new Hubs(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Search = new Search(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Library = new Library(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Log = new Log(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Playlists = new Playlists(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Authentication = new Authentication(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Statistics = new Statistics(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Sessions = new Sessions(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Updater = new Updater(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Watchlist = new Watchlist(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user