Made Amiibo models Codable and Identifiable, and filters Hashable.
This commit is contained in:
1 parent
8fa4d50734
commit
a28842eb0a
24 files changed
+352
-190
No files matched your search
@@ -16,44 +16,44 @@ import Foundation
|
||||
|
||||
/// A protocol that defines a client that fetches data from the Amiibo API.
|
||||
///
|
||||
/// ``AmiiboLiveClient`` is the default implementation. Conform to this protocol to provide another one, such as a mock for tests. Conforming types must be `Sendable`.
|
||||
/// ``AmiiboLiveClient`` is the default implementation; conform to provide another, such as a mock. Conforming types must be `Sendable`.
|
||||
public protocol AmiiboClient: Sendable {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
/// Gets a list of amiibo items based on a given filter.
|
||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
||||
/// - Parameter filter: A filter for the result.
|
||||
/// - Returns: A list of filtered amiibo items.
|
||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
||||
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||
func getAmiibos(by filter: AmiiboFilter) async throws(AmiiboServiceError) -> [Amiibo]
|
||||
|
||||
/// Gets a list of amiibo series based on a given filter.
|
||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
||||
/// - Parameter filter: A filter for the result.
|
||||
/// - Returns: A list of filtered amiibo series.
|
||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
||||
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws(AmiiboServiceError) -> [AmiiboSeries]
|
||||
|
||||
/// Gets a list of amiibo types based on a given filter.
|
||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
||||
/// - Parameter filter: A filter for the result.
|
||||
/// - Returns: A list of filtered amiibo types.
|
||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
||||
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws(AmiiboServiceError) -> [AmiiboType]
|
||||
|
||||
/// Gets a list of game characters based on a given filter.
|
||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
||||
/// - Parameter filter: A filter for the result.
|
||||
/// - Returns: A list of filtered game characters.
|
||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
||||
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||
func getGameCharacters(by filter: GameCharacterFilter) async throws(AmiiboServiceError) -> [GameCharacter]
|
||||
|
||||
/// Gets a list of game series based on a given filter.
|
||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
||||
/// - Parameter filter: A filter for the result.
|
||||
/// - Returns: A list of filtered game series.
|
||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
||||
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||
func getGameSeries(by filter: GameSeriesFilter) async throws(AmiiboServiceError) -> [GameSeries]
|
||||
|
||||
/// Gets the date when the data was last updated.
|
||||
/// - Returns: A last updated date, decoded as UTC.
|
||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
||||
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||
func getLastUpdated() async throws(AmiiboServiceError) -> Date
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user