mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-08 12:47:44 +00:00
70 lines
2.4 KiB
Swift
70 lines
2.4 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct Connections {
|
|
public let address: String
|
|
public let iPv6: Bool
|
|
public let local: Bool
|
|
@DecimalSerialized
|
|
public private(set) var port: Double
|
|
public let `protocol`: String
|
|
public let relay: Bool
|
|
public let uri: String
|
|
|
|
/// Creates an object with the specified parameters
|
|
///
|
|
///
|
|
public init(address: String, iPv6: Bool, local: Bool, port: Double, `protocol`: String, relay: Bool, uri: String) {
|
|
self.address = address
|
|
self.iPv6 = iPv6
|
|
self.local = local
|
|
self._port = DecimalSerialized<Double>(wrappedValue: port)
|
|
self.`protocol` = `protocol`
|
|
self.relay = relay
|
|
self.uri = uri
|
|
}
|
|
}}
|
|
|
|
extension Operations.Connections: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case address
|
|
case iPv6 = "IPv6"
|
|
case local
|
|
case port
|
|
case `protocol` = "protocol"
|
|
case relay
|
|
case uri
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
self.address = try container.decode(String.self, forKey: .address)
|
|
self.iPv6 = try container.decode(Bool.self, forKey: .iPv6)
|
|
self.local = try container.decode(Bool.self, forKey: .local)
|
|
self._port = try container.decode(DecimalSerialized<Double>.self, forKey: .port)
|
|
self.`protocol` = try container.decode(String.self, forKey: .`protocol`)
|
|
self.relay = try container.decode(Bool.self, forKey: .relay)
|
|
self.uri = try container.decode(String.self, forKey: .uri)
|
|
}
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encode(self.address, forKey: .address)
|
|
try container.encode(self.iPv6, forKey: .iPv6)
|
|
try container.encode(self.local, forKey: .local)
|
|
try container.encode(self._port, forKey: .port)
|
|
try container.encode(self.`protocol`, forKey: .`protocol`)
|
|
try container.encode(self.relay, forKey: .relay)
|
|
try container.encode(self.uri, forKey: .uri)
|
|
}
|
|
}
|
|
|
|
extension Operations.Connections {
|
|
var portWrapper: DecimalSerialized<Double> {
|
|
return _port
|
|
}
|
|
}
|