mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-09 12:47:44 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.314.2
This commit is contained in:
33
Sources/Plexswift/models/operations/LibrarySectionID.swift
Normal file
33
Sources/Plexswift/models/operations/LibrarySectionID.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 LibrarySectionID {
|
||||
case integer(Int)
|
||||
case string(String)
|
||||
}
|
||||
}
|
||||
|
||||
extension Operations.LibrarySectionID: Codable {
|
||||
public init(from decoder: Decoder) throws {
|
||||
if let value = try? Int(from: decoder) {
|
||||
self = .integer(value)
|
||||
} else if let value = try? String(from: decoder) {
|
||||
self = .string(value)
|
||||
} else {
|
||||
throw PlexswiftError.failedToHandleResponse(.failedToDecodeResponse)
|
||||
}
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
switch self {
|
||||
case .integer(let value):
|
||||
try value.encode(to: encoder)
|
||||
case .string(let value):
|
||||
try value.encode(to: encoder)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user