Written the documentation for the KeyNameFilter filter.

This commit is contained in:
Javier Cicchelli 2023-04-23 13:23:17 +02:00
parent 118e824989
commit 0461e65a9c

View File

@ -1,3 +1,4 @@
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibos series (``AmiiboSeriesFilter``), amiibo types (``AmiiboTypeFilter``), characters (``CharacterFilter``), or game series (``GameSeriesFilter``).
public struct KeyNameFilter { public struct KeyNameFilter {
// MARK: Properties // MARK: Properties
@ -7,6 +8,10 @@ public struct KeyNameFilter {
// MARK: Initialisers // MARK: Initialisers
/// Initialises this filter.
/// - Parameters:
/// - key: A `key` value to match against.
/// - name: A `name` value to match against.
public init( public init(
key: String? = nil, key: String? = nil,
name: String? = nil name: String? = nil
@ -17,6 +22,20 @@ public struct KeyNameFilter {
} }
// MARK: - Type aliases
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibos series.
public typealias AmiiboSeriesFilter = KeyNameFilter
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibo types.
public typealias AmiiboTypeFilter = KeyNameFilter
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering characters.
public typealias CharacterFilter = KeyNameFilter
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering game series.
public typealias GameSeriesFilter = KeyNameFilter
// MARK: - Filter // MARK: - Filter
extension KeyNameFilter: Filter { extension KeyNameFilter: Filter {
@ -39,13 +58,6 @@ extension KeyNameFilter: Filter {
} }
// MARK: - Type aliases
public typealias AmiiboSeriesFilter = KeyNameFilter
public typealias AmiiboTypeFilter = KeyNameFilter
public typealias CharacterFilter = KeyNameFilter
public typealias GameSeriesFilter = KeyNameFilter
// MARK: - String+Key // MARK: - String+Key
private extension String { private extension String {