mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 20:57:46 +00:00
34 lines
869 B
Swift
34 lines
869 B
Swift
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public enum Setting {
|
|
case one(Operations.One)
|
|
case two(Operations.Two)
|
|
}
|
|
}
|
|
|
|
extension Operations.Setting: Codable {
|
|
public init(from decoder: Decoder) throws {
|
|
if let value = try? Operations.One(from: decoder) {
|
|
self = .one(value)
|
|
} else if let value = try? Operations.Two(from: decoder) {
|
|
self = .two(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 .two(let value):
|
|
try value.encode(to: encoder)
|
|
}
|
|
}
|
|
}
|
|
|