diff --git a/Apps/Locations/Libraries/Sources/APICore/Enumerations/HTTPRequestMethod.swift b/Apps/Locations/Libraries/Sources/APICore/Enumerations/HTTPRequestMethod.swift new file mode 100644 index 0000000..f45d043 --- /dev/null +++ b/Apps/Locations/Libraries/Sources/APICore/Enumerations/HTTPRequestMethod.swift @@ -0,0 +1,12 @@ +// +// HTTPRequestMethod.swift +// APICore +// +// Created by Javier Cicchelli on 10/04/2023. +// Copyright © 2023 Röck+Cöde. All rights reserved. +// + +/// Enumeration that represents the available HTTP request methods to use in this library. +public enum HTTPRequestMethod: String { + case get = "GET" +} diff --git a/Apps/Locations/Libraries/Sources/APICore/Libraries.swift b/Apps/Locations/Libraries/Sources/APICore/Libraries.swift deleted file mode 100644 index c1536b6..0000000 --- a/Apps/Locations/Libraries/Sources/APICore/Libraries.swift +++ /dev/null @@ -1,6 +0,0 @@ -public struct Libraries { - public private(set) var text = "Hello, World!" - - public init() { - } -} diff --git a/Apps/Locations/Libraries/Sources/APICore/Protocols/Endpoint.swift b/Apps/Locations/Libraries/Sources/APICore/Protocols/Endpoint.swift new file mode 100644 index 0000000..4e7df7d --- /dev/null +++ b/Apps/Locations/Libraries/Sources/APICore/Protocols/Endpoint.swift @@ -0,0 +1,20 @@ +// +// Endpoint.swift +// APICore +// +// Created by Javier Cicchelli on 10/04/2023. +// Copyright © 2023 Röck+Cöde. All rights reserved. +// + +import Foundation + +/// This protocol defines an endpoint to be used in an API call. +public protocol Endpoint { + var scheme: String { get } + var host: String { get } + var port: Int? { get } + var path: String { get } + var method: HTTPRequestMethod { get } + var headers: [String: String] { get } + var body: Data? { get } +}