Tusker/Pachyderm/Model/Instance.swift

57 lines
1.4 KiB
Swift
Raw Normal View History

2018-09-11 14:52:21 +00:00
//
// Instance.swift
// Pachyderm
//
// Created by Shadowfacts on 9/9/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import Foundation
public class Instance: Decodable {
2018-09-11 14:52:21 +00:00
public let uri: String
public let title: String
public let description: String
public let email: String
public let version: String
public let urls: [String: URL]
2018-09-30 02:20:17 +00:00
// pleroma doesn't currently implement these
public let languages: [String]?
public let contactAccount: Account?
2018-09-11 14:52:21 +00:00
// MARK: Unofficial additions to the Mastodon API.
public let stats: Stats?
public let thumbnail: URL?
public let maxStatusCharacters: Int?
private enum CodingKeys: String, CodingKey {
case uri
case title
case description
case email
case version
case urls
case languages
case contactAccount = "contact_account"
case stats
case thumbnail
case maxStatusCharacters = "max_toot_chars"
}
}
extension Instance {
public class Stats: Decodable {
public let domainCount: Int?
public let statusCount: Int?
public let userCount: Int?
private enum CodingKeys: String, CodingKey {
case domainCount = "domain_count"
case statusCount = "status_count"
case userCount = "user_count"
}
}
}