mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-06 23:39:35 +00:00
31 lines
569 B
Swift
31 lines
569 B
Swift
import Foundation
|
|
|
|
public enum Trends: Endpoint {
|
|
case tags
|
|
case statuses(offset: Int?)
|
|
case links(offset: Int?)
|
|
|
|
public func path() -> String {
|
|
switch self {
|
|
case .tags:
|
|
"trends/tags"
|
|
case .statuses:
|
|
"trends/statuses"
|
|
case .links:
|
|
"trends/links"
|
|
}
|
|
}
|
|
|
|
public func queryItems() -> [URLQueryItem]? {
|
|
switch self {
|
|
case let .statuses(offset), let .links(offset):
|
|
if let offset {
|
|
return [.init(name: "offset", value: String(offset))]
|
|
}
|
|
return nil
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
}
|