mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
78 lines
3.4 KiB
Swift
78 lines
3.4 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct GetRecentlyAddedMediaContainer {
|
|
public let allowSync: Bool?
|
|
public let identifier: String?
|
|
public let mediaTagPrefix: String?
|
|
@DecimalSerialized
|
|
public private(set) var mediaTagVersion: Double?
|
|
public let metadata: [Operations.GetRecentlyAddedMetadata]?
|
|
public let mixedParents: Bool?
|
|
@DecimalSerialized
|
|
public private(set) var size: Double?
|
|
|
|
/// Creates an object with the specified parameters
|
|
///
|
|
///
|
|
public init(allowSync: Bool? = nil, identifier: String? = nil, mediaTagPrefix: String? = nil, mediaTagVersion: Double? = nil, metadata: [Operations.GetRecentlyAddedMetadata]? = nil, mixedParents: Bool? = nil, size: Double? = nil) {
|
|
self.allowSync = allowSync
|
|
self.identifier = identifier
|
|
self.mediaTagPrefix = mediaTagPrefix
|
|
self._mediaTagVersion = DecimalSerialized<Double?>(wrappedValue: mediaTagVersion)
|
|
self.metadata = metadata
|
|
self.mixedParents = mixedParents
|
|
self._size = DecimalSerialized<Double?>(wrappedValue: size)
|
|
}
|
|
}}
|
|
|
|
extension Operations.GetRecentlyAddedMediaContainer: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case allowSync
|
|
case identifier
|
|
case mediaTagPrefix
|
|
case mediaTagVersion
|
|
case metadata = "Metadata"
|
|
case mixedParents
|
|
case size
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
self.allowSync = try container.decodeIfPresent(Bool.self, forKey: .allowSync)
|
|
self.identifier = try container.decodeIfPresent(String.self, forKey: .identifier)
|
|
self.mediaTagPrefix = try container.decodeIfPresent(String.self, forKey: .mediaTagPrefix)
|
|
self._mediaTagVersion = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .mediaTagVersion) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.metadata = try container.decodeIfPresent([Operations.GetRecentlyAddedMetadata].self, forKey: .metadata)
|
|
self.mixedParents = try container.decodeIfPresent(Bool.self, forKey: .mixedParents)
|
|
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.allowSync, forKey: .allowSync)
|
|
try container.encodeIfPresent(self.identifier, forKey: .identifier)
|
|
try container.encodeIfPresent(self.mediaTagPrefix, forKey: .mediaTagPrefix)
|
|
if self.mediaTagVersion != nil {
|
|
try container.encode(self._mediaTagVersion, forKey: .mediaTagVersion)
|
|
}
|
|
try container.encodeIfPresent(self.metadata, forKey: .metadata)
|
|
try container.encodeIfPresent(self.mixedParents, forKey: .mixedParents)
|
|
if self.size != nil {
|
|
try container.encode(self._size, forKey: .size)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension Operations.GetRecentlyAddedMediaContainer {
|
|
var sizeWrapper: DecimalSerialized<Double?> {
|
|
return _size
|
|
}
|
|
var mediaTagVersionWrapper: DecimalSerialized<Double?> {
|
|
return _mediaTagVersion
|
|
}
|
|
}
|