//------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ #nullable enable namespace LukeHagar.PlexAPI.SDK { using LukeHagar.PlexAPI.SDK.Hooks; using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils.Retries; using System; using System.Collections.Generic; using System.Linq; public struct SDKConfig { /// /// List of server URLs available to the SDK. /// public static readonly string[] ServerList = { "https://{IP-description}.{identifier}.plex.direct:{port}", "{protocol}://{host}:{port}", "https://{full_server_url}", }; public ISpeakeasyHttpClient Client; public string ServerUrl; public int ServerIndex; public List> ServerVariables; public Accepts? Accepts; public string? ClientIdentifier; public string? Product; public string? Version; public string? Platform; public string? PlatformVersion; public string? Device; public string? Model; public string? DeviceVendor; public string? DeviceName; public string? Marketplace; public string UserAgent; public Func? SecuritySource; public SDKHooks Hooks; public RetryConfig? RetryConfig; /// /// Initializes a new instance of the SDKConfig struct with default values. /// public SDKConfig(ISpeakeasyHttpClient? client = null) { Client = client ?? new SpeakeasyHttpClient(); ServerUrl = ""; ServerIndex = 0; ServerVariables = new List>() { new Dictionary() { {"identifier", "0123456789abcdef0123456789abcdef"}, {"IP-description", "1-2-3-4"}, {"port", "32400"}, }, new Dictionary() { {"protocol", "http"}, {"host", "localhost"}, {"port", "32400"}, }, new Dictionary() { {"full_server_url", "http://localhost:32400"}, }, }; Accepts = null; ClientIdentifier = null; Product = null; Version = null; Platform = null; PlatformVersion = null; Device = null; Model = null; DeviceVendor = null; DeviceName = null; Marketplace = null; UserAgent = "speakeasy-sdk/csharp 0.18.0 2.730.5 1.1.1 LukeHagar.PlexAPI.SDK"; SecuritySource = null; Hooks = new SDKHooks(); RetryConfig = null; } public void SetServerVariable(string key, string value) { foreach (var serverVariables in this.ServerVariables.Where(dict => dict.ContainsKey(key))) { serverVariables[key] = value; } } public string GetTemplatedServerUrl() { if (!String.IsNullOrEmpty(this.ServerUrl)) { return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); } return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], this.ServerVariables[this.ServerIndex]); } } }