Documented the AmiiboClient enumeration and the AmiiboServiceError error in the library target.
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
//===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the AmiiboService open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
||||||
|
// Licensed under the EUPL 1.2 or later.
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A concrete representation of the types of client that a ``AmiiboService`` service can utilize.
|
||||||
|
///
|
||||||
|
/// > important: This enumeration has been defined as a way to avoid exposing the `APIClient` protocol outside the boundaries of this library.
|
||||||
|
public enum AmiiboClient {
|
||||||
|
/// A live Amiibo client to interact with the online service.
|
||||||
|
case live(AmiiboLiveClient = .init())
|
||||||
|
///A mock Amiibo client, for testing purposes.
|
||||||
|
case mock(AmiiboMockClient)
|
||||||
|
}
|
||||||
@@ -10,12 +10,19 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
//===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A representation of all the possible errors that the ``AmiiboService`` service could throw.
|
||||||
public enum AmiiboServiceError: Error {
|
public enum AmiiboServiceError: Error {
|
||||||
|
/// A bad request has been given to the client.
|
||||||
case badRequest
|
case badRequest
|
||||||
|
/// A response cannot be decoded.
|
||||||
case decoding
|
case decoding
|
||||||
|
/// An online service is not currently available.
|
||||||
case notAvailable
|
case notAvailable
|
||||||
|
/// A response cannot be found.
|
||||||
case notFound
|
case notFound
|
||||||
|
/// An undocumented/unsupported error.
|
||||||
case undocumented(_ statusCode: Int)
|
case undocumented(_ statusCode: Int)
|
||||||
|
/// An unknown error.
|
||||||
case unknown
|
case unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user