metatext/Mastodon/Sources/Mastodon/Networking/Mastodon API/Endpoints/ListEndpoint.swift
Justin Mazzocchi 9b59e2fbea
wip
2020-08-30 16:33:32 -07:00

37 lines
712 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
public enum ListEndpoint {
case create(title: String)
}
extension ListEndpoint: MastodonEndpoint {
public typealias ResultType = MastodonList
public var context: [String] {
defaultContext + ["lists"]
}
public var pathComponentsInContext: [String] {
switch self {
case .create:
return []
}
}
public var parameters: [String: Any]? {
switch self {
case let .create(title):
return ["title": title]
}
}
public var method: HTTPMethod {
switch self {
case .create:
return .post
}
}
}