Files
plexswift/Sources/Plexswift/models/operations/GetServerIdentityMediaContainer.swift
2024-04-11 11:10:38 -05:00

58 lines
2.1 KiB
Swift

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
import Foundation
extension Operations {
/// A model object
public struct GetServerIdentityMediaContainer {
public let claimed: Bool?
public let machineIdentifier: String?
@DecimalSerialized
public private(set) var size: Double?
public let version: String?
/// Creates an object with the specified parameters
///
///
public init(claimed: Bool? = nil, machineIdentifier: String? = nil, size: Double? = nil, version: String? = nil) {
self.claimed = claimed
self.machineIdentifier = machineIdentifier
self._size = DecimalSerialized<Double?>(wrappedValue: size)
self.version = version
}
}
}
extension Operations.GetServerIdentityMediaContainer: Codable {
enum CodingKeys: String, CodingKey {
case claimed
case machineIdentifier
case size
case version
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.claimed = try container.decodeIfPresent(Bool.self, forKey: .claimed)
self.machineIdentifier = try container.decodeIfPresent(String.self, forKey: .machineIdentifier)
self._size = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .size) ?? DecimalSerialized<Double?>(wrappedValue: nil)
self.version = try container.decodeIfPresent(String.self, forKey: .version)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(self.claimed, forKey: .claimed)
try container.encodeIfPresent(self.machineIdentifier, forKey: .machineIdentifier)
if self.size != nil {
try container.encode(self._size, forKey: .size)
}
try container.encodeIfPresent(self.version, forKey: .version)
}
}
extension Operations.GetServerIdentityMediaContainer {
var sizeWrapper: DecimalSerialized<Double?> {
return _size
}
}