|
|
|
|
@ -55,6 +55,15 @@ public class Services { |
|
|
|
|
|
|
|
|
|
// MARK: - Base |
|
|
|
|
|
|
|
|
|
/// Runs a request on the API and returns the appropriate response |
|
|
|
|
/// - Parameters: |
|
|
|
|
/// - path: the path of the service in the api, ie. "create-users/" |
|
|
|
|
/// - method: the HTTP method to call |
|
|
|
|
/// - requiresToken: whether the token must be included in the request |
|
|
|
|
public func run<U: Decodable>(path: String, method: HTTPMethod, requiresToken: Bool) async throws -> U { |
|
|
|
|
return try await self._runRequest(serviceCall: ServiceCall(path: path, method: method, requiresToken: requiresToken)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Runs a request using a configuration object |
|
|
|
|
/// - Parameters: |
|
|
|
|
/// - serviceConf: A instance of ServiceConf |
|
|
|
|
|