mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-02 04:50:59 +00:00
39 lines
883 B
Swift
39 lines
883 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
enum DeletionEndpoint {
|
|
case oauthRevoke(token: String, clientID: String, clientSecret: String)
|
|
}
|
|
|
|
extension DeletionEndpoint: MastodonEndpoint {
|
|
typealias ResultType = [String: String]
|
|
|
|
var context: [String] {
|
|
switch self {
|
|
case .oauthRevoke:
|
|
return []
|
|
}
|
|
}
|
|
|
|
var pathComponentsInContext: [String] {
|
|
switch self {
|
|
case .oauthRevoke:
|
|
return ["oauth", "revoke"]
|
|
}
|
|
}
|
|
|
|
var method: HTTPMethod {
|
|
switch self {
|
|
case .oauthRevoke:
|
|
return .post
|
|
}
|
|
}
|
|
|
|
var parameters: [String: Any]? {
|
|
switch self {
|
|
case let .oauthRevoke(token, clientID, clientSecret):
|
|
return ["token": token, "client_id": clientID, "client_secret": clientSecret]
|
|
}
|
|
}
|
|
}
|