mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-09 12:47:44 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.153.0
This commit is contained in:
33
Sources/Plexswift/models/operations/Setting.swift
Normal file
33
Sources/Plexswift/models/operations/Setting.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user