Improved the overall documentation for the public and internal types in the package.

This commit is contained in:
2026-03-23 00:25:38 +01:00
parent 69d7681139
commit cd01c27544
15 changed files with 62 additions and 56 deletions
@@ -16,18 +16,18 @@ import Foundation
import OpenAPIRuntime
import OpenAPIURLSession
/// A type that implements a live client to the online service.
/// A type that implements a live client to the [Amiibo API](https://www.amiiboapi.org) online service.
public struct AmiiboLiveClient: Sendable {
// MARK: Properties
/// A client generated by the `OpenAPIRuntime` library.
/// A client generated by the OpenAPI Runtime library to perform API calls.
private let client: Client
// MARK: Initializers
/// Initializes this client.
/// - Parameter transport: A transport that performs HTTP operations.
/// Initializes this client with a transport for performing HTTP operations.
/// - Parameter transport: A transport that performs HTTP operations. Defaults to a `URLSessionTransport` using the shared session.
public init(transport: any ClientTransport = URLSessionTransport()) {
self.client = .init(
// The force unwrapping implemented below assumes that the server definition from the OpenAPI specification is correct.
@@ -415,9 +415,9 @@ private extension AmiiboLiveClient {
}
}
/// Maps a given error to a `AmiiboServiceError` error.
/// Maps a given error to an ``AmiiboServiceError`` error.
/// - Parameter error: An error to map.
/// - Throws: An ``AmiiboServiceError`` error.
/// - Throws: An ``AmiiboServiceError`` error that corresponds to the given error.
func handle(error: any Error) throws -> Never {
switch error {
case is CancellationError: