metatext-app-ios-iphone-ipad/Mastodon/Sources/Mastodon/Networking/Mastodon API/Endpoints/ContextEndpoint.swift

25 lines
514 B
Swift
Raw Normal View History

2020-08-20 00:16:03 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
2020-08-31 01:33:11 +02:00
public enum ContextEndpoint {
2020-08-20 00:16:03 +02:00
case context(id: String)
}
extension ContextEndpoint: MastodonEndpoint {
2020-08-31 01:33:11 +02:00
public typealias ResultType = MastodonContext
2020-08-20 00:16:03 +02:00
2020-08-31 01:33:11 +02:00
public var context: [String] {
2020-08-20 00:16:03 +02:00
defaultContext + ["statuses"]
}
2020-08-31 01:33:11 +02:00
public var pathComponentsInContext: [String] {
2020-08-20 00:16:03 +02:00
switch self {
case let .context(id):
return [id, "context"]
}
}
2020-08-31 01:33:11 +02:00
public var method: HTTPMethod { .get }
2020-08-20 00:16:03 +02:00
}