Documented the internal KeyNameFilter and KeyNameModel protocols in the library target.

This commit is contained in:
2025-09-09 07:44:41 +02:00
parent 21fba2612d
commit 71464a5bc0
2 changed files with 19 additions and 2 deletions
+12 -1
View File
@@ -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)
}
@@ -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)
}