amiibo-service/Sources/Models/AmiiboGameUsage.swift
Javier Cicchelli c4a25afad4 [Setup] Documentation (#10)
This PR contains the work done to address the issue #7, related to documenting the source code that would be used for other developers.

To provide further details about the work done:
- [x] restructured the hierarchy of some models that are related to the `Amiibo` model;
- [x] written documentation for the `AmiiboService` service;
- [x] written documentation for the `AmiiboFilter` and `KeyNameFilter` filters;
- [x] written documentation for the `Amiibo`, `KeyName`, `LastUpdated` and children model;
- [x] written documentation for the `AmiiboClientError` error;
- [x] written documentation for the README file.

Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Reviewed-on: #10
2023-04-23 13:16:22 +00:00

24 lines
768 B
Swift

extension Amiibo.Game {
/// This model struct represents how an amiibo is used with a particular game, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showUsage).
public struct Usage {
// MARK: Properties
/// The explanation on how an amiibo is being used with a particular game.
public let explanation: String
/// A flag that indicates whether an amiibo is only read-only or the game can also write information to the amiibo.
public let isWritable: Bool
}
}
// MARK: - Decodable
extension Amiibo.Game.Usage: Decodable {
enum CodingKeys: String, CodingKey {
case explanation = "Usage"
case isWritable = "write"
}
}