jellyfin-sdk-swift/Sources/Entities/PreviousItemRequestDto.swift

30 lines
988 B
Swift
Raw Permalink Normal View History

2022-08-08 20:29:07 +00:00
//
2022-08-16 02:37:47 +00:00
// jellyfin-sdk-swift is subject to the terms of the Mozilla Public
2022-08-08 20:29:07 +00:00
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2022 Jellyfin & Jellyfin Contributors
//
2022-08-08 20:21:06 +00:00
import Foundation
/// Class PreviousItemRequestDto.
public struct PreviousItemRequestDto: Codable {
/// Gets or sets the playing item identifier.
public var playlistItemID: String?
2022-08-08 20:21:06 +00:00
public init(playlistItemID: String? = nil) {
2022-08-08 20:21:06 +00:00
self.playlistItemID = playlistItemID
}
2022-08-17 05:47:00 +00:00
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.playlistItemID = try values.decodeIfPresent(String.self, forKey: "PlaylistItemId")
2022-08-17 05:47:00 +00:00
}
public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(playlistItemID, forKey: "PlaylistItemId")
}
2022-08-08 20:21:06 +00:00
}