From e5b511d22626af6404516b113e4fe1fb3d7a15fb Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Wed, 19 Apr 2023 00:49:33 +0200 Subject: [PATCH] Added the "parameters" property to the Endpoint public protocol. --- .../Communications/Protocols/Endpoint.swift | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Sources/Communications/Protocols/Endpoint.swift b/Sources/Communications/Protocols/Endpoint.swift index 79b79fd..b373dce 100644 --- a/Sources/Communications/Protocols/Endpoint.swift +++ b/Sources/Communications/Protocols/Endpoint.swift @@ -15,27 +15,35 @@ import Foundation /// This protocol defines an endpoint to be used in a remote call. public protocol Endpoint { + // MARK: Type aliases + + typealias Parameters = [String : String?] + typealias Headers = [String : String] + // MARK: Properties - + /// The scheme subcomponent for the endpoint. var scheme: String { get } /// The host subcomponent for the endpoint. var host: String { get } - + /// The port subcomponent for the component. var port: Int? { get } - + /// The path subcomponent for the endpoint. var path: String { get } + /// The query parameter subcomponents for the endpoint. + var parameters: Parameters { get } + /// The HTTP request method for the endpoint. var method: HTTPRequestMethod { get } /// The HTTP header fields as a dictionary for the endpoint. - var headers: [String: String] { get } + var headers: Headers { get } /// The message body as data for a request. var body: Data? { get } - + }