Added package initializers to the Amiibo models for testing.
This commit is contained in:
1 parent
51b1245ec3
commit
c031fdcc97
10 files changed
+232
-10
No files matched your search
@@ -29,6 +29,17 @@ extension Amiibo {
|
||||
|
||||
// MARK: Initializers
|
||||
|
||||
/// Initializes this model.
|
||||
package init(
|
||||
identifiers: [String],
|
||||
name: String,
|
||||
usages: [Usage]? = nil
|
||||
) {
|
||||
self.identifiers = identifiers
|
||||
self.name = name
|
||||
self.usages = usages
|
||||
}
|
||||
|
||||
/// Initializes this model from a given payload.
|
||||
/// - Parameter payload: A payload that contains the values for the model.
|
||||
init(_ payload: Components.Schemas.AmiiboGame) {
|
||||
|
||||
@@ -31,8 +31,21 @@ extension Amiibo {
|
||||
public let wiiU: [Game]
|
||||
|
||||
// MARK: Initializers
|
||||
|
||||
|
||||
/// Initializes this model.
|
||||
package init(
|
||||
`switch`: [Game] = [],
|
||||
switch2: [Game] = [],
|
||||
threeDS: [Game] = [],
|
||||
wiiU: [Game] = []
|
||||
) {
|
||||
self.switch = `switch`
|
||||
self.switch2 = switch2
|
||||
self.threeDS = threeDS
|
||||
self.wiiU = wiiU
|
||||
}
|
||||
|
||||
/// Initializes this model from the given payloads.
|
||||
///
|
||||
/// > important: In case no data is provided, then an instance of this model is not created.
|
||||
///
|
||||
|
||||
@@ -36,6 +36,19 @@ extension Amiibo {
|
||||
|
||||
// MARK: Initializers
|
||||
|
||||
/// Initializes this model.
|
||||
package init(
|
||||
america: Date? = nil,
|
||||
australia: Date? = nil,
|
||||
europe: Date? = nil,
|
||||
japan: Date? = nil
|
||||
) {
|
||||
self.america = america
|
||||
self.australia = australia
|
||||
self.europe = europe
|
||||
self.japan = japan
|
||||
}
|
||||
|
||||
/// Initializes this model from a given payload.
|
||||
/// - Parameter payload: A payload that contains the values for the model.
|
||||
init(_ payload: Components.Schemas.AmiiboRelease) {
|
||||
|
||||
@@ -26,6 +26,12 @@ extension Amiibo {
|
||||
|
||||
// MARK: Initializers
|
||||
|
||||
/// Initializes this model.
|
||||
package init(explanation: String, isWriteable: Bool) {
|
||||
self.explanation = explanation
|
||||
self.isWriteable = isWriteable
|
||||
}
|
||||
|
||||
/// Initializes this model from a given payload.
|
||||
/// - Parameter payload: A payload that contains the values for the model.
|
||||
init(_ payload: Components.Schemas.AmiiboUsage) {
|
||||
|
||||
Reference in new issue
Block a user