diff --git a/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift b/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift index d8c5d6e..8f408da 100644 --- a/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift +++ b/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift @@ -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 { diff --git a/Sources/AmiiboService/Public/Models/Amiibo/Amiibo+Release.swift b/Sources/AmiiboService/Public/Models/Amiibo/Amiibo+Release.swift index e2211c4..627e5b7 100644 --- a/Sources/AmiiboService/Public/Models/Amiibo/Amiibo+Release.swift +++ b/Sources/AmiiboService/Public/Models/Amiibo/Amiibo+Release.swift @@ -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 diff --git a/Sources/AmiiboService/Public/Protocols/AmiiboClient.swift b/Sources/AmiiboService/Public/Protocols/AmiiboClient.swift index 22078e7..fc1b3a8 100644 --- a/Sources/AmiiboService/Public/Protocols/AmiiboClient.swift +++ b/Sources/AmiiboService/Public/Protocols/AmiiboClient.swift @@ -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 diff --git a/Sources/AmiiboService/Public/Services/AmiiboService.swift b/Sources/AmiiboService/Public/Services/AmiiboService.swift index 1584b9c..1f95cc8 100644 --- a/Sources/AmiiboService/Public/Services/AmiiboService.swift +++ b/Sources/AmiiboService/Public/Services/AmiiboService.swift @@ -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()