mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 04:20:52 +00:00
140 lines
6.3 KiB
Swift
140 lines
6.3 KiB
Swift
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
extension Operations {
|
|
/// A model object
|
|
public struct GetMediaMetaDataMedia {
|
|
/// Aspect ratio of the video.
|
|
@DecimalSerialized
|
|
public private(set) var aspectRatio: Double
|
|
/// Number of audio channels.
|
|
public let audioChannels: Int
|
|
/// Audio codec used.
|
|
public let audioCodec: String
|
|
/// Bitrate in bits per second.
|
|
public let bitrate: Int
|
|
/// File container type.
|
|
public let container: String
|
|
/// Duration of the media in milliseconds.
|
|
public let duration: Int
|
|
/// Indicates whether voice activity is detected.
|
|
public let hasVoiceActivity: Bool
|
|
/// Video height in pixels.
|
|
public let height: Int
|
|
/// Unique media identifier.
|
|
public let id: Int
|
|
/// An array of parts for this media item.
|
|
public let part: [Operations.GetMediaMetaDataPart]
|
|
/// Video codec used.
|
|
public let videoCodec: String
|
|
/// Frame rate of the video (e.g., 24p).
|
|
public let videoFrameRate: String
|
|
/// Video profile (e.g., main 10).
|
|
public let videoProfile: String
|
|
/// Video resolution (e.g., 4k).
|
|
public let videoResolution: String
|
|
/// Video width in pixels.
|
|
public let width: Int
|
|
|
|
/// Creates an object with the specified parameters
|
|
///
|
|
/// - Parameter aspectRatio: Aspect ratio of the video.
|
|
/// - Parameter audioChannels: Number of audio channels.
|
|
/// - Parameter audioCodec: Audio codec used.
|
|
/// - Parameter bitrate: Bitrate in bits per second.
|
|
/// - Parameter container: File container type.
|
|
/// - Parameter duration: Duration of the media in milliseconds.
|
|
/// - Parameter hasVoiceActivity: Indicates whether voice activity is detected.
|
|
/// - Parameter height: Video height in pixels.
|
|
/// - Parameter id: Unique media identifier.
|
|
/// - Parameter part: An array of parts for this media item.
|
|
/// - Parameter videoCodec: Video codec used.
|
|
/// - Parameter videoFrameRate: Frame rate of the video (e.g., 24p).
|
|
/// - Parameter videoProfile: Video profile (e.g., main 10).
|
|
/// - Parameter videoResolution: Video resolution (e.g., 4k).
|
|
/// - Parameter width: Video width in pixels.
|
|
///
|
|
public init(aspectRatio: Double, audioChannels: Int, audioCodec: String, bitrate: Int, container: String, duration: Int, hasVoiceActivity: Bool, height: Int, id: Int, part: [Operations.GetMediaMetaDataPart], videoCodec: String, videoFrameRate: String, videoProfile: String, videoResolution: String, width: Int) {
|
|
self._aspectRatio = DecimalSerialized<Double>(wrappedValue: aspectRatio)
|
|
self.audioChannels = audioChannels
|
|
self.audioCodec = audioCodec
|
|
self.bitrate = bitrate
|
|
self.container = container
|
|
self.duration = duration
|
|
self.hasVoiceActivity = hasVoiceActivity
|
|
self.height = height
|
|
self.id = id
|
|
self.part = part
|
|
self.videoCodec = videoCodec
|
|
self.videoFrameRate = videoFrameRate
|
|
self.videoProfile = videoProfile
|
|
self.videoResolution = videoResolution
|
|
self.width = width
|
|
}
|
|
}}
|
|
|
|
extension Operations.GetMediaMetaDataMedia: Codable {
|
|
enum CodingKeys: String, CodingKey {
|
|
case aspectRatio
|
|
case audioChannels
|
|
case audioCodec
|
|
case bitrate
|
|
case container
|
|
case duration
|
|
case hasVoiceActivity
|
|
case height
|
|
case id
|
|
case part = "Part"
|
|
case videoCodec
|
|
case videoFrameRate
|
|
case videoProfile
|
|
case videoResolution
|
|
case width
|
|
}
|
|
|
|
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.hasVoiceActivity = try container.decode(Bool.self, forKey: .hasVoiceActivity)
|
|
self.height = try container.decode(Int.self, forKey: .height)
|
|
self.id = try container.decode(Int.self, forKey: .id)
|
|
self.part = try container.decode([Operations.GetMediaMetaDataPart].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)
|
|
}
|
|
|
|
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.hasVoiceActivity, forKey: .hasVoiceActivity)
|
|
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)
|
|
}
|
|
}
|
|
|
|
extension Operations.GetMediaMetaDataMedia {
|
|
var aspectRatioWrapper: DecimalSerialized<Double> {
|
|
return _aspectRatio
|
|
}
|
|
}
|