From 71464a5bc01b8f73f0c3d2dc849862fb8b1bd581 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Tue, 9 Sep 2025 07:44:41 +0200 Subject: [PATCH] Documented the internal KeyNameFilter and KeyNameModel protocols in the library target. --- Sources/Internal/Protocols/KeyNameFilter.swift | 13 ++++++++++++- Sources/Internal/Protocols/KeyNameModel.swift | 8 +++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Sources/Internal/Protocols/KeyNameFilter.swift b/Sources/Internal/Protocols/KeyNameFilter.swift index ad7d825..a57cc74 100644 --- a/Sources/Internal/Protocols/KeyNameFilter.swift +++ b/Sources/Internal/Protocols/KeyNameFilter.swift @@ -10,17 +10,28 @@ // //===----------------------------------------------------------------------=== +/// A protocol that defines filters that might contain `key` and/or `name` values. protocol KeyNameFilter { // MARK: Properties + /// A key to use for filtering, if any. var key: String? { get } + + /// A name to use for filtering, if any. var name: String? { get } - // MARK: Initialisers + // MARK: Initializers + /// Initializes this filter without key or name values. init() + + /// Initializes this filter with a key value. + /// - Parameter key: A key to use for filtering. init(key: String) + + /// Initializes this filter with a name value. + /// - Parameter name: A name to use for filtering. init(name: String) } diff --git a/Sources/Internal/Protocols/KeyNameModel.swift b/Sources/Internal/Protocols/KeyNameModel.swift index 0d5bc16..cf05a6d 100644 --- a/Sources/Internal/Protocols/KeyNameModel.swift +++ b/Sources/Internal/Protocols/KeyNameModel.swift @@ -10,15 +10,21 @@ // //===----------------------------------------------------------------------=== +/// A protocol that defines decodable models containing the `key` and `name` properties. protocol KeyNameModel: Sendable { // MARK: Properties + /// A key value. var key: String { get } + + /// A name value. var name: String { get } - // MARK: Initialisers + // MARK: Initializers + /// Initializes this model from a given payload. + /// - Parameter payload: A payload that contains the values for the model. init(_ payload: Components.Schemas.Tuple) }