mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 04:20:52 +00:00
39 lines
1.1 KiB
Swift
39 lines
1.1 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
|
|
import Foundation
|
|
|
|
/// The protocol to use for the server connection
|
|
public enum ServerProtocol: String, Codable, APIValue {
|
|
case http = "http"
|
|
case https = "https"
|
|
}
|
|
|
|
enum GlobalServers: Servers, ServerConvertible {
|
|
/// Supported server value with substituted variables
|
|
///
|
|
/// Corresponds to `{protocol}://{ip}:{port}`
|
|
case server1(`protocol`: ServerProtocol = .https, ip: String = "10.10.10.47", port: String = "32400")
|
|
|
|
/// Defines the raw URL strings for each server option.
|
|
///
|
|
/// > Note: You do not need to use these values directly.
|
|
///
|
|
/// The available URL strings are defined as:
|
|
/// ```swift
|
|
/// public static let urlStrings = [
|
|
/// "{protocol}://{ip}:{port}"
|
|
/// ]
|
|
/// ```
|
|
public static let urlStrings = [
|
|
"{protocol}://{ip}:{port}"
|
|
]
|
|
|
|
func server() throws -> Server {
|
|
switch self {
|
|
case .server1(let `protocol`, let ip, let port):
|
|
return try type(of: self).server(at: 0, substituting: ["protocol": `protocol`.rawValue, "ip": ip, "port": port])
|
|
}
|
|
}
|
|
}
|