IceCubesApp/Packages/Network/Sources/Network/Endpoint/Tags.swift

26 lines
468 B
Swift
Raw Normal View History

2022-12-21 11:39:29 +00:00
import Foundation
public enum Tags: Endpoint {
case tag(id: String)
case follow(id: String)
case unfollow(id: String)
2023-01-17 10:36:01 +00:00
2022-12-21 11:39:29 +00:00
public func path() -> String {
switch self {
2023-01-17 10:36:01 +00:00
case let .tag(id):
2022-12-21 11:39:29 +00:00
return "tags/\(id)/"
2023-01-17 10:36:01 +00:00
case let .follow(id):
2022-12-21 11:39:29 +00:00
return "tags/\(id)/follow"
2023-01-17 10:36:01 +00:00
case let .unfollow(id):
2022-12-21 11:39:29 +00:00
return "tags/\(id)/unfollow"
}
}
2023-01-17 10:36:01 +00:00
2022-12-21 11:39:29 +00:00
public func queryItems() -> [URLQueryItem]? {
switch self {
default:
return nil
}
}
}