[Setup] Documentation #10

Merged
javier merged 12 commits from setup/documentation into main 2023-04-23 13:16:23 +00:00
7 changed files with 93 additions and 85 deletions
Showing only changes of commit 0310326680 - Show all commits

View File

@ -107,14 +107,16 @@ extension AmiiboFilter: Filter {
// MARK: - Enumerations
/// This enumeration indicates if extra information for amiibos need to be retrieved.
public enum ShowExtras {
extension AmiiboFilter {
/// This enumeration indicates if extra information for amiibos need to be retrieved.
public enum ShowExtras {
/// No extra information needs to be retrieved.
case none
/// Amiibo games information needs to be retrieved.
case games
/// Amiibo games and its usage information needs to be retrieved.
case usage
}
}
// MARK: - String+Key

View File

@ -0,0 +1,27 @@
extension Amiibo {
/// This model structs represents a game that is related to an amiibo, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showGames).
public struct Game {
// MARK: Properties
/// The list of identifiers associated to the game.
public let ids: [String]
/// The name of the game.
public let name: String
/// The list of usages that explains how the amiibo is being used in the game.
public let usage: [Usage]?
}
}
// MARK: - Decodable
extension Amiibo.Game: Decodable {
enum CodingKeys: String, CodingKey {
case ids = "gameID"
case name = "gameName"
case usage = "amiiboUsage"
}
}

View File

@ -0,0 +1,23 @@
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"
}
}

View File

@ -0,0 +1,33 @@
import Foundation
extension Amiibo {
/// This model struct represents a collection of official release dates (if released) of an amiibo in different markets around the world.
public struct Release {
// MARK: Properties
/// The official release date (if released) of an amiibo in Australia.
public let australia: Date?
/// The official release date (if released) of an amiibo in Europe.
public let europe: Date?
/// The official release date (if released) of an amiibo in Japan.
public let japan: Date?
/// The official release date (if released) of an amiibo in North America.
public let america: Date?
}
}
// MARK: - Decodable
extension Amiibo.Release: Decodable {
enum CodingKeys: String, CodingKey {
case australia = "au"
case europe = "eu"
case japan = "jp"
case america = "na"
}
}

View File

@ -1,25 +0,0 @@
/// This model structs represents a game that is related to an amiibo, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showGames).
public struct Game {
// MARK: Properties
/// The list of identifiers associated to the game.
public let ids: [String]
/// The name of the game.
public let name: String
/// The list of usages that explains how the amiibo is being used in the game.
public let usage: [Usage]?
}
// MARK: - Decodable
extension Game: Decodable {
enum CodingKeys: String, CodingKey {
case ids = "gameID"
case name = "gameName"
case usage = "amiiboUsage"
}
}

View File

@ -1,31 +0,0 @@
import Foundation
/// This model struct represents a collection of official release dates (if released) of an amiibo in different markets around the world.
public struct Release {
// MARK: Properties
/// The official release date (if released) of an amiibo in Australia.
public let australia: Date?
/// The official release date (if released) of an amiibo in Europe.
public let europe: Date?
/// The official release date (if released) of an amiibo in Japan.
public let japan: Date?
/// The official release date (if released) of an amiibo in North America.
public let america: Date?
}
// MARK: - Decodable
extension Release: Decodable {
enum CodingKeys: String, CodingKey {
case australia = "au"
case europe = "eu"
case japan = "jp"
case america = "na"
}
}

View File

@ -1,21 +0,0 @@
/// 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 Usage: Decodable {
enum CodingKeys: String, CodingKey {
case explanation = "Usage"
case isWritable = "write"
}
}