2021-01-28 07:52:35 +01:00
|
|
|
//
|
|
|
|
// Mastodon+Entity+Tag.swift
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Created by MainasuK Cirno on 2021/1/28.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
extension Mastodon.Entity {
|
|
|
|
/// Tag
|
|
|
|
///
|
|
|
|
/// - Since: 0.9.0
|
|
|
|
/// - Version: 3.3.0
|
|
|
|
/// # Last Update
|
|
|
|
/// 2021/1/28
|
|
|
|
/// # Reference
|
|
|
|
/// [Document](https://docs.joinmastodon.org/entities/tag/)
|
2022-01-27 14:23:39 +01:00
|
|
|
public struct Tag: Hashable, Codable {
|
|
|
|
|
2021-01-28 07:52:35 +01:00
|
|
|
// Base
|
|
|
|
public let name: String
|
|
|
|
public let url: String
|
|
|
|
|
|
|
|
public let history: [History]?
|
2021-10-18 11:41:43 +02:00
|
|
|
|
2021-04-02 14:45:33 +02:00
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case name
|
|
|
|
case url
|
|
|
|
case history
|
|
|
|
}
|
2022-01-27 14:23:39 +01:00
|
|
|
|
|
|
|
public static func == (lhs: Mastodon.Entity.Tag, rhs: Mastodon.Entity.Tag) -> Bool {
|
|
|
|
return lhs.name == rhs.name
|
|
|
|
&& lhs.url == rhs.url
|
|
|
|
}
|
|
|
|
|
|
|
|
public func hash(into hasher: inout Hasher) {
|
|
|
|
hasher.combine(name)
|
2022-04-13 14:43:16 +02:00
|
|
|
hasher.combine(url)
|
2022-01-27 14:23:39 +01:00
|
|
|
}
|
2021-01-28 07:52:35 +01:00
|
|
|
}
|
|
|
|
}
|