Added the "head" and "tail" properties to the AmiiboFilter type in the library target.
This commit is contained in:
@@ -182,10 +182,12 @@ private extension AmiiboLiveClient {
|
|||||||
amiiboSeries: filter.series,
|
amiiboSeries: filter.series,
|
||||||
character: filter.gameCharacter,
|
character: filter.gameCharacter,
|
||||||
gameseries: filter.gameSeries,
|
gameseries: filter.gameSeries,
|
||||||
|
head: filter.head,
|
||||||
id: filter.identifier,
|
id: filter.identifier,
|
||||||
name: filter.name,
|
name: filter.name,
|
||||||
showgames: filter.showGames,
|
showgames: filter.showGames,
|
||||||
showusage: filter.showUsage,
|
showusage: filter.showUsage,
|
||||||
|
tail: filter.tail,
|
||||||
_type: filter.type
|
_type: filter.type
|
||||||
)))
|
)))
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -15,19 +15,22 @@ public struct AmiiboFilter: Sendable {
|
|||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A game character to return, if any.
|
/// A game character to filter the result, if any.
|
||||||
public let gameCharacter: String?
|
public let gameCharacter: String?
|
||||||
|
|
||||||
/// A game series to return, if any.
|
/// A game series to filter the result, if any.
|
||||||
public let gameSeries: String?
|
public let gameSeries: String?
|
||||||
|
|
||||||
|
/// A first part of an identifier to filter the result, if any.
|
||||||
|
public let head: String?
|
||||||
|
|
||||||
/// An amiibo identifier to return, if any.
|
/// An amiibo identifier to filter the result, if any.
|
||||||
public let identifier: String?
|
public let identifier: String?
|
||||||
|
|
||||||
/// An amiibo name to return, if any.
|
/// An amiibo name to filter the result, if any.
|
||||||
public let name: String?
|
public let name: String?
|
||||||
|
|
||||||
/// An amiibo series to return, if any.
|
/// An amiibo series to filter the result, if any.
|
||||||
public let series: String?
|
public let series: String?
|
||||||
|
|
||||||
/// A flag indicating whether to include games in the response, if any.
|
/// A flag indicating whether to include games in the response, if any.
|
||||||
@@ -35,23 +38,30 @@ public struct AmiiboFilter: Sendable {
|
|||||||
|
|
||||||
/// A flag indicating whether to include amiibo usages in games in the response, if any.
|
/// A flag indicating whether to include amiibo usages in games in the response, if any.
|
||||||
public let showUsage: Bool?
|
public let showUsage: Bool?
|
||||||
|
|
||||||
|
/// A last part of an identifier to filter the result, if any.
|
||||||
|
public let tail: String?
|
||||||
|
|
||||||
/// An amiibo type to return, if any.
|
/// An amiibo type to filter the result, if any.
|
||||||
public let type: String?
|
public let type: String?
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this filter.
|
/// Initializes this filter.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - identifier: An amiibo identifier to return, if any.
|
/// - head: A first part of an identifier to filter the result, if any.
|
||||||
/// - name: An amiibo name to return, if any.
|
/// - tail: A last part of an identifier to filter the result, if any.
|
||||||
/// - type: An amiibo type to return, if any.
|
/// - identifier: An amiibo identifier to filter the result, if any.
|
||||||
/// - series: An amiibo series to return, if any.
|
/// - name: An amiibo name to filter the result, if any.
|
||||||
/// - gameCharacter: A game character to return, if any.
|
/// - type: An amiibo type to filter the result, if any.
|
||||||
/// - gameSeries: A game series to return, if any.
|
/// - series: An amiibo series to filter the result, if any.
|
||||||
|
/// - gameCharacter: A game character to filter the result, if any.
|
||||||
|
/// - gameSeries: A game series to filter the result, if any.
|
||||||
/// - showGames: A flag indicating whether to include games in the response, if any.
|
/// - showGames: A flag indicating whether to include games in the response, if any.
|
||||||
/// - showUsage: A flag indicating whether to include amiibo usages in games in the response, if any.
|
/// - showUsage: A flag indicating whether to include amiibo usages in games in the response, if any.
|
||||||
public init(
|
public init(
|
||||||
|
head: String? = nil,
|
||||||
|
tail: String? = nil,
|
||||||
identifier: String? = nil,
|
identifier: String? = nil,
|
||||||
name: String? = nil,
|
name: String? = nil,
|
||||||
type: String? = nil,
|
type: String? = nil,
|
||||||
@@ -63,11 +73,13 @@ public struct AmiiboFilter: Sendable {
|
|||||||
) {
|
) {
|
||||||
self.gameCharacter = gameCharacter
|
self.gameCharacter = gameCharacter
|
||||||
self.gameSeries = gameSeries
|
self.gameSeries = gameSeries
|
||||||
|
self.head = head
|
||||||
self.identifier = identifier
|
self.identifier = identifier
|
||||||
self.name = name
|
self.name = name
|
||||||
self.series = series
|
self.series = series
|
||||||
self.showGames = showGames
|
self.showGames = showGames
|
||||||
self.showUsage = showUsage
|
self.showUsage = showUsage
|
||||||
|
self.tail = tail
|
||||||
self.type = type
|
self.type = type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -545,6 +545,10 @@ enum Input {
|
|||||||
/// A list of amiibo filters to input to the `assertAmiibos` assertion.
|
/// A list of amiibo filters to input to the `assertAmiibos` assertion.
|
||||||
static let amiibos: [AmiiboFilter] = [
|
static let amiibos: [AmiiboFilter] = [
|
||||||
.init(),
|
.init(),
|
||||||
|
.init(head: "00000000"),
|
||||||
|
.init(head: "0000"),
|
||||||
|
.init(tail: "00000002"),
|
||||||
|
.init(tail: "0002"),
|
||||||
.init(identifier: "0000000000000002"),
|
.init(identifier: "0000000000000002"),
|
||||||
.init(name: "zelda"),
|
.init(name: "zelda"),
|
||||||
.init(name: "Something"),
|
.init(name: "Something"),
|
||||||
@@ -579,6 +583,8 @@ enum Input {
|
|||||||
]
|
]
|
||||||
/// A list of amiibo series filters to input to the `assertAmiibosThrows` assertion.
|
/// A list of amiibo series filters to input to the `assertAmiibosThrows` assertion.
|
||||||
static let amiibosThrows: [AmiiboFilter] = [
|
static let amiibosThrows: [AmiiboFilter] = [
|
||||||
|
.init(head: .empty),
|
||||||
|
.init(tail: .empty),
|
||||||
.init(identifier: "0000000000000000"),
|
.init(identifier: "0000000000000000"),
|
||||||
.init(identifier: "0000000"),
|
.init(identifier: "0000000"),
|
||||||
.init(identifier: .empty),
|
.init(identifier: .empty),
|
||||||
@@ -651,9 +657,9 @@ enum Input {
|
|||||||
|
|
||||||
enum Output {
|
enum Output {
|
||||||
/// A list of number of items that are expected from the `assertAmiibos` assertion.
|
/// A list of number of items that are expected from the `assertAmiibos` assertion.
|
||||||
static let amiibos: [Int] = [.totalAmiibos, 1, 5, .zero, 7, .totalAmiibos, 235, 235, .zero, .zero, .zero, .zero, 96, 26, .zero, .zero, 25, .totalAmiibos, 12, 6, .zero, .zero, .zero, .totalAmiibos, 49, 32, .zero, .zero, 147, .totalAmiibos, .totalAmiibos, .totalAmiibos]
|
static let amiibos: [Int] = [.totalAmiibos, 7, 7, 1, 1, 1, 5, .zero, 7, .totalAmiibos, 235, 235, .zero, .zero, .zero, .zero, 96, 26, .zero, .zero, 25, .totalAmiibos, 12, 6, .zero, .zero, .zero, .totalAmiibos, 49, 32, .zero, .zero, 147, .totalAmiibos, .totalAmiibos, .totalAmiibos]
|
||||||
/// A list of errors are expected to be thrown from the `assertAmiibosThrows` assertion.
|
/// A list of errors are expected to be thrown from the `assertAmiibosThrows` assertion.
|
||||||
static let amiibosThrows: [AmiiboServiceError] = [.decoding, .decoding, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest]
|
static let amiibosThrows: [AmiiboServiceError] = [.badRequest, .badRequest, .decoding, .decoding, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest]
|
||||||
/// A list of number of items that are expected from the `assertAmiiboSeries` assertion.
|
/// A list of number of items that are expected from the `assertAmiiboSeries` assertion.
|
||||||
static let amiiboSeries: [Int] = [.totalAmiiboSeries, 1, 1, 1, .totalAmiiboSeries]
|
static let amiiboSeries: [Int] = [.totalAmiiboSeries, 1, 1, 1, .totalAmiiboSeries]
|
||||||
/// A list of errors are expected to be thrown from the `assertAmiiboSeriesThrows` assertion.
|
/// A list of errors are expected to be thrown from the `assertAmiiboSeriesThrows` assertion.
|
||||||
|
|||||||
Reference in New Issue
Block a user