forked from shadowfacts/Tusker
parent
2916d7a72d
commit
caab5e357a
|
@ -13,7 +13,7 @@ public class Attachment: Codable {
|
||||||
public let kind: Kind
|
public let kind: Kind
|
||||||
public let url: URL
|
public let url: URL
|
||||||
public let remoteURL: URL?
|
public let remoteURL: URL?
|
||||||
public let previewURL: URL
|
public let previewURL: URL?
|
||||||
public let textURL: URL?
|
public let textURL: URL?
|
||||||
public let meta: Metadata?
|
public let meta: Metadata?
|
||||||
public let description: String?
|
public let description: String?
|
||||||
|
@ -30,11 +30,11 @@ public class Attachment: Codable {
|
||||||
self.id = try container.decode(String.self, forKey: .id)
|
self.id = try container.decode(String.self, forKey: .id)
|
||||||
self.kind = try container.decode(Kind.self, forKey: .kind)
|
self.kind = try container.decode(Kind.self, forKey: .kind)
|
||||||
self.url = try container.decode(URL.self, forKey: .url)
|
self.url = try container.decode(URL.self, forKey: .url)
|
||||||
self.previewURL = try container.decode(URL.self, forKey: .previewURL)
|
self.previewURL = try? container.decode(URL?.self, forKey: .previewURL)
|
||||||
self.remoteURL = try? container.decode(URL.self, forKey: .remoteURL)
|
self.remoteURL = try? container.decode(URL?.self, forKey: .remoteURL)
|
||||||
self.textURL = try? container.decode(URL.self, forKey: .textURL)
|
self.textURL = try? container.decode(URL?.self, forKey: .textURL)
|
||||||
self.meta = try? container.decode(Metadata.self, forKey: .meta)
|
self.meta = try? container.decode(Metadata?.self, forKey: .meta)
|
||||||
self.description = try? container.decode(String.self, forKey: .description)
|
self.description = try? container.decode(String?.self, forKey: .description)
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
|
Loading…
Reference in New Issue