mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-09 12:47:44 +00:00
Regeneration
This commit is contained in:
37
Sources/Plexswift/configuration/GlobalParameters.swift
Normal file
37
Sources/Plexswift/configuration/GlobalParameters.swift
Normal file
@@ -0,0 +1,37 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Describes common parameters which can be used when making API requests.
|
||||
///
|
||||
/// > Note: These parameters may be overridden by individual API operations
|
||||
public struct GlobalParameters {
|
||||
public let xPlexClientIdentifier: String?
|
||||
|
||||
/// Creates an object with the given parameters
|
||||
///
|
||||
/// - Parameter xPlexClientIdentifier: The unique identifier for the client application
|
||||
/// This is used to track the client application and its usage
|
||||
/// (UUID, serial number, or other number unique per device)
|
||||
///
|
||||
///
|
||||
public init(
|
||||
xPlexClientIdentifier: String? = nil
|
||||
) {
|
||||
self.xPlexClientIdentifier = xPlexClientIdentifier
|
||||
}
|
||||
}
|
||||
|
||||
extension GlobalParameters: ParameterDefaults {
|
||||
public func defaultSerializedPathParameter(for key: String) throws -> String? {
|
||||
switch key {
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
public func defaultQueryParameter(for key: String) -> AnyValue? {
|
||||
switch key {
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Sources/Plexswift/configuration/GlobalServer.swift
Normal file
38
Sources/Plexswift/configuration/GlobalServer.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The protocol to use when connecting to your plex server.
|
||||
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 = .http, 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])
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user