Files
plexswift/Sources/Plexswift/models/operations/GetRecentlyAddedOptimizedForStreaming.swift

33 lines
1.0 KiB
Swift

// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
import Foundation
extension Operations {
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
public enum GetRecentlyAddedOptimizedForStreaming {
case getRecentlyAdded1(Operations.GetRecentlyAdded1)
case bool(Bool)
}}
extension Operations.GetRecentlyAddedOptimizedForStreaming: Codable {
public init(from decoder: Decoder) throws {
if let value = try? Operations.GetRecentlyAdded1(from: decoder) {
self = .getRecentlyAdded1(value)
} else if let value = try? Bool(from: decoder) {
self = .bool(value)
} else {
throw PlexswiftError.failedToHandleResponse(.failedToDecodeResponse)
}
}
public func encode(to encoder: Encoder) throws {
switch self {
case .getRecentlyAdded1(let value):
try value.encode(to: encoder)
case .bool(let value):
try value.encode(to: encoder)
}
}
}