From 65c1477d62a029c56e23e173e67da679df6ec39a Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 16 Apr 2023 20:35:36 +0200 Subject: [PATCH] Added the definition of the "request(endpoint: )" function to the Client public protocol. --- Sources/Communications/Protocols/Client.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/Communications/Protocols/Client.swift b/Sources/Communications/Protocols/Client.swift index 738bf8e..4d1caa5 100644 --- a/Sources/Communications/Protocols/Client.swift +++ b/Sources/Communications/Protocols/Client.swift @@ -6,6 +6,8 @@ // Copyright © 2023 Röck+Cöde. All rights reserved. // +import Foundation + /// This protocol defines a client that will be making the remote calls. public protocol Client { @@ -20,5 +22,10 @@ public protocol Client { endpoint: some Endpoint, as model: Model.Type ) async throws -> Model + + /// Makes a request to a remote location based on a given endpoint and expects to return an original, uncasted response. + /// - Parameter endpoint: The endpoint for which to make a remote call. + /// - Returns: An original data response from a call to a remote endpoint. + @discardableResult func request(endpoint: some Endpoint) async throws -> Data }