Vernissage/PixelfedKit/Sources/PixelfedKit/Entities/Tag.swift

37 lines
1012 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// https://mczachurski.dev
// Copyright © 2022 Marcin Czachurski and the repository contributors.
// Licensed under the Apache License 2.0.
//
import Foundation
/// Represents a hashtag used within the content of a status.
public struct Tag: Codable {
/// The value of the hashtag after the # sign.
public let name: String
/// A link to the hashtag on the instance.
public let url: String?
/// Usage statistics for given days (typically the past week).
public let history: [TagHistory]?
/// Whether the current tokens authorized user is following this tag.
public let following: Bool?
}
/// Usage statistics for given days.
public struct TagHistory: Codable {
/// UNIX timestamp on midnight of the given day.
public let day: String
/// The counted usage of the tag within that day.
public let uses: String
/// The total of accounts using the tag within that day (cast from an integer).
public let accounts: String
}