2020-07-29 23:50:30 +00:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
2020-08-31 01:40:58 +00:00
|
|
|
import HTTP
|
2020-09-04 01:55:46 +00:00
|
|
|
import Mastodon
|
2020-07-29 23:50:30 +00:00
|
|
|
|
2020-08-30 23:33:11 +00:00
|
|
|
public enum AccountEndpoint {
|
2020-07-29 23:50:30 +00:00
|
|
|
case verifyCredentials
|
|
|
|
}
|
|
|
|
|
2020-08-30 23:59:49 +00:00
|
|
|
extension AccountEndpoint: Endpoint {
|
2020-08-30 23:33:11 +00:00
|
|
|
public typealias ResultType = Account
|
2020-07-29 23:50:30 +00:00
|
|
|
|
2020-08-30 23:33:11 +00:00
|
|
|
public var context: [String] {
|
2020-07-29 23:50:30 +00:00
|
|
|
defaultContext + ["accounts"]
|
|
|
|
}
|
|
|
|
|
2020-08-30 23:33:11 +00:00
|
|
|
public var pathComponentsInContext: [String] {
|
2020-07-29 23:50:30 +00:00
|
|
|
switch self {
|
|
|
|
case .verifyCredentials: return ["verify_credentials"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-30 23:33:11 +00:00
|
|
|
public var method: HTTPMethod {
|
2020-07-29 23:50:30 +00:00
|
|
|
switch self {
|
|
|
|
case .verifyCredentials: return .get
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|