mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
52 lines
1.8 KiB
Swift
52 lines
1.8 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct GetDevicesMediaContainer {
|
|
public let device: [Operations.Device]?
|
|
public let identifier: String?
|
|
@DecimalSerialized
|
|
public private(set) var size: Double?
|
|
|
|
/// Creates an object with the specified parameters
|
|
///
|
|
///
|
|
public init(device: [Operations.Device]? = nil, identifier: String? = nil, size: Double? = nil) {
|
|
self.device = device
|
|
self.identifier = identifier
|
|
self._size = DecimalSerialized<Double?>(wrappedValue: size)
|
|
}
|
|
}}
|
|
|
|
extension Operations.GetDevicesMediaContainer: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case device = "Device"
|
|
case identifier
|
|
case size
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
self.device = try container.decodeIfPresent([Operations.Device].self, forKey: .device)
|
|
self.identifier = try container.decodeIfPresent(String.self, forKey: .identifier)
|
|
self._size = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .size) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
}
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(self.device, forKey: .device)
|
|
try container.encodeIfPresent(self.identifier, forKey: .identifier)
|
|
if self.size != nil {
|
|
try container.encode(self._size, forKey: .size)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension Operations.GetDevicesMediaContainer {
|
|
var sizeWrapper: DecimalSerialized<Double?> {
|
|
return _size
|
|
}
|
|
}
|