metatext/MastodonAPI/Sources/MastodonAPI/Extensions/Timeline+Extensions.swift
2020-09-17 17:16:41 -07:00

22 lines
537 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
import Mastodon
public extension Timeline {
var endpoint: StatusesEndpoint {
switch self {
case .home:
return .timelinesHome
case .local:
return .timelinesPublic(local: true)
case .federated:
return .timelinesPublic(local: false)
case let .list(list):
return .timelinesList(id: list.id)
case let .tag(tag):
return .timelinesTag(tag)
}
}
}