mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
190 lines
9.4 KiB
Swift
190 lines
9.4 KiB
Swift
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct TranscodeSession {
|
|
@DecimalSerialized
|
|
public private(set) var audioChannels: Double?
|
|
public let audioCodec: String?
|
|
public let audioDecision: String?
|
|
public let complete: Bool?
|
|
public let container: String?
|
|
public let context: String?
|
|
@DecimalSerialized
|
|
public private(set) var duration: Double?
|
|
public let error: Bool?
|
|
public let key: String?
|
|
@DecimalSerialized
|
|
public private(set) var maxOffsetAvailable: Double?
|
|
@DecimalSerialized
|
|
public private(set) var minOffsetAvailable: Double?
|
|
@DecimalSerialized
|
|
public private(set) var progress: Double?
|
|
public let `protocol`: String?
|
|
@DecimalSerialized
|
|
public private(set) var size: Double?
|
|
public let sourceAudioCodec: String?
|
|
public let sourceVideoCodec: String?
|
|
@DecimalSerialized
|
|
public private(set) var speed: Double?
|
|
public let throttled: Bool?
|
|
@DecimalSerialized
|
|
public private(set) var timeStamp: Double?
|
|
public let transcodeHwRequested: Bool?
|
|
public let videoCodec: String?
|
|
public let videoDecision: String?
|
|
|
|
/// Creates an object with the specified parameters
|
|
///
|
|
///
|
|
public init(audioChannels: Double? = nil, audioCodec: String? = nil, audioDecision: String? = nil, complete: Bool? = nil, container: String? = nil, context: String? = nil, duration: Double? = nil, error: Bool? = nil, key: String? = nil, maxOffsetAvailable: Double? = nil, minOffsetAvailable: Double? = nil, progress: Double? = nil, `protocol`: String? = nil, size: Double? = nil, sourceAudioCodec: String? = nil, sourceVideoCodec: String? = nil, speed: Double? = nil, throttled: Bool? = nil, timeStamp: Double? = nil, transcodeHwRequested: Bool? = nil, videoCodec: String? = nil, videoDecision: String? = nil) {
|
|
self._audioChannels = DecimalSerialized<Double?>(wrappedValue: audioChannels)
|
|
self.audioCodec = audioCodec
|
|
self.audioDecision = audioDecision
|
|
self.complete = complete
|
|
self.container = container
|
|
self.context = context
|
|
self._duration = DecimalSerialized<Double?>(wrappedValue: duration)
|
|
self.error = error
|
|
self.key = key
|
|
self._maxOffsetAvailable = DecimalSerialized<Double?>(wrappedValue: maxOffsetAvailable)
|
|
self._minOffsetAvailable = DecimalSerialized<Double?>(wrappedValue: minOffsetAvailable)
|
|
self._progress = DecimalSerialized<Double?>(wrappedValue: progress)
|
|
self.`protocol` = `protocol`
|
|
self._size = DecimalSerialized<Double?>(wrappedValue: size)
|
|
self.sourceAudioCodec = sourceAudioCodec
|
|
self.sourceVideoCodec = sourceVideoCodec
|
|
self._speed = DecimalSerialized<Double?>(wrappedValue: speed)
|
|
self.throttled = throttled
|
|
self._timeStamp = DecimalSerialized<Double?>(wrappedValue: timeStamp)
|
|
self.transcodeHwRequested = transcodeHwRequested
|
|
self.videoCodec = videoCodec
|
|
self.videoDecision = videoDecision
|
|
}
|
|
}
|
|
}
|
|
|
|
extension Operations.TranscodeSession: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case audioChannels
|
|
case audioCodec
|
|
case audioDecision
|
|
case complete
|
|
case container
|
|
case context
|
|
case duration
|
|
case error
|
|
case key
|
|
case maxOffsetAvailable
|
|
case minOffsetAvailable
|
|
case progress
|
|
case `protocol` = "protocol"
|
|
case size
|
|
case sourceAudioCodec
|
|
case sourceVideoCodec
|
|
case speed
|
|
case throttled
|
|
case timeStamp
|
|
case transcodeHwRequested
|
|
case videoCodec
|
|
case videoDecision
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
self._audioChannels = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .audioChannels) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec)
|
|
self.audioDecision = try container.decodeIfPresent(String.self, forKey: .audioDecision)
|
|
self.complete = try container.decodeIfPresent(Bool.self, forKey: .complete)
|
|
self.container = try container.decodeIfPresent(String.self, forKey: .container)
|
|
self.context = try container.decodeIfPresent(String.self, forKey: .context)
|
|
self._duration = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .duration) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.error = try container.decodeIfPresent(Bool.self, forKey: .error)
|
|
self.key = try container.decodeIfPresent(String.self, forKey: .key)
|
|
self._maxOffsetAvailable = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .maxOffsetAvailable) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self._minOffsetAvailable = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .minOffsetAvailable) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self._progress = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .progress) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.`protocol` = try container.decodeIfPresent(String.self, forKey: .`protocol`)
|
|
self._size = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .size) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.sourceAudioCodec = try container.decodeIfPresent(String.self, forKey: .sourceAudioCodec)
|
|
self.sourceVideoCodec = try container.decodeIfPresent(String.self, forKey: .sourceVideoCodec)
|
|
self._speed = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .speed) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.throttled = try container.decodeIfPresent(Bool.self, forKey: .throttled)
|
|
self._timeStamp = try container.decodeIfPresent(DecimalSerialized<Double?>.self, forKey: .timeStamp) ?? DecimalSerialized<Double?>(wrappedValue: nil)
|
|
self.transcodeHwRequested = try container.decodeIfPresent(Bool.self, forKey: .transcodeHwRequested)
|
|
self.videoCodec = try container.decodeIfPresent(String.self, forKey: .videoCodec)
|
|
self.videoDecision = try container.decodeIfPresent(String.self, forKey: .videoDecision)
|
|
}
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
if self.audioChannels != nil {
|
|
try container.encode(self._audioChannels, forKey: .audioChannels)
|
|
}
|
|
try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec)
|
|
try container.encodeIfPresent(self.audioDecision, forKey: .audioDecision)
|
|
try container.encodeIfPresent(self.complete, forKey: .complete)
|
|
try container.encodeIfPresent(self.container, forKey: .container)
|
|
try container.encodeIfPresent(self.context, forKey: .context)
|
|
if self.duration != nil {
|
|
try container.encode(self._duration, forKey: .duration)
|
|
}
|
|
try container.encodeIfPresent(self.error, forKey: .error)
|
|
try container.encodeIfPresent(self.key, forKey: .key)
|
|
if self.maxOffsetAvailable != nil {
|
|
try container.encode(self._maxOffsetAvailable, forKey: .maxOffsetAvailable)
|
|
}
|
|
if self.minOffsetAvailable != nil {
|
|
try container.encode(self._minOffsetAvailable, forKey: .minOffsetAvailable)
|
|
}
|
|
if self.progress != nil {
|
|
try container.encode(self._progress, forKey: .progress)
|
|
}
|
|
try container.encodeIfPresent(self.`protocol`, forKey: .`protocol`)
|
|
if self.size != nil {
|
|
try container.encode(self._size, forKey: .size)
|
|
}
|
|
try container.encodeIfPresent(self.sourceAudioCodec, forKey: .sourceAudioCodec)
|
|
try container.encodeIfPresent(self.sourceVideoCodec, forKey: .sourceVideoCodec)
|
|
if self.speed != nil {
|
|
try container.encode(self._speed, forKey: .speed)
|
|
}
|
|
try container.encodeIfPresent(self.throttled, forKey: .throttled)
|
|
if self.timeStamp != nil {
|
|
try container.encode(self._timeStamp, forKey: .timeStamp)
|
|
}
|
|
try container.encodeIfPresent(self.transcodeHwRequested, forKey: .transcodeHwRequested)
|
|
try container.encodeIfPresent(self.videoCodec, forKey: .videoCodec)
|
|
try container.encodeIfPresent(self.videoDecision, forKey: .videoDecision)
|
|
}
|
|
}
|
|
|
|
extension Operations.TranscodeSession {
|
|
var progressWrapper: DecimalSerialized<Double?> {
|
|
return _progress
|
|
}
|
|
var sizeWrapper: DecimalSerialized<Double?> {
|
|
return _size
|
|
}
|
|
var speedWrapper: DecimalSerialized<Double?> {
|
|
return _speed
|
|
}
|
|
var durationWrapper: DecimalSerialized<Double?> {
|
|
return _duration
|
|
}
|
|
var audioChannelsWrapper: DecimalSerialized<Double?> {
|
|
return _audioChannels
|
|
}
|
|
var timeStampWrapper: DecimalSerialized<Double?> {
|
|
return _timeStamp
|
|
}
|
|
var maxOffsetAvailableWrapper: DecimalSerialized<Double?> {
|
|
return _maxOffsetAvailable
|
|
}
|
|
var minOffsetAvailableWrapper: DecimalSerialized<Double?> {
|
|
return _minOffsetAvailable
|
|
}
|
|
}
|