mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-07 12:47:45 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6
This commit is contained in:
@@ -3,7 +3,30 @@
|
||||
import Foundation
|
||||
|
||||
extension Operations {
|
||||
public enum OptimizedForStreaming: Int, Codable, APIValue {
|
||||
case disable = 0
|
||||
case enable = 1
|
||||
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
public enum OptimizedForStreaming {
|
||||
case one(Operations.One)
|
||||
case bool(Bool)
|
||||
}}
|
||||
|
||||
extension Operations.OptimizedForStreaming: Codable {
|
||||
public init(from decoder: Decoder) throws {
|
||||
if let value = try? Operations.One(from: decoder) {
|
||||
self = .one(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 .one(let value):
|
||||
try value.encode(to: encoder)
|
||||
case .bool(let value):
|
||||
try value.encode(to: encoder)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user