Updated some documentation on the source code in the library target.

This commit is contained in:
2026-07-26 10:37:07 +02:00
parent fb95989d83
commit 6c6dc59b80
4 changed files with 10 additions and 4 deletions
@@ -17,6 +17,8 @@ import OpenAPIRuntime
import OpenAPIURLSession
/// A type that implements a live client to the [Amiibo API](https://www.amiiboapi.org) online service.
///
/// This client maps any transport error or unsuccessful HTTP response to an ``AmiiboServiceError`` error, and sorts the items of the list responses in ascending order by identifier or key.
public struct AmiiboLiveClient: Sendable {
// MARK: Constants
@@ -109,7 +111,7 @@ extension AmiiboLiveClient: AmiiboClient {
}
/// Gets the date when the data was last updated.
/// - Returns: A last updated date.
/// - Returns: A last updated date, decoded as UTC.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
public func getLastUpdated() async throws(AmiiboServiceError) -> Date {
try await fetchLastUpdated()
@@ -317,7 +319,7 @@ private extension AmiiboLiveClient {
}
/// Fetches the date when the data was last updated.
/// - Returns: A fetched last updated date.
/// - Returns: A fetched last updated date, decoded as UTC.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchLastUpdated() async throws(AmiiboServiceError) -> Date {
let response = try await perform {
@@ -16,6 +16,8 @@ import Foundation
extension Amiibo {
/// A model that represents the regional release dates of an amiibo.
///
/// The service provides these dates as date-only values, which are decoded as midnight UTC.
public struct Release: Sendable, Hashable {
// MARK: Properties
@@ -52,7 +52,7 @@ public protocol AmiiboClient: Sendable {
func getGameSeries(by filter: GameSeriesFilter) async throws(AmiiboServiceError) -> [GameSeries]
/// Gets the date when the data was last updated.
/// - Returns: A last updated date.
/// - Returns: A last updated date, decoded as UTC.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func getLastUpdated() async throws(AmiiboServiceError) -> Date
@@ -15,6 +15,8 @@
import Foundation
/// A type that implements the service that uses a client to make calls.
///
/// This service forwards every call to the ``AmiiboClient`` client injected during initialization, which defaults to an ``AmiiboLiveClient`` instance. This type is `Sendable`, so an instance can be safely shared across concurrency domains.
public struct AmiiboService: Sendable {
// MARK: Properties
@@ -83,7 +85,7 @@ public struct AmiiboService: Sendable {
}
/// Gets the date when the data was last updated.
/// - Returns: A last updated date.
/// - Returns: A last updated date, decoded as UTC.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
public func getLastUpdated() async throws(AmiiboServiceError) -> Date {
try await client.getLastUpdated()