100-days-of-swiftui-and-com.../day-096/Projects/PadFinder/PadFinder/Networking/Endpoint+LaunchLibraryAPI.s...

44 lines
880 B
Swift
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Endpoint+LaunchLibraryAPI.swift
// PadFinder
//
// Created by CypherPoet on 1/26/20.
//
//
import Foundation
import CypherPoetNetStack
extension Endpoint {
enum LaunchLibraryAPI {
private static let host = "launchlibrary.net"
private static let basePath = "/1.4"
public static func pads(
sizeMode: VerbosityMode = .summary
) -> Endpoint {
.init(
host: self.host,
path: "\(self.basePath)/pad",
queryItems: [
URLQueryItem(name: "mode", value: sizeMode.rawValue)
]
)
}
}
}
extension Endpoint.LaunchLibraryAPI {
/// Specifies how much data to return in each result item
enum VerbosityMode: String {
case list
case summary
case verbose
}
}