mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
115 lines
5.1 KiB
Swift
115 lines
5.1 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct GetLibraryItemsMedia {
|
|
@DecimalSerialized
|
|
public private(set) var aspectRatio: Double
|
|
public let audioChannels: Int
|
|
public let audioCodec: String
|
|
public let bitrate: Int
|
|
public let container: String
|
|
public let duration: Int
|
|
public let height: Int
|
|
public let id: Int
|
|
public let part: [Operations.GetLibraryItemsPart]
|
|
public let videoCodec: String
|
|
public let videoFrameRate: String
|
|
public let videoProfile: String
|
|
public let videoResolution: String
|
|
public let width: Int
|
|
public let audioProfile: String?
|
|
public let hasVoiceActivity: Bool?
|
|
|
|
/// Creates an object with the specified parameters
|
|
///
|
|
///
|
|
public init(aspectRatio: Double, audioChannels: Int, audioCodec: String, bitrate: Int, container: String, duration: Int, height: Int, id: Int, part: [Operations.GetLibraryItemsPart], videoCodec: String, videoFrameRate: String, videoProfile: String, videoResolution: String, width: Int, audioProfile: String? = nil, hasVoiceActivity: Bool? = nil) {
|
|
self._aspectRatio = DecimalSerialized<Double>(wrappedValue: aspectRatio)
|
|
self.audioChannels = audioChannels
|
|
self.audioCodec = audioCodec
|
|
self.bitrate = bitrate
|
|
self.container = container
|
|
self.duration = duration
|
|
self.height = height
|
|
self.id = id
|
|
self.part = part
|
|
self.videoCodec = videoCodec
|
|
self.videoFrameRate = videoFrameRate
|
|
self.videoProfile = videoProfile
|
|
self.videoResolution = videoResolution
|
|
self.width = width
|
|
self.audioProfile = audioProfile
|
|
self.hasVoiceActivity = hasVoiceActivity
|
|
}
|
|
}}
|
|
|
|
extension Operations.GetLibraryItemsMedia: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case aspectRatio
|
|
case audioChannels
|
|
case audioCodec
|
|
case bitrate
|
|
case container
|
|
case duration
|
|
case height
|
|
case id
|
|
case part = "Part"
|
|
case videoCodec
|
|
case videoFrameRate
|
|
case videoProfile
|
|
case videoResolution
|
|
case width
|
|
case audioProfile
|
|
case hasVoiceActivity
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
self._aspectRatio = try container.decode(DecimalSerialized<Double>.self, forKey: .aspectRatio)
|
|
self.audioChannels = try container.decode(Int.self, forKey: .audioChannels)
|
|
self.audioCodec = try container.decode(String.self, forKey: .audioCodec)
|
|
self.bitrate = try container.decode(Int.self, forKey: .bitrate)
|
|
self.container = try container.decode(String.self, forKey: .container)
|
|
self.duration = try container.decode(Int.self, forKey: .duration)
|
|
self.height = try container.decode(Int.self, forKey: .height)
|
|
self.id = try container.decode(Int.self, forKey: .id)
|
|
self.part = try container.decode([Operations.GetLibraryItemsPart].self, forKey: .part)
|
|
self.videoCodec = try container.decode(String.self, forKey: .videoCodec)
|
|
self.videoFrameRate = try container.decode(String.self, forKey: .videoFrameRate)
|
|
self.videoProfile = try container.decode(String.self, forKey: .videoProfile)
|
|
self.videoResolution = try container.decode(String.self, forKey: .videoResolution)
|
|
self.width = try container.decode(Int.self, forKey: .width)
|
|
self.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile)
|
|
self.hasVoiceActivity = try container.decodeIfPresent(Bool.self, forKey: .hasVoiceActivity)
|
|
}
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encode(self._aspectRatio, forKey: .aspectRatio)
|
|
try container.encode(self.audioChannels, forKey: .audioChannels)
|
|
try container.encode(self.audioCodec, forKey: .audioCodec)
|
|
try container.encode(self.bitrate, forKey: .bitrate)
|
|
try container.encode(self.container, forKey: .container)
|
|
try container.encode(self.duration, forKey: .duration)
|
|
try container.encode(self.height, forKey: .height)
|
|
try container.encode(self.id, forKey: .id)
|
|
try container.encode(self.part, forKey: .part)
|
|
try container.encode(self.videoCodec, forKey: .videoCodec)
|
|
try container.encode(self.videoFrameRate, forKey: .videoFrameRate)
|
|
try container.encode(self.videoProfile, forKey: .videoProfile)
|
|
try container.encode(self.videoResolution, forKey: .videoResolution)
|
|
try container.encode(self.width, forKey: .width)
|
|
try container.encodeIfPresent(self.audioProfile, forKey: .audioProfile)
|
|
try container.encodeIfPresent(self.hasVoiceActivity, forKey: .hasVoiceActivity)
|
|
}
|
|
}
|
|
|
|
extension Operations.GetLibraryItemsMedia {
|
|
var aspectRatioWrapper: DecimalSerialized<Double> {
|
|
return _aspectRatio
|
|
}
|
|
}
|