Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cbac015b1 | ||
|
|
13b9c74a38 | ||
|
|
44bfaca553 | ||
|
|
aa135cb04a | ||
|
|
0c41e5d4ce | ||
|
|
1488aa151e | ||
|
|
2442ada4b6 | ||
|
|
b8c0878ca3 | ||
|
|
61695af072 | ||
|
|
7e7e194abc | ||
|
|
2b01ec14bf | ||
|
|
fae4b44698 | ||
|
|
0d9c9e22a4 | ||
|
|
4623c13c24 | ||
|
|
34627840db | ||
|
|
40afefed15 | ||
|
|
c303e1f8f3 |
No files matched your search
@@ -1,14 +1,16 @@
|
|||||||
# ===----------------------------------------------------------------------===
|
## ===----------------------------------------------------------------------===
|
||||||
#
|
##
|
||||||
# This source file is part of the AmiiboService open source project
|
## This source file is part of the Amiibo Service open source project
|
||||||
#
|
##
|
||||||
# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
## Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
# Licensed under the EUPL 1.2 or later.
|
## Licensed under Apache license v2.0
|
||||||
#
|
##
|
||||||
# See LICENSE for license information
|
## See LICENSE for license information
|
||||||
# See CONTRIBUTORS for the list of AmiiboAPI project authors
|
## See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
#
|
##
|
||||||
# ===----------------------------------------------------------------------===
|
## SPDX-License-Identifier: Apache-2.0
|
||||||
|
##
|
||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
# --- DOCUMENTATION ---
|
# --- DOCUMENTATION ---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
# ===----------------------------------------------------------------------===
|
||||||
|
#
|
||||||
|
# This source file is part of the Amiibo Service open source project
|
||||||
|
#
|
||||||
|
# Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
# Licensed under Apache license v2.0
|
||||||
|
#
|
||||||
|
# See LICENSE for license information
|
||||||
|
# See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Build and test
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Select Xcode
|
||||||
|
uses: maxim-lobanov/setup-xcode@v1
|
||||||
|
with:
|
||||||
|
xcode-version: latest-stable
|
||||||
|
|
||||||
|
- name: Show toolchain
|
||||||
|
run: swift --version
|
||||||
|
|
||||||
|
- name: Cache build
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .build
|
||||||
|
key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
|
||||||
|
restore-keys: spm-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: make lib-build
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: make lib-test
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
# ===----------------------------------------------------------------------===
|
||||||
|
#
|
||||||
|
# This source file is part of the Amiibo Service open source project
|
||||||
|
#
|
||||||
|
# Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
# Licensed under Apache license v2.0
|
||||||
|
#
|
||||||
|
# See LICENSE for license information
|
||||||
|
# See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
name: Documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: docs-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build documentation
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Pinned: swift-docc-plugin 1.5.0 fails to launch its tools under Xcode 27 ("Bad CPU type in executable").
|
||||||
|
- name: Select Xcode
|
||||||
|
uses: maxim-lobanov/setup-xcode@v1
|
||||||
|
with:
|
||||||
|
xcode-version: '26'
|
||||||
|
|
||||||
|
- name: Show toolchain
|
||||||
|
run: swift --version
|
||||||
|
|
||||||
|
- name: Cache build
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .build
|
||||||
|
key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
|
||||||
|
restore-keys: spm-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Generate
|
||||||
|
run: make doc-generate-github
|
||||||
|
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: docs
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy to GitHub Pages
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deploy.outputs.page_url }}
|
||||||
|
steps:
|
||||||
|
- name: Deploy
|
||||||
|
id: deploy
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# ===----------------------------------------------------------------------===
|
||||||
|
#
|
||||||
|
# This source file is part of the Amiibo Service open source project
|
||||||
|
#
|
||||||
|
# Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
# Licensed under Apache license v2.0
|
||||||
|
#
|
||||||
|
# See LICENSE for license information
|
||||||
|
# See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
name: Live tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Every Monday at 06:00 UTC.
|
||||||
|
- cron: '0 6 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test against the live service
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Select Xcode
|
||||||
|
uses: maxim-lobanov/setup-xcode@v1
|
||||||
|
with:
|
||||||
|
xcode-version: latest-stable
|
||||||
|
|
||||||
|
- name: Show toolchain
|
||||||
|
run: swift --version
|
||||||
|
|
||||||
|
- name: Cache build
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .build
|
||||||
|
key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }}
|
||||||
|
restore-keys: spm-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: make lib-test
|
||||||
|
env:
|
||||||
|
AMIIBO_LIVE_TESTS: '1'
|
||||||
+16
-1
@@ -1,3 +1,17 @@
|
|||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
##
|
||||||
|
## This source file is part of the Amiibo Service open source project
|
||||||
|
##
|
||||||
|
## Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
## Licensed under Apache license v2.0
|
||||||
|
##
|
||||||
|
## See LICENSE for license information
|
||||||
|
## See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
##
|
||||||
|
## SPDX-License-Identifier: Apache-2.0
|
||||||
|
##
|
||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
# Mac OS
|
# Mac OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.netrc
|
.netrc
|
||||||
@@ -34,4 +48,5 @@ Packages/
|
|||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
# DocC documentation
|
# DocC documentation
|
||||||
*.doccarchive
|
*.doccarchive
|
||||||
|
docs/
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
# ===----------------------------------------------------------------------===
|
## ===----------------------------------------------------------------------===
|
||||||
#
|
##
|
||||||
# This source file is part of the AmiiboService open source project
|
## This source file is part of the Amiibo Service open source project
|
||||||
#
|
##
|
||||||
# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
## Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
# Licensed under the EUPL 1.2 or later.
|
## Licensed under Apache license v2.0
|
||||||
#
|
##
|
||||||
# See LICENSE for license information
|
## See LICENSE for license information
|
||||||
# See CONTRIBUTORS for the list of AmiiboAPI project authors
|
## See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
#
|
##
|
||||||
# ===----------------------------------------------------------------------===
|
## SPDX-License-Identifier: Apache-2.0
|
||||||
|
##
|
||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
version: 1
|
version: 1
|
||||||
external_links:
|
external_links:
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
For the purpose of tracking copyright, this is the list of individuals and
|
For the purpose of tracking copyright, this is the list of individuals and
|
||||||
organizations who have contributed source code to this Swift package.
|
organizations who have contributed source code to amiibo-service.
|
||||||
|
|
||||||
For employees of an organization/company where the copyright of work done
|
For employees of an organization/company where the copyright of work done
|
||||||
by employees of that company is held by the company itself, only the company
|
by employees of that company is held by the company itself, only the company
|
||||||
|
|||||||
@@ -1,287 +1,201 @@
|
|||||||
EUROPEAN UNION PUBLIC LICENCE v. 1.2
|
Apache License
|
||||||
EUPL © the European Union 2007, 2016
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
|
|
||||||
below) which is provided under the terms of this Licence. Any use of the Work,
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
other than as authorised under this Licence is prohibited (to the extent such
|
|
||||||
use is covered by a right of the copyright holder of the Work).
|
1. Definitions.
|
||||||
|
|
||||||
The Work is provided under the terms of this Licence when the Licensor (as
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
defined below) has placed the following notice immediately following the
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
copyright notice for the Work:
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
Licensed under the EUPL
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
or has expressed by any other means his willingness to license under the EUPL.
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
1. Definitions
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
In this Licence, the following terms have the following meaning:
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
- ‘The Licence’: this Licence.
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
- ‘The Original Work’: the work or software distributed or communicated by the
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
Licensor under this Licence, available as Source Code and also as Executable
|
exercising permissions granted by this License.
|
||||||
Code as the case may be.
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
- ‘Derivative Works’: the works or software that could be created by the
|
including but not limited to software source code, documentation
|
||||||
Licensee, based upon the Original Work or modifications thereof. This Licence
|
source, and configuration files.
|
||||||
does not define the extent of modification or dependence on the Original Work
|
|
||||||
required in order to classify a work as a Derivative Work; this extent is
|
"Object" form shall mean any form resulting from mechanical
|
||||||
determined by copyright law applicable in the country mentioned in Article 15.
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
- ‘The Work’: the Original Work or its Derivative Works.
|
and conversions to other media types.
|
||||||
|
|
||||||
- ‘The Source Code’: the human-readable form of the Work which is the most
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
convenient for people to study and modify.
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
- ‘The Executable Code’: any code which has generally been compiled and which is
|
(an example is provided in the Appendix below).
|
||||||
meant to be interpreted by a computer as a program.
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
- ‘The Licensor’: the natural or legal person that distributes or communicates
|
form, that is based on (or derived from) the Work and for which the
|
||||||
the Work under the Licence.
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
- ‘Contributor(s)’: any natural or legal person who modifies the Work under the
|
of this License, Derivative Works shall not include works that remain
|
||||||
Licence, or otherwise contributes to the creation of a Derivative Work.
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
|
|
||||||
the Work under the terms of the Licence.
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
renting, distributing, communicating, transmitting, or otherwise making
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
available, online or offline, copies of the Work or providing access to its
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
essential functionalities at the disposal of any other natural or legal
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
person.
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
2. Scope of the rights granted by the Licence
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
sublicensable licence to do the following, for the duration of copyright vested
|
excluding communication that is conspicuously marked or otherwise
|
||||||
in the Original Work:
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
- use the Work in any circumstance and for all usage,
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
- reproduce the Work,
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
- modify the Work, and make Derivative Works based upon the Work,
|
subsequently incorporated within the Work.
|
||||||
- communicate to the public, including the right to make available or display
|
|
||||||
the Work or copies thereof to the public and perform publicly, as the case may
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
be, the Work,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
- distribute the Work or copies thereof,
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
- lend and rent the Work or copies thereof,
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
- sublicense rights in the Work or copies thereof.
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
Those rights can be exercised on any media, supports and formats, whether now
|
|
||||||
known or later invented, as far as the applicable law permits so.
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
In the countries where moral rights apply, the Licensor waives his right to
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
exercise his moral right to the extent allowed by law in order to make effective
|
(except as stated in this section) patent license to make, have made,
|
||||||
the licence of the economic rights here above listed.
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
|
by such Contributor that are necessarily infringed by their
|
||||||
any patents held by the Licensor, to the extent necessary to make use of the
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
rights granted on the Work under this Licence.
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
3. Communication of the Source Code
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
The Licensor may provide the Work either in its Source Code form, or as
|
or contributory patent infringement, then any patent licenses
|
||||||
Executable Code. If the Work is provided as Executable Code, the Licensor
|
granted to You under this License for that Work shall terminate
|
||||||
provides in addition a machine-readable copy of the Source Code of the Work
|
as of the date such litigation is filed.
|
||||||
along with each copy of the Work that the Licensor distributes or indicates, in
|
|
||||||
a notice following the copyright notice attached to the Work, a repository where
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
the Source Code is easily and freely accessible for as long as the Licensor
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
continues to distribute or communicate the Work.
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
4. Limitations on copyright
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
Nothing in this Licence is intended to deprive the Licensee of the benefits from
|
Derivative Works a copy of this License; and
|
||||||
any exception or limitation to the exclusive rights of the rights owners in the
|
|
||||||
Work, of the exhaustion of those rights or of other applicable limitations
|
(b) You must cause any modified files to carry prominent notices
|
||||||
thereto.
|
stating that You changed the files; and
|
||||||
|
|
||||||
5. Obligations of the Licensee
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
The grant of the rights mentioned above is subject to some restrictions and
|
attribution notices from the Source form of the Work,
|
||||||
obligations imposed on the Licensee. Those obligations are the following:
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
Attribution right: The Licensee shall keep intact all copyright, patent or
|
|
||||||
trademarks notices and all notices that refer to the Licence and to the
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
disclaimer of warranties. The Licensee must include a copy of such notices and a
|
distribution, then any Derivative Works that You distribute must
|
||||||
copy of the Licence with every copy of the Work he/she distributes or
|
include a readable copy of the attribution notices contained
|
||||||
communicates. The Licensee must cause any Derivative Work to carry prominent
|
within such NOTICE file, excluding those notices that do not
|
||||||
notices stating that the Work has been modified and the date of modification.
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
Copyleft clause: If the Licensee distributes or communicates copies of the
|
as part of the Derivative Works; within the Source form or
|
||||||
Original Works or Derivative Works, this Distribution or Communication will be
|
documentation, if provided along with the Derivative Works; or,
|
||||||
done under the terms of this Licence or of a later version of this Licence
|
within a display generated by the Derivative Works, if and
|
||||||
unless the Original Work is expressly distributed only under this version of the
|
wherever such third-party notices normally appear. The contents
|
||||||
Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
|
of the NOTICE file are for informational purposes only and
|
||||||
(becoming Licensor) cannot offer or impose any additional terms or conditions on
|
do not modify the License. You may add Your own attribution
|
||||||
the Work or Derivative Work that alter or restrict the terms of the Licence.
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
Compatibility clause: If the Licensee Distributes or Communicates Derivative
|
that such additional attribution notices cannot be construed
|
||||||
Works or copies thereof based upon both the Work and another work licensed under
|
as modifying the License.
|
||||||
a Compatible Licence, this Distribution or Communication can be done under the
|
|
||||||
terms of this Compatible Licence. For the sake of this clause, ‘Compatible
|
You may add Your own copyright statement to Your modifications and
|
||||||
Licence’ refers to the licences listed in the appendix attached to this Licence.
|
may provide additional or different license terms and conditions
|
||||||
Should the Licensee's obligations under the Compatible Licence conflict with
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
his/her obligations under this Licence, the obligations of the Compatible
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
Licence shall prevail.
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
Provision of Source Code: When distributing or communicating copies of the Work,
|
|
||||||
the Licensee will provide a machine-readable copy of the Source Code or indicate
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
a repository where this Source will be easily and freely available for as long
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
as the Licensee continues to distribute or communicate the Work.
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
Legal Protection: This Licence does not grant permission to use the trade names,
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
trademarks, service marks, or names of the Licensor, except as required for
|
the terms of any separate license agreement you may have executed
|
||||||
reasonable and customary use in describing the origin of the Work and
|
with Licensor regarding such Contributions.
|
||||||
reproducing the content of the copyright notice.
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
6. Chain of Authorship
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
The original Licensor warrants that the copyright in the Original Work granted
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
hereunder is owned by him/her or licensed to him/her and that he/she has the
|
|
||||||
power and authority to grant the Licence.
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
Each Contributor warrants that the copyright in the modifications he/she brings
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
to the Work are owned by him/her or licensed to him/her and that he/she has the
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
power and authority to grant the Licence.
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
Each time You accept the Licence, the original Licensor and subsequent
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
Contributors grant You a licence to their contributions to the Work, under the
|
appropriateness of using or redistributing the Work and assume any
|
||||||
terms of this Licence.
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
7. Disclaimer of Warranty
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
The Work is a work in progress, which is continuously improved by numerous
|
unless required by applicable law (such as deliberate and grossly
|
||||||
Contributors. It is not a finished work and may therefore contain defects or
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
‘bugs’ inherent to this type of development.
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
For the above reason, the Work is provided under the Licence on an ‘as is’ basis
|
result of this License or out of the use or inability to use the
|
||||||
and without warranties of any kind concerning the Work, including without
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
limitation merchantability, fitness for a particular purpose, absence of defects
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
or errors, accuracy, non-infringement of intellectual property rights other than
|
other commercial damages or losses), even if such Contributor
|
||||||
copyright as stated in Article 6 of this Licence.
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
This disclaimer of warranty is an essential part of the Licence and a condition
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
for the grant of any rights to the Work.
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
8. Disclaimer of Liability
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
Except in the cases of wilful misconduct or damages directly caused to natural
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
persons, the Licensor will in no event be liable for any direct or indirect,
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
material or moral, damages of any kind, arising out of the Licence or of the use
|
defend, and hold each Contributor harmless for any liability
|
||||||
of the Work, including without limitation, damages for loss of goodwill, work
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
stoppage, computer failure or malfunction, loss of data or any commercial
|
of your accepting any such warranty or additional liability.
|
||||||
damage, even if the Licensor has been advised of the possibility of such damage.
|
|
||||||
However, the Licensor will be liable under statutory product liability laws as
|
END OF TERMS AND CONDITIONS
|
||||||
far such laws apply to the Work.
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
9. Additional agreements
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
While distributing the Work, You may choose to conclude an additional agreement,
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
defining obligations or services consistent with this Licence. However, if
|
replaced with your own identifying information. (Don't include
|
||||||
accepting obligations, You may act only on your own behalf and on your sole
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
responsibility, not on behalf of the original Licensor or any other Contributor,
|
comment syntax for the file format. We also recommend that a
|
||||||
and only if You agree to indemnify, defend, and hold each Contributor harmless
|
file or class name and description of purpose be included on the
|
||||||
for any liability incurred by, or claims asserted against such Contributor by
|
same "printed page" as the copyright notice for easier
|
||||||
the fact You have accepted any warranty or additional liability.
|
identification within third-party archives.
|
||||||
|
|
||||||
10. Acceptance of the Licence
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
placed under the bottom of a window displaying the text of this Licence or by
|
you may not use this file except in compliance with the License.
|
||||||
affirming consent in any other similar way, in accordance with the rules of
|
You may obtain a copy of the License at
|
||||||
applicable law. Clicking on that icon indicates your clear and irrevocable
|
|
||||||
acceptance of this Licence and all of its terms and conditions.
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Similarly, you irrevocably accept this Licence and all of its terms and
|
Unless required by applicable law or agreed to in writing, software
|
||||||
conditions by exercising any rights granted to You by Article 2 of this Licence,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
such as the use of the Work, the creation by You of a Derivative Work or the
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
Distribution or Communication by You of the Work or copies thereof.
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
11. Information to the public
|
|
||||||
|
|
||||||
In case of any Distribution or Communication of the Work by means of electronic
|
|
||||||
communication by You (for example, by offering to download the Work from a
|
|
||||||
remote location) the distribution channel or media (for example, a website) must
|
|
||||||
at least provide to the public the information requested by the applicable law
|
|
||||||
regarding the Licensor, the Licence and the way it may be accessible, concluded,
|
|
||||||
stored and reproduced by the Licensee.
|
|
||||||
|
|
||||||
12. Termination of the Licence
|
|
||||||
|
|
||||||
The Licence and the rights granted hereunder will terminate automatically upon
|
|
||||||
any breach by the Licensee of the terms of the Licence.
|
|
||||||
|
|
||||||
Such a termination will not terminate the licences of any person who has
|
|
||||||
received the Work from the Licensee under the Licence, provided such persons
|
|
||||||
remain in full compliance with the Licence.
|
|
||||||
|
|
||||||
13. Miscellaneous
|
|
||||||
|
|
||||||
Without prejudice of Article 9 above, the Licence represents the complete
|
|
||||||
agreement between the Parties as to the Work.
|
|
||||||
|
|
||||||
If any provision of the Licence is invalid or unenforceable under applicable
|
|
||||||
law, this will not affect the validity or enforceability of the Licence as a
|
|
||||||
whole. Such provision will be construed or reformed so as necessary to make it
|
|
||||||
valid and enforceable.
|
|
||||||
|
|
||||||
The European Commission may publish other linguistic versions or new versions of
|
|
||||||
this Licence or updated versions of the Appendix, so far this is required and
|
|
||||||
reasonable, without reducing the scope of the rights granted by the Licence. New
|
|
||||||
versions of the Licence will be published with a unique version number.
|
|
||||||
|
|
||||||
All linguistic versions of this Licence, approved by the European Commission,
|
|
||||||
have identical value. Parties can take advantage of the linguistic version of
|
|
||||||
their choice.
|
|
||||||
|
|
||||||
14. Jurisdiction
|
|
||||||
|
|
||||||
Without prejudice to specific agreement between parties,
|
|
||||||
|
|
||||||
- any litigation resulting from the interpretation of this License, arising
|
|
||||||
between the European Union institutions, bodies, offices or agencies, as a
|
|
||||||
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
|
|
||||||
of Justice of the European Union, as laid down in article 272 of the Treaty on
|
|
||||||
the Functioning of the European Union,
|
|
||||||
|
|
||||||
- any litigation arising between other parties and resulting from the
|
|
||||||
interpretation of this License, will be subject to the exclusive jurisdiction
|
|
||||||
of the competent court where the Licensor resides or conducts its primary
|
|
||||||
business.
|
|
||||||
|
|
||||||
15. Applicable Law
|
|
||||||
|
|
||||||
Without prejudice to specific agreement between parties,
|
|
||||||
|
|
||||||
- this Licence shall be governed by the law of the European Union Member State
|
|
||||||
where the Licensor has his seat, resides or has his registered office,
|
|
||||||
|
|
||||||
- this licence shall be governed by Belgian law if the Licensor has no seat,
|
|
||||||
residence or registered office inside a European Union Member State.
|
|
||||||
|
|
||||||
Appendix
|
|
||||||
|
|
||||||
‘Compatible Licences’ according to Article 5 EUPL are:
|
|
||||||
|
|
||||||
- GNU General Public License (GPL) v. 2, v. 3
|
|
||||||
- GNU Affero General Public License (AGPL) v. 3
|
|
||||||
- Open Software License (OSL) v. 2.1, v. 3.0
|
|
||||||
- Eclipse Public License (EPL) v. 1.0
|
|
||||||
- CeCILL v. 2.0, v. 2.1
|
|
||||||
- Mozilla Public Licence (MPL) v. 2
|
|
||||||
- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
|
||||||
- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
|
|
||||||
works other than software
|
|
||||||
- European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
|
||||||
- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
|
|
||||||
Reciprocity (LiLiQ-R+).
|
|
||||||
|
|
||||||
The European Commission may update this Appendix to later versions of the above
|
|
||||||
licences without producing a new version of the EUPL, as long as they provide
|
|
||||||
the rights granted in Article 2 of this Licence and protect the covered Source
|
|
||||||
Code from exclusive appropriation.
|
|
||||||
|
|
||||||
All other changes or additions to this Appendix require the production of a new
|
|
||||||
EUPL version.
|
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
# ===----------------------------------------------------------------------===
|
## ===----------------------------------------------------------------------===
|
||||||
#
|
##
|
||||||
# This source file is part of the AmiiboService open source project
|
## This source file is part of the Amiibo Service open source project
|
||||||
#
|
##
|
||||||
# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
## Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
# Licensed under the EUPL 1.2 or later.
|
## Licensed under Apache license v2.0
|
||||||
#
|
##
|
||||||
# See LICENSE for license information
|
## See LICENSE for license information
|
||||||
# See CONTRIBUTORS for the list of AmiiboAPI project authors
|
## See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
#
|
##
|
||||||
# ===----------------------------------------------------------------------===
|
## SPDX-License-Identifier: Apache-2.0
|
||||||
|
##
|
||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
# ENVIRONMENT VARIABLES
|
# ENVIRONMENT VARIABLES
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
Amiibo Service Project
|
||||||
|
======================
|
||||||
|
|
||||||
|
Please visit the Amiibo Service web site for more information:
|
||||||
|
|
||||||
|
* https://github.com/rock-n-code/amiibo-service
|
||||||
|
|
||||||
|
Copyright 2026 Röck+Cöde VoF
|
||||||
|
|
||||||
|
The Amiibo Service Project licenses this file to you under the Apache License,
|
||||||
|
version 2.0 (the "License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at:
|
||||||
|
|
||||||
|
https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
+17
-12
@@ -1,16 +1,18 @@
|
|||||||
// swift-tools-version: 5.10
|
// swift-tools-version: 6.2
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
@@ -30,9 +32,10 @@ let package = Package(
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/apple/swift-openapi-generator.git", from: "1.3.0"),
|
.package(url: "https://github.com/apple/swift-openapi-generator.git", from: "1.11.0"),
|
||||||
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.5.0"),
|
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.5.0"),
|
||||||
.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.2"),
|
.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.2"),
|
||||||
|
.package(url: "https://github.com/apple/swift-http-types", from: "1.0.0"),
|
||||||
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
|
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
@@ -50,7 +53,9 @@ let package = Package(
|
|||||||
.testTarget(
|
.testTarget(
|
||||||
name: AmiiboService.test,
|
name: AmiiboService.test,
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.byName(name: AmiiboService.target)
|
.byName(name: AmiiboService.target),
|
||||||
|
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||||
|
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime")
|
||||||
],
|
],
|
||||||
path: "Tests/AmiiboService"
|
path: "Tests/AmiiboService"
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,37 +1,148 @@
|
|||||||
# Amiibo Service
|
|
||||||
|
|
||||||
[](https://swiftpackageindex.com/rock-n-code/amiibo-service)
|
[](https://swiftpackageindex.com/rock-n-code/amiibo-service)
|
||||||
[](https://swiftpackageindex.com/rock-n-code/amiibo-service)
|
[](https://swiftpackageindex.com/rock-n-code/amiibo-service)
|
||||||
|
[](https://github.com/rock-n-code/amiibo-service/actions/workflows/ci.yml)
|
||||||
|
|
||||||
A library written entirely with [Swift](https://www.swift.org) that provides everything the developer needs to interacts with the [Amiibo API](https://www.amiiboapi.com) backend service.
|
# Amiibo Service
|
||||||
|
|
||||||
|
A Swift client for the [Amiibo API](https://www.amiiboapi.org).
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Swift 6.2 or later
|
||||||
|
- iOS 13, macOS 10.15, tvOS 13, visionOS 1, or watchOS 6 or later
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
To use this library with your package, then add it as a dependency in the `Package.swift` file:
|
Add the package and the `AmiiboService` product to `Package.swift`:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
let package = Package(
|
let package = Package(
|
||||||
// name, platforms, products, etc.
|
// name, platforms, products, etc.
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/rock-n-code/amiibo-service", from: "1.0.0"),
|
.package(url: "https://github.com/rock-n-code/amiibo-service", from: "2.0.0"),
|
||||||
// other dependencies
|
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
name: "SomeTarget",
|
name: "SomeTarget",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.product(name: "AmiiboService", package: "amiibo-service"),
|
.product(name: "AmiiboService", package: "amiibo-service"),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
// other targets
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible to use this library with your app in Xcode, then add it as a dependency in your Xcode project.
|
In Xcode, add the package URL under **File › Add Package Dependencies…**.
|
||||||
|
|
||||||
> important: Swift 5.10 or higher is required in order to compile this library.
|
## Usage
|
||||||
|
|
||||||
|
```swift
|
||||||
|
import AmiiboService
|
||||||
|
|
||||||
|
let service = AmiiboService()
|
||||||
|
|
||||||
|
// All amiibos
|
||||||
|
let amiibos = try await service.getAmiibos()
|
||||||
|
|
||||||
|
// Amiibos whose name contains "zelda"
|
||||||
|
let zeldaAmiibos = try await service.getAmiibos(.init(name: "zelda"))
|
||||||
|
|
||||||
|
// Amiibo series, types, game characters, and game series
|
||||||
|
let series = try await service.getAmiiboSeries()
|
||||||
|
let types = try await service.getAmiiboTypes()
|
||||||
|
let characters = try await service.getGameCharacters()
|
||||||
|
let gameSeries = try await service.getGameSeries()
|
||||||
|
|
||||||
|
// Date of the last data update (UTC)
|
||||||
|
let lastUpdated = try await service.getLastUpdated()
|
||||||
|
```
|
||||||
|
|
||||||
|
Results are sorted in ascending order by identifier (amiibos) or key (everything else). Models are `Hashable`, `Codable`, and `Identifiable`; filters are `Hashable`.
|
||||||
|
|
||||||
|
## Error handling
|
||||||
|
|
||||||
|
Every call throws `AmiiboServiceError`. When nothing matches, `getAmiibos(_:)` returns an empty array, while the other list calls throw `AmiiboServiceError.notFound`:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
do throws(AmiiboServiceError) {
|
||||||
|
let series = try await service.getAmiiboSeries(.init(key: "0x01"))
|
||||||
|
} catch .notFound {
|
||||||
|
// No amiibo series has this key.
|
||||||
|
} catch {
|
||||||
|
// .badRequest, .cancelled, .decoding, .notAvailable, .undocumented, or .unknown
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Caching
|
||||||
|
|
||||||
|
The library has no built-in cache. The Amiibo API asks regular consumers to cache responses. To do that, give `AmiiboLiveClient` a transport backed by a `URLCache`:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
import OpenAPIURLSession
|
||||||
|
|
||||||
|
let configuration = URLSessionConfiguration.default
|
||||||
|
|
||||||
|
configuration.urlCache = URLCache(
|
||||||
|
memoryCapacity: 5_000_000,
|
||||||
|
diskCapacity: 50_000_000
|
||||||
|
)
|
||||||
|
|
||||||
|
let transport = URLSessionTransport(
|
||||||
|
configuration: .init(
|
||||||
|
session: URLSession(configuration: configuration)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
let service = AmiiboService(
|
||||||
|
client: AmiiboLiveClient(transport: transport)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
To test without network access, pass a mock `AmiiboClient` to `AmiiboService(client:)`. `AmiiboClient` refines `Sendable`, so the mock must be `Sendable`, too:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
import AmiiboService
|
||||||
|
|
||||||
|
struct MockClient: AmiiboClient {
|
||||||
|
var error: AmiiboServiceError?
|
||||||
|
|
||||||
|
func getAmiibos(
|
||||||
|
by filter: AmiiboFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
|
if let error { throw error }
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement the remaining requirements...
|
||||||
|
}
|
||||||
|
|
||||||
|
let service = AmiiboService(client: MockClient())
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Run `make` to list the available tasks for building, testing, and generating documentation.
|
||||||
|
|
||||||
|
The test suite runs offline by default. Tests against the live service run only if `AMIIBO_LIVE_TESTS` is set to `1`:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
AMIIBO_LIVE_TESTS=1 swift test
|
||||||
|
```
|
||||||
|
|
||||||
|
In Xcode, set the variable in the scheme's **Test** action.
|
||||||
|
|
||||||
|
The live tests compare the responses against baselines recorded from the service: minimum item counts per endpoint and the earliest accepted last-updated date. These live in the `Int` extension at the bottom of `AmiiboServiceLiveTests.swift` and in the `get the last updated timestamp` test. Refresh them occasionally by fetching the current totals and the current timestamp from the service, then updating the constants and their `as of` notes:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
for endpoint in amiibo amiiboseries type character gameseries; do
|
||||||
|
printf '%s: ' "$endpoint"
|
||||||
|
curl -s "https://www.amiiboapi.org/api/$endpoint/" | python3 -c 'import json,sys; print(len(json.load(sys.stdin)["amiibo"]))'
|
||||||
|
done
|
||||||
|
curl -s https://www.amiiboapi.org/api/lastupdated/
|
||||||
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Please refer to the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/) for further informations about this library.
|
See the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/).
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ``Amiibo``
|
||||||
|
|
||||||
|
## Topics
|
||||||
|
|
||||||
|
### Nested Models
|
||||||
|
|
||||||
|
- ``Amiibo/Game``
|
||||||
|
- ``Amiibo/Platform``
|
||||||
|
- ``Amiibo/Release``
|
||||||
|
- ``Amiibo/Usage``
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# ``AmiiboClient``
|
||||||
|
|
||||||
|
## Topics
|
||||||
|
|
||||||
|
### Amiibo endpoints
|
||||||
|
|
||||||
|
- ``AmiiboClient/getAmiibos(by:)``
|
||||||
|
- ``AmiiboClient/getAmiiboSeries(by:)``
|
||||||
|
- ``AmiiboClient/getAmiiboTypes(by:)``
|
||||||
|
|
||||||
|
### Game endpoints
|
||||||
|
|
||||||
|
- ``AmiiboClient/getGameCharacters(by:)``
|
||||||
|
- ``AmiiboClient/getGameSeries(by:)``
|
||||||
|
|
||||||
|
### System endpoints
|
||||||
|
|
||||||
|
- ``AmiiboClient/getLastUpdated()``
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# ``AmiiboLiveClient``
|
||||||
|
|
||||||
|
## Topics
|
||||||
|
|
||||||
|
### Initializers
|
||||||
|
|
||||||
|
- ``AmiiboLiveClient/init(transport:)``
|
||||||
|
|
||||||
|
### Amiibo endpoints
|
||||||
|
|
||||||
|
- ``AmiiboLiveClient/getAmiibos(by:)``
|
||||||
|
- ``AmiiboLiveClient/getAmiiboSeries(by:)``
|
||||||
|
- ``AmiiboLiveClient/getAmiiboTypes(by:)``
|
||||||
|
|
||||||
|
### Game endpoints
|
||||||
|
|
||||||
|
- ``AmiiboLiveClient/getGameCharacters(by:)``
|
||||||
|
- ``AmiiboLiveClient/getGameSeries(by:)``
|
||||||
|
|
||||||
|
### System endpoints
|
||||||
|
|
||||||
|
- ``AmiiboLiveClient/getLastUpdated()``
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# ``AmiiboService/AmiiboService``
|
||||||
|
|
||||||
|
## Topics
|
||||||
|
|
||||||
|
### Initializers
|
||||||
|
|
||||||
|
- ``AmiiboService/AmiiboService/init(client:)``
|
||||||
|
|
||||||
|
### Amiibo endpoints
|
||||||
|
|
||||||
|
- ``AmiiboService/AmiiboService/getAmiibos(_:)``
|
||||||
|
- ``AmiiboService/AmiiboService/getAmiiboSeries(_:)``
|
||||||
|
- ``AmiiboService/AmiiboService/getAmiiboTypes(_:)``
|
||||||
|
|
||||||
|
### Game endpoints
|
||||||
|
|
||||||
|
- ``AmiiboService/AmiiboService/getGameCharacters(_:)``
|
||||||
|
- ``AmiiboService/AmiiboService/getGameSeries(_:)``
|
||||||
|
|
||||||
|
### System endpoints
|
||||||
|
|
||||||
|
- ``AmiiboService/AmiiboService/getLastUpdated()``
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# ``AmiiboServiceError``
|
||||||
|
|
||||||
|
## Topics
|
||||||
|
|
||||||
|
### Request errors
|
||||||
|
|
||||||
|
- ``AmiiboServiceError/badRequest``
|
||||||
|
- ``AmiiboServiceError/cancelled``
|
||||||
|
|
||||||
|
### Response errors
|
||||||
|
|
||||||
|
- ``AmiiboServiceError/decoding``
|
||||||
|
- ``AmiiboServiceError/notFound``
|
||||||
|
|
||||||
|
### Service errors
|
||||||
|
|
||||||
|
- ``AmiiboServiceError/notAvailable``
|
||||||
|
- ``AmiiboServiceError/undocumented(_:)``
|
||||||
|
- ``AmiiboServiceError/unknown(_:)``
|
||||||
@@ -1,48 +1,127 @@
|
|||||||
# ``AmiiboService``
|
# ``AmiiboService``
|
||||||
|
|
||||||
A library that provides everything the developer needs to interacts with the **Amiibo API** backend service.
|
A Swift client for the Amiibo API.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
The `AmiiboService` library is a Swift Package Manager package dependency aims at allowing the developer to interact with the [Amiibo API](https://www.amiiboapi.com) backend service seamlessly, by not only providing the *service* type but also any possible *clients*, *models*, *filters* and *errors* types that might be needed during implementation.
|
`AmiiboService` fetches data from the [Amiibo API](https://www.amiiboapi.org) and returns it as Swift models.
|
||||||
|
|
||||||
## Design
|
``AmiiboService`` offers one method per resource: each takes a typed filter, returns sorted models, and throws ``AmiiboServiceError``.
|
||||||
|
|
||||||
Although it could have been possible to generate a one-to-one RESTful client based on the Open API specification document that describe the available endpoints of the backend service, it was decided to design a `AmiiboService` service type that removes the complexities of the API design imposed by the backend service, and provides the developer with a simple interface, and a seamless experience.
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
To use the `AmiiboService` library with your package, then add it as a dependency in the `Package.swift` file:
|
Add the package and the `AmiiboService` product to `Package.swift`:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
let package = Package(
|
let package = Package(
|
||||||
// name, platforms, products, etc.
|
// name, platforms, products, etc.
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/rock-n-code/amiibo-service", from: "1.0.0"),
|
.package(url: "https://github.com/rock-n-code/amiibo-service", from: "2.0.0"),
|
||||||
// other dependencies
|
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
name: "SomeTarget",
|
name: "SomeTarget",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.product(name: "AmiiboService", package: "amiibo-service"),
|
.product(name: "AmiiboService", package: "amiibo-service"),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
// other targets
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible to use the `AmiiboService` library with your app in Xcode, then add it as a dependency in your Xcode project.
|
In Xcode, add the package URL under **File › Add Package Dependencies…**.
|
||||||
|
|
||||||
> important: Swift 5.10 or higher is required in order to compile this library.
|
> Important: Requires Swift 6.2 or later, and iOS 13, macOS 10.15, tvOS 13, visionOS 1, or watchOS 6 or later.
|
||||||
|
|
||||||
## Tasks
|
## Usage
|
||||||
|
|
||||||
This library offers a set of ready-to-use project management tasks that the developer could use from the command line. To show the list of tasks on the `Terminal` app, plus display some explanations about each and every one of them; please enter the following command:
|
Create an ``AmiiboService`` and call its methods. When you omit the filter, the method returns every item:
|
||||||
|
|
||||||
```bash
|
```swift
|
||||||
$ make
|
import AmiiboService
|
||||||
|
|
||||||
|
let service = AmiiboService()
|
||||||
|
|
||||||
|
// All amiibos
|
||||||
|
let amiibos = try await service.getAmiibos()
|
||||||
|
|
||||||
|
// Amiibos whose name contains "zelda"
|
||||||
|
let zeldaAmiibos = try await service.getAmiibos(.init(name: "zelda"))
|
||||||
|
|
||||||
|
// Amiibo series, types, game characters, and game series
|
||||||
|
let series = try await service.getAmiiboSeries()
|
||||||
|
let types = try await service.getAmiiboTypes()
|
||||||
|
let characters = try await service.getGameCharacters()
|
||||||
|
let gameSeries = try await service.getGameSeries()
|
||||||
|
|
||||||
|
// Date of the last data update (UTC)
|
||||||
|
let lastUpdated = try await service.getLastUpdated()
|
||||||
|
```
|
||||||
|
|
||||||
|
Results are sorted in ascending order by ``Amiibo/identifier`` or by `key`.
|
||||||
|
|
||||||
|
## Error handling
|
||||||
|
|
||||||
|
Every method throws ``AmiiboServiceError``. When nothing matches, ``AmiiboService/getAmiibos(_:)`` returns an empty array, while the other list methods throw ``AmiiboServiceError/notFound``:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
do throws(AmiiboServiceError) {
|
||||||
|
let series = try await service.getAmiiboSeries(.init(key: "0x01"))
|
||||||
|
} catch .notFound {
|
||||||
|
// No amiibo series has this key.
|
||||||
|
} catch {
|
||||||
|
// .badRequest, .cancelled, .decoding, .notAvailable, .undocumented, or .unknown
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Caching
|
||||||
|
|
||||||
|
The library has no built-in cache, and the Amiibo API asks regular consumers to cache responses. To cache at the HTTP level, give ``AmiiboLiveClient`` a transport backed by a `URLCache`:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
import OpenAPIURLSession
|
||||||
|
|
||||||
|
let configuration = URLSessionConfiguration.default
|
||||||
|
|
||||||
|
configuration.urlCache = URLCache(
|
||||||
|
memoryCapacity: 5_000_000,
|
||||||
|
diskCapacity: 50_000_000
|
||||||
|
)
|
||||||
|
|
||||||
|
let transport = URLSessionTransport(
|
||||||
|
configuration: .init(
|
||||||
|
session: URLSession(configuration: configuration)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
let service = AmiiboService(
|
||||||
|
client: AmiiboLiveClient(transport: transport)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Models are `Codable`, so you can also store them yourself.
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
To test without network access, pass a mock ``AmiiboClient`` to ``AmiiboService/init(client:)``. ``AmiiboClient`` refines `Sendable`, so the mock must be `Sendable`, too:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
import AmiiboService
|
||||||
|
|
||||||
|
struct MockClient: AmiiboClient {
|
||||||
|
var error: AmiiboServiceError?
|
||||||
|
|
||||||
|
func getAmiibos(
|
||||||
|
by filter: AmiiboFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
|
if let error { throw error }
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement the remaining requirements...
|
||||||
|
}
|
||||||
|
|
||||||
|
let service = AmiiboService(client: MockClient())
|
||||||
```
|
```
|
||||||
|
|
||||||
## Topics
|
## Topics
|
||||||
@@ -59,10 +138,6 @@ $ make
|
|||||||
### Models
|
### Models
|
||||||
|
|
||||||
- ``Amiibo``
|
- ``Amiibo``
|
||||||
- ``Amiibo/Game``
|
|
||||||
- ``Amiibo/Platform``
|
|
||||||
- ``Amiibo/Release``
|
|
||||||
- ``Amiibo/Usage``
|
|
||||||
- ``AmiiboSeries``
|
- ``AmiiboSeries``
|
||||||
- ``AmiiboType``
|
- ``AmiiboType``
|
||||||
- ``GameCharacter``
|
- ``GameCharacter``
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@@ -16,17 +18,30 @@ extension DateFormatter {
|
|||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// An ISO timestamp formatter.
|
/// An ISO date formatter for the `yyyy-MM-dd` format.
|
||||||
///
|
static let isoDate: DateFormatter = {
|
||||||
/// This formatter implements the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` custom date format.
|
|
||||||
/// Within the context of this library, this formatter is solely used to decode a date formatted as a timestamp that is returned by the ``AmiiboService/getLastUpdated()`` function.
|
|
||||||
static var isoTimestamp: DateFormatter {
|
|
||||||
let formatter = DateFormatter()
|
let formatter = DateFormatter()
|
||||||
|
|
||||||
|
// The POSIX locale keeps the user's locale and 12/24-hour setting from altering fixed-format parsing.
|
||||||
|
formatter.locale = .init(identifier: "en_US_POSIX")
|
||||||
|
formatter.dateFormat = "yyyy-MM-dd"
|
||||||
|
formatter.timeZone = .init(secondsFromGMT: 0)
|
||||||
|
|
||||||
|
return formatter
|
||||||
|
}()
|
||||||
|
|
||||||
|
/// An ISO timestamp formatter for the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` format.
|
||||||
|
///
|
||||||
|
/// Used only to decode the timestamp returned by ``AmiiboService/getLastUpdated()``.
|
||||||
|
static let isoTimestamp: DateFormatter = {
|
||||||
|
let formatter = DateFormatter()
|
||||||
|
|
||||||
|
// The POSIX locale keeps the user's locale and 12/24-hour setting from altering fixed-format parsing.
|
||||||
|
formatter.locale = .init(identifier: "en_US_POSIX")
|
||||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
|
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
|
||||||
formatter.timeZone = .init(secondsFromGMT: 0)
|
formatter.timeZone = .init(secondsFromGMT: 0)
|
||||||
|
|
||||||
return formatter
|
return formatter
|
||||||
}
|
}()
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A protocol that defines filters that might contain `key` and/or `name` values.
|
/// A protocol for filters with optional `key` and `name` values.
|
||||||
protocol KeyNameFilter {
|
protocol KeyNameFilter: Hashable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A protocol that defines decodable models containing the `key` and `name` properties.
|
/// A protocol that defines models containing a `key` and `name` pair.
|
||||||
protocol KeyNameModel: Sendable {
|
protocol KeyNameModel: Sendable, Hashable, Codable, Identifiable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key.
|
/// A hexadecimal key that uniquely identifies this model.
|
||||||
var key: String { get }
|
var key: String { get }
|
||||||
|
|
||||||
/// A name.
|
/// A display name for this model.
|
||||||
var name: String { get }
|
var name: String { get }
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this model from a given payload.
|
/// Initializes this model from a given payload.
|
||||||
/// - Parameter payload: A payload that contains the values for the model.
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
init(_ payload: Components.Schemas.Tuple)
|
init(_ payload: some KeyNamePayload)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A protocol that unifies the generated payload types containing a `key` and `name` pair.
|
||||||
|
protocol KeyNamePayload {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// A hexadecimal key that uniquely identifies this payload.
|
||||||
|
var key: String { get }
|
||||||
|
|
||||||
|
/// A display name for this payload.
|
||||||
|
var name: String { get }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Conformances
|
||||||
|
|
||||||
|
extension Components.Schemas.AmiiboSeries: KeyNamePayload {}
|
||||||
|
extension Components.Schemas.AmiiboType: KeyNamePayload {}
|
||||||
|
extension Components.Schemas.GameCharacter: KeyNamePayload {}
|
||||||
|
extension Components.Schemas.GameSeries: KeyNamePayload {}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import OpenAPIRuntime
|
||||||
|
|
||||||
|
/// A transcoder for ISO dates in the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` timestamp and `yyyy-MM-dd` date-only formats.
|
||||||
|
struct ISODateTimeTranscoder {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// The ISO timestamp formatter.
|
||||||
|
private let timestampFormatter: DateFormatter = .isoTimestamp
|
||||||
|
|
||||||
|
/// The ISO date-only formatter.
|
||||||
|
private let dateFormatter: DateFormatter = .isoDate
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - DateTranscoder
|
||||||
|
|
||||||
|
extension ISODateTimeTranscoder: DateTranscoder {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
/// Encodes a date as an ISO timestamp string.
|
||||||
|
func encode(_ date: Date) throws -> String {
|
||||||
|
timestampFormatter.string(from: date)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Decodes an ISO date string, trying the timestamp format before the date-only one.
|
||||||
|
/// - Throws: A `DecodingError` if the string matches neither format.
|
||||||
|
func decode(_ string: String) throws -> Date {
|
||||||
|
if let date = timestampFormatter.date(from: string) {
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
if let date = dateFormatter.date(from: string) {
|
||||||
|
return date
|
||||||
|
}
|
||||||
|
|
||||||
|
throw DecodingError.dataCorrupted(.init(
|
||||||
|
codingPath: [],
|
||||||
|
debugDescription: "Expected an ISO date with format 'yyyy-MM-dd'T'HH:mm:ss.SSSSSS' or 'yyyy-MM-dd', but found '\(string)' instead."
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===
|
|
||||||
//
|
|
||||||
// This source file is part of the AmiiboService open source project
|
|
||||||
//
|
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
|
||||||
// Licensed under the EUPL 1.2 or later.
|
|
||||||
//
|
|
||||||
// See LICENSE for license information
|
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import OpenAPIRuntime
|
|
||||||
|
|
||||||
/// A type that allows the decoding and encoding of ISO timestamp dates, defined by the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` custom date format.
|
|
||||||
struct ISOTimestampTranscoder {
|
|
||||||
|
|
||||||
// MARK: Properties
|
|
||||||
|
|
||||||
/// A formatter to use to decode and encode ISO timestamps dates.
|
|
||||||
private let dateFormatter: DateFormatter = .isoTimestamp
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - DateTranscoder
|
|
||||||
|
|
||||||
extension ISOTimestampTranscoder: DateTranscoder {
|
|
||||||
|
|
||||||
// MARK: Functions
|
|
||||||
|
|
||||||
func encode(_ date: Date) throws -> String {
|
|
||||||
dateFormatter.string(from: date)
|
|
||||||
}
|
|
||||||
|
|
||||||
func decode(_ string: String) throws -> Date {
|
|
||||||
dateFormatter.date(from: string) ?? .init()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,519 +1,122 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import OpenAPIRuntime
|
import OpenAPIRuntime
|
||||||
import OpenAPIURLSession
|
import OpenAPIURLSession
|
||||||
|
|
||||||
/// A type that implements a live client to the online service.
|
/// A live client for the [Amiibo API](https://www.amiiboapi.org).
|
||||||
public struct AmiiboLiveClient {
|
///
|
||||||
|
/// It maps transport errors and unsuccessful responses to ``AmiiboServiceError``, and sorts list results by identifier or key.
|
||||||
|
public struct AmiiboLiveClient: Sendable {
|
||||||
|
|
||||||
|
// MARK: Constants
|
||||||
|
|
||||||
|
/// The base URL of the live service, from the OpenAPI specification.
|
||||||
|
///
|
||||||
|
/// A unit test guards this URL, so resolution is not expected to fail at runtime.
|
||||||
|
static let serverURL: URL = {
|
||||||
|
guard let url = try? Servers.Server1.url() else {
|
||||||
|
fatalError("The server URL defined in the OpenAPI specification could not be resolved. Verify that the 'openapi.yaml' server definition is valid.")
|
||||||
|
}
|
||||||
|
|
||||||
|
return url
|
||||||
|
}()
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A client generated by the `OpenAPIRuntime` library.
|
/// A client generated by the OpenAPI Runtime library to perform API calls.
|
||||||
private let client: Client
|
private let client: Client
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this client.
|
/// Initializes this client.
|
||||||
public init() {
|
/// - Parameter transport: A transport for HTTP operations. Defaults to a `URLSessionTransport` on the shared session.
|
||||||
|
public init(transport: any ClientTransport = URLSessionTransport()) {
|
||||||
self.client = .init(
|
self.client = .init(
|
||||||
// The force unwrapping implemented below assumes that the server definition from the OpenAPI specification is correct.
|
serverURL: Self.serverURL,
|
||||||
serverURL: try! Servers.Server1.url(),
|
configuration: .init(dateTranscoder: ISODateTimeTranscoder()),
|
||||||
configuration: .init(dateTranscoder: ISOTimestampTranscoder()),
|
transport: transport
|
||||||
transport: URLSessionTransport()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - AmiiboClient
|
// MARK: - AmiiboClient
|
||||||
// TODO: Remove the documentation from the functions inside the following extension as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
// NOTE: The `AmiiboClient` documentation is repeated below on purpose, as the compiler does not inherit
|
||||||
|
// documentation for protocol witnesses and DocC would otherwise render these functions undocumented.
|
||||||
|
|
||||||
extension AmiiboLiveClient: AmiiboClient {
|
extension AmiiboLiveClient: AmiiboClient {
|
||||||
|
|
||||||
// MARK: Functions
|
// MARK: Functions
|
||||||
|
|
||||||
#if swift(>=6.0)
|
|
||||||
/// Gets a list of amiibo items based on a given filter.
|
/// Gets a list of amiibo items based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo items.
|
/// - Returns: A list of filtered amiibo items.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getAmiibos(
|
public func getAmiibos(
|
||||||
by filter: AmiiboFilter
|
by filter: AmiiboFilter
|
||||||
) async throws(AmiiboServiceError) -> [Amiibo] {
|
) async throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
let response: Operations.getAmiibos.Output
|
try await fetchAmiibos(filter)
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getAmiibos(
|
|
||||||
.init(query: .init(
|
|
||||||
amiiboSeries: filter.series,
|
|
||||||
character: filter.gameCharacter,
|
|
||||||
gameseries: filter.gameSeries,
|
|
||||||
id: filter.identifier,
|
|
||||||
name: filter.name,
|
|
||||||
showgames: filter.showGames,
|
|
||||||
showusage: filter.showUsage,
|
|
||||||
_type: filter.type
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch let error as ClientError {
|
|
||||||
if error.underlyingError is DecodingError {
|
|
||||||
throw AmiiboServiceError.decoding
|
|
||||||
} else {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of amiibo series based on a given filter.
|
/// Gets a list of amiibo series based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo series.
|
/// - Returns: A list of filtered amiibo series.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getAmiiboSeries(
|
public func getAmiiboSeries(
|
||||||
by filter: AmiiboSeriesFilter
|
by filter: AmiiboSeriesFilter
|
||||||
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
||||||
let response: Operations.getAmiiboSeries.Output
|
try await fetchAmiiboSeries(filter)
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getAmiiboSeries(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: AmiiboSeries.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of amiibo types based on a given filter.
|
/// Gets a list of amiibo types based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo types.
|
/// - Returns: A list of filtered amiibo types.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getAmiiboTypes(
|
public func getAmiiboTypes(
|
||||||
by filter: AmiiboTypeFilter
|
by filter: AmiiboTypeFilter
|
||||||
) async throws(AmiiboServiceError) -> [AmiiboType] {
|
) async throws(AmiiboServiceError) -> [AmiiboType] {
|
||||||
let response: Operations.getAmiiboTypes.Output
|
try await fetchAmiiboTypes(filter)
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getAmiiboTypes(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: AmiiboType.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of game characters based on a given filter.
|
/// Gets a list of game characters based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered game characters.
|
/// - Returns: A list of filtered game characters.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getGameCharacters(
|
public func getGameCharacters(
|
||||||
by filter: GameCharacterFilter
|
by filter: GameCharacterFilter
|
||||||
) async throws(AmiiboServiceError) -> [GameCharacter] {
|
) async throws(AmiiboServiceError) -> [GameCharacter] {
|
||||||
let response: Operations.getGameCharacters.Output
|
try await fetchGameCharacters(filter)
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getGameCharacters(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: GameCharacter.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of game series based on a given filter.
|
/// Gets a list of game series based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered game series.
|
/// - Returns: A list of filtered game series.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getGameSeries(
|
public func getGameSeries(
|
||||||
by filter: GameSeriesFilter
|
by filter: GameSeriesFilter
|
||||||
) async throws(AmiiboServiceError) -> [GameSeries] {
|
) async throws(AmiiboServiceError) -> [GameSeries] {
|
||||||
let response: Operations.getGameSeries.Output
|
try await fetchGameSeries(filter)
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getGameSeries(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: GameSeries.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the date when the data was last updated.
|
/// 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.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getLastUpdated() async throws(AmiiboServiceError) -> Date {
|
public func getLastUpdated() async throws(AmiiboServiceError) -> Date {
|
||||||
let response: Operations.getLastUpdated.Output
|
try await fetchLastUpdated()
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getLastUpdated()
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return output.lastUpdated
|
|
||||||
}
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/// Gets a list of amiibo items based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo items.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getAmiibos(
|
|
||||||
by filter: AmiiboFilter
|
|
||||||
) async throws -> [Amiibo] {
|
|
||||||
let response: Operations.getAmiibos.Output
|
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getAmiibos(
|
|
||||||
.init(query: .init(
|
|
||||||
amiiboSeries: filter.series,
|
|
||||||
character: filter.gameCharacter,
|
|
||||||
gameseries: filter.gameSeries,
|
|
||||||
id: filter.identifier,
|
|
||||||
name: filter.name,
|
|
||||||
showgames: filter.showGames,
|
|
||||||
showusage: filter.showUsage,
|
|
||||||
_type: filter.type
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch let error as ClientError {
|
|
||||||
if error.underlyingError is DecodingError {
|
|
||||||
throw AmiiboServiceError.decoding
|
|
||||||
} else {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of amiibo series based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo series.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getAmiiboSeries(
|
|
||||||
by filter: AmiiboSeriesFilter
|
|
||||||
) async throws -> [AmiiboSeries] {
|
|
||||||
let response: Operations.getAmiiboSeries.Output
|
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getAmiiboSeries(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: AmiiboSeries.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of amiibo types based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo types.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getAmiiboTypes(
|
|
||||||
by filter: AmiiboTypeFilter
|
|
||||||
) async throws -> [AmiiboType] {
|
|
||||||
let response: Operations.getAmiiboTypes.Output
|
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getAmiiboTypes(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: AmiiboType.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of game characters based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered game characters.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getGameCharacters(
|
|
||||||
by filter: GameCharacterFilter
|
|
||||||
) async throws -> [GameCharacter] {
|
|
||||||
let response: Operations.getGameCharacters.Output
|
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getGameCharacters(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: GameCharacter.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of game series based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered game series.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getGameSeries(
|
|
||||||
by filter: GameSeriesFilter
|
|
||||||
) async throws -> [GameSeries] {
|
|
||||||
let response: Operations.getGameSeries.Output
|
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getGameSeries(
|
|
||||||
.init(query: .init(
|
|
||||||
key: filter.key,
|
|
||||||
name: filter.name
|
|
||||||
))
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return map(output, as: GameSeries.self)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .badRequest:
|
|
||||||
throw AmiiboServiceError.badRequest
|
|
||||||
|
|
||||||
case .internalServerError:
|
|
||||||
throw AmiiboServiceError.notAvailable
|
|
||||||
|
|
||||||
case .notFound:
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets the date when the data was last updated.
|
|
||||||
/// - Returns: A last updated date.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getLastUpdated() async throws -> Date {
|
|
||||||
let response: Operations.getLastUpdated.Output
|
|
||||||
|
|
||||||
do {
|
|
||||||
response = try await client.getLastUpdated()
|
|
||||||
} catch {
|
|
||||||
throw AmiiboServiceError.unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
switch response {
|
|
||||||
case let .ok(ok):
|
|
||||||
switch ok.body {
|
|
||||||
case let .json(output):
|
|
||||||
return output.lastUpdated
|
|
||||||
}
|
|
||||||
|
|
||||||
case let .undocumented(statusCode, _):
|
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -523,40 +126,257 @@ private extension AmiiboLiveClient {
|
|||||||
|
|
||||||
// MARK: Functions
|
// MARK: Functions
|
||||||
|
|
||||||
/// Retrieves a list of amiibo items from a wrapper container.
|
/// Fetches the amiibos matching a filter.
|
||||||
/// - Parameter wrapper: A wrapper container that either has an object or a list of items.
|
func fetchAmiibos(
|
||||||
/// - Returns: A list of amiibo items, sorted by identifiers.
|
_ filter: AmiiboFilter
|
||||||
func map(
|
) async throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
_ wrapper: Components.Schemas.AmiiboWrapper
|
let response = try await perform {
|
||||||
) -> [Amiibo] {
|
try await client.getAmiibos(.init(query: .init(
|
||||||
switch wrapper.amiibo {
|
id: filter.identifier,
|
||||||
case let .Amiibo(object):
|
head: filter.head,
|
||||||
return [.init(object)]
|
tail: filter.tail,
|
||||||
|
name: filter.name,
|
||||||
case let .AmiiboList(list):
|
_type: filter.type,
|
||||||
return list
|
amiiboSeries: filter.series,
|
||||||
.map { .init($0) }
|
character: filter.gameCharacter,
|
||||||
.sorted { $0.identifier < $1.identifier }
|
gameseries: filter.gameSeries,
|
||||||
|
showgames: filter.showGames,
|
||||||
|
showusage: filter.showUsage
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
||||||
|
switch response {
|
||||||
|
case let .ok(ok):
|
||||||
|
switch ok.body {
|
||||||
|
case let .json(output):
|
||||||
|
switch output.amiibo {
|
||||||
|
case let .Amiibo(object):
|
||||||
|
return [Amiibo(object)]
|
||||||
|
case let .AmiiboList(list):
|
||||||
|
return list
|
||||||
|
.map { Amiibo($0) }
|
||||||
|
.sorted { $0.identifier < $1.identifier }
|
||||||
|
case .none:
|
||||||
|
// The service returns `"amiibo": null` when an `id` filter matches nothing.
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case .badRequest:
|
||||||
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
case let .undocumented(statusCode, _):
|
||||||
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches the amiibo series matching a filter.
|
||||||
|
func fetchAmiiboSeries(
|
||||||
|
_ filter: AmiiboSeriesFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
||||||
|
let response = try await perform {
|
||||||
|
try await client.getAmiiboSeries(.init(query: .init(
|
||||||
|
key: filter.key,
|
||||||
|
name: filter.name
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
||||||
|
switch response {
|
||||||
|
case let .ok(ok):
|
||||||
|
switch ok.body {
|
||||||
|
case let .json(output):
|
||||||
|
switch output.amiibo {
|
||||||
|
case let .AmiiboSeries(payload):
|
||||||
|
return makeModels(from: [payload])
|
||||||
|
case let .AmiiboSeriesList(list):
|
||||||
|
return makeModels(from: list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case .badRequest:
|
||||||
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case let .undocumented(statusCode, _):
|
||||||
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieves a list of items that conforms to the `KeyNameModel` protocol from a wrapper container.
|
/// Fetches the amiibo types matching a filter.
|
||||||
/// - Parameters:
|
func fetchAmiiboTypes(
|
||||||
/// - wrapper: A wrapper container that either has an object or a list of items.
|
_ filter: AmiiboTypeFilter
|
||||||
/// - as: a model type that conforms to the `KeyNameModel` protocol.
|
) async throws(AmiiboServiceError) -> [AmiiboType] {
|
||||||
/// - Returns: A list of items that conforms to the `KeyNameModel` protocol, sorted by keys.
|
let response = try await perform {
|
||||||
func map<Model: KeyNameModel>(
|
try await client.getAmiiboTypes(.init(query: .init(
|
||||||
_ wrapper: Components.Schemas.TupleWrapper,
|
key: filter.key,
|
||||||
as: Model.Type
|
name: filter.name
|
||||||
) -> [Model] {
|
)))
|
||||||
switch wrapper.amiibo {
|
}
|
||||||
case let .Tuple(payload):
|
|
||||||
return [.init(payload)]
|
switch response {
|
||||||
|
case let .ok(ok):
|
||||||
case let .TupleList(list):
|
switch ok.body {
|
||||||
return list
|
case let .json(output):
|
||||||
.map { .init($0) }
|
switch output.amiibo {
|
||||||
.sorted { $0.key < $1.key }
|
case let .AmiiboType(payload):
|
||||||
|
return makeModels(from: [payload])
|
||||||
|
case let .AmiiboTypeList(list):
|
||||||
|
return makeModels(from: list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case .badRequest:
|
||||||
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case let .undocumented(statusCode, _):
|
||||||
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches the game characters matching a filter.
|
||||||
|
func fetchGameCharacters(
|
||||||
|
_ filter: GameCharacterFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [GameCharacter] {
|
||||||
|
let response = try await perform {
|
||||||
|
try await client.getGameCharacters(.init(query: .init(
|
||||||
|
key: filter.key,
|
||||||
|
name: filter.name
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
||||||
|
switch response {
|
||||||
|
case let .ok(ok):
|
||||||
|
switch ok.body {
|
||||||
|
case let .json(output):
|
||||||
|
switch output.amiibo {
|
||||||
|
case let .GameCharacter(payload):
|
||||||
|
return makeModels(from: [payload])
|
||||||
|
case let .GameCharacterList(list):
|
||||||
|
return makeModels(from: list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case .badRequest:
|
||||||
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case let .undocumented(statusCode, _):
|
||||||
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches the game series matching a filter.
|
||||||
|
func fetchGameSeries(
|
||||||
|
_ filter: GameSeriesFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [GameSeries] {
|
||||||
|
let response = try await perform {
|
||||||
|
try await client.getGameSeries(.init(query: .init(
|
||||||
|
key: filter.key,
|
||||||
|
name: filter.name
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
||||||
|
switch response {
|
||||||
|
case let .ok(ok):
|
||||||
|
switch ok.body {
|
||||||
|
case let .json(output):
|
||||||
|
switch output.amiibo {
|
||||||
|
case let .GameSeries(payload):
|
||||||
|
return makeModels(from: [payload])
|
||||||
|
case let .GameSeriesList(list):
|
||||||
|
return makeModels(from: list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case .badRequest:
|
||||||
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case let .undocumented(statusCode, _):
|
||||||
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches the date when the data was last updated.
|
||||||
|
func fetchLastUpdated() async throws(AmiiboServiceError) -> Date {
|
||||||
|
let response = try await perform {
|
||||||
|
try await client.getLastUpdated()
|
||||||
|
}
|
||||||
|
|
||||||
|
switch response {
|
||||||
|
case let .ok(ok):
|
||||||
|
switch ok.body {
|
||||||
|
case let .json(output):
|
||||||
|
return output.lastUpdated
|
||||||
|
}
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
case let .undocumented(statusCode, _):
|
||||||
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Performs an API call, mapping any error to an ``AmiiboServiceError``.
|
||||||
|
func perform<Output>(
|
||||||
|
_ operation: () async throws -> Output
|
||||||
|
) async throws(AmiiboServiceError) -> Output {
|
||||||
|
do {
|
||||||
|
return try await operation()
|
||||||
|
} catch {
|
||||||
|
try handle(error: error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Maps key-name payloads into models sorted by key.
|
||||||
|
func makeModels<Model: KeyNameModel>(from payloads: [some KeyNamePayload]) -> [Model] {
|
||||||
|
payloads
|
||||||
|
.map { Model($0) }
|
||||||
|
.sorted { $0.key < $1.key }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Maps an error to the corresponding ``AmiiboServiceError``.
|
||||||
|
func handle(error: any Error) throws(AmiiboServiceError) -> Never {
|
||||||
|
switch error {
|
||||||
|
case is CancellationError:
|
||||||
|
throw AmiiboServiceError.cancelled
|
||||||
|
case let clientError as ClientError:
|
||||||
|
// The underlying client wraps every error, including cancellation, in a `ClientError`.
|
||||||
|
switch clientError.underlyingError {
|
||||||
|
case is CancellationError:
|
||||||
|
throw AmiiboServiceError.cancelled
|
||||||
|
case is DecodingError:
|
||||||
|
throw AmiiboServiceError.decoding
|
||||||
|
case let urlError as URLError:
|
||||||
|
switch urlError.code {
|
||||||
|
case .cancelled:
|
||||||
|
throw AmiiboServiceError.cancelled
|
||||||
|
case .cannotParseResponse:
|
||||||
|
throw AmiiboServiceError.decoding
|
||||||
|
case .cannotFindHost,
|
||||||
|
.cannotConnectToHost,
|
||||||
|
.dataNotAllowed,
|
||||||
|
.dnsLookupFailed,
|
||||||
|
.internationalRoamingOff,
|
||||||
|
.networkConnectionLost,
|
||||||
|
.notConnectedToInternet,
|
||||||
|
.secureConnectionFailed,
|
||||||
|
.timedOut:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
|
default:
|
||||||
|
throw AmiiboServiceError.unknown(String(describing: urlError))
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
throw AmiiboServiceError.unknown(String(describing: clientError.underlyingError))
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
throw AmiiboServiceError.unknown(String(describing: error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,59 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A representation of all the possible errors that the ``AmiiboService`` service could throw.
|
import Foundation
|
||||||
|
|
||||||
|
/// An error thrown by ``AmiiboService`` and ``AmiiboClient`` methods.
|
||||||
public enum AmiiboServiceError: Error {
|
public enum AmiiboServiceError: Error {
|
||||||
/// A bad request has been given to the client.
|
/// The request was malformed or contained invalid filter parameters.
|
||||||
case badRequest
|
case badRequest
|
||||||
/// A response cannot be decoded.
|
/// The request was cancelled before a response was received.
|
||||||
|
case cancelled
|
||||||
|
/// The response body could not be decoded into the expected model.
|
||||||
case decoding
|
case decoding
|
||||||
/// An online service is not currently available.
|
/// The service is unreachable due to a network or server issue.
|
||||||
case notAvailable
|
case notAvailable
|
||||||
/// A response cannot be found.
|
/// No results were found matching the given filter criteria.
|
||||||
|
///
|
||||||
|
/// When no amiibos match, ``AmiiboService/getAmiibos(_:)`` returns an empty array instead of throwing this error.
|
||||||
case notFound
|
case notFound
|
||||||
/// An undocumented/unsupported status code error.
|
/// The server returned an undocumented HTTP status code.
|
||||||
case undocumented(_ statusCode: Int)
|
case undocumented(_ statusCode: Int)
|
||||||
/// An unknown error.
|
/// Any other error, with a description of the underlying one.
|
||||||
case unknown
|
case unknown(_ description: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Equatable
|
// MARK: - Equatable
|
||||||
|
|
||||||
extension AmiiboServiceError: Equatable {}
|
extension AmiiboServiceError: Equatable {}
|
||||||
|
|
||||||
|
// MARK: - LocalizedError
|
||||||
|
|
||||||
|
extension AmiiboServiceError: LocalizedError {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
public var errorDescription: String? {
|
||||||
|
switch self {
|
||||||
|
case .badRequest: "The request was malformed or contained invalid filter parameters."
|
||||||
|
case .cancelled: "The request was cancelled before a response was received."
|
||||||
|
case .decoding: "The response body could not be decoded into the expected model."
|
||||||
|
case .notAvailable: "The backend service is currently unreachable due to a network or server issue."
|
||||||
|
case .notFound: "No results were found matching the given filter criteria."
|
||||||
|
case .undocumented(let statusCode): "The server returned an undocumented HTTP status code: \(statusCode)."
|
||||||
|
case .unknown(let description): "An unexpected error occurred: \(description)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,57 +1,71 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A filter for amiibo requests.
|
||||||
|
///
|
||||||
|
/// Values left as `nil` do not restrict the result.
|
||||||
|
public struct AmiiboFilter: Sendable, Hashable {
|
||||||
|
|
||||||
/// A type that contains values to fine-tune a response when requesting amiibo items.
|
|
||||||
public struct AmiiboFilter {
|
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A game character to return, if any.
|
/// A game character key or name to match, if any.
|
||||||
public let gameCharacter: String?
|
public let gameCharacter: String?
|
||||||
|
|
||||||
/// A game series to return, if any.
|
/// A game series key or name to match, if any.
|
||||||
public let gameSeries: String?
|
public let gameSeries: String?
|
||||||
|
|
||||||
/// An amiibo identifier to return, if any.
|
/// The first 8 hexadecimal characters of an identifier to match, if any. Shorter values match as a prefix.
|
||||||
|
public let head: String?
|
||||||
|
|
||||||
|
/// A full 16-character hexadecimal identifier to match, if any.
|
||||||
public let identifier: String?
|
public let identifier: String?
|
||||||
|
|
||||||
/// An amiibo name to return, if any.
|
/// An amiibo name, or part of one, to match, if any.
|
||||||
public let name: String?
|
public let name: String?
|
||||||
|
|
||||||
/// An amiibo series to return, if any.
|
/// An amiibo series key or name to match, if any.
|
||||||
public let series: String?
|
public let series: String?
|
||||||
|
|
||||||
/// A flag indicating whether to include games in the response, if any.
|
/// Whether to include related games in ``Amiibo/platform``. `nil` means `false`.
|
||||||
public let showGames: Bool?
|
public let showGames: Bool?
|
||||||
|
|
||||||
/// A flag indicating whether to include amiibo usages in games in the response, if any.
|
/// Whether to include related games and their usages in ``Amiibo/platform``. `nil` means `false`.
|
||||||
public let showUsage: Bool?
|
public let showUsage: Bool?
|
||||||
|
|
||||||
/// An amiibo type to return, if any.
|
/// The last 8 hexadecimal characters of an identifier to match, if any. Shorter values match as a prefix.
|
||||||
|
public let tail: String?
|
||||||
|
|
||||||
|
/// An amiibo type key or name to match, 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: The first 8 hexadecimal characters of an identifier to match, if any. Shorter values match as a prefix.
|
||||||
/// - name: An amiibo name to return, if any.
|
/// - tail: The last 8 hexadecimal characters of an identifier to match, if any. Shorter values match as a prefix.
|
||||||
/// - type: An amiibo type to return, if any.
|
/// - identifier: A full 16-character hexadecimal identifier to match, if any.
|
||||||
/// - series: An amiibo series to return, if any.
|
/// - name: An amiibo name, or part of one, to match, if any.
|
||||||
/// - gameCharacter: A game character to return, if any.
|
/// - type: An amiibo type key or name to match, if any.
|
||||||
/// - gameSeries: A game series to return, if any.
|
/// - series: An amiibo series key or name to match, if any.
|
||||||
/// - showGames: A flag indicating whether to include games in the response, if any.
|
/// - gameCharacter: A game character key or name to match, if any.
|
||||||
/// - showUsage: A flag indicating whether to include amiibo usages in games in the response, if any.
|
/// - gameSeries: A game series key or name to match, if any.
|
||||||
|
/// - showGames: Whether to include related games in ``Amiibo/platform``. `nil` means `false`.
|
||||||
|
/// - showUsage: Whether to include related games and their usages in ``Amiibo/platform``. `nil` means `false`.
|
||||||
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 +77,13 @@ public struct AmiiboFilter {
|
|||||||
) {
|
) {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +1,47 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A filter for amiibo series requests.
|
||||||
|
public struct AmiiboSeriesFilter: KeyNameFilter, Sendable {
|
||||||
|
|
||||||
/// A type that contains values to fine-tune a response when requesting amiibo series.
|
|
||||||
public struct AmiiboSeriesFilter: KeyNameFilter {
|
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key to return, if any.
|
/// A hexadecimal key in `0x` format, such as `0x01`, to match exactly, if any.
|
||||||
public let key: String?
|
public let key: String?
|
||||||
|
|
||||||
/// A name to return, if any.
|
/// A name, or part of one, to match, if any.
|
||||||
public let name: String?
|
public let name: String?
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this filter without key or name values.
|
/// Initializes a filter that matches every amiibo series.
|
||||||
public init() {
|
public init() {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a key value.
|
/// Initializes a filter that matches the amiibo series with a given key.
|
||||||
/// - Parameter key: A key to return.
|
/// - Parameter key: A hexadecimal key in `0x` format, such as `0x01`.
|
||||||
public init(key: String) {
|
public init(key: String) {
|
||||||
self.key = key
|
self.key = key
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a name value.
|
/// Initializes a filter that matches amiibo series by name.
|
||||||
/// - Parameter name: A name to return.
|
/// - Parameter name: A name, or part of one.
|
||||||
public init(name: String) {
|
public init(name: String) {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|||||||
@@ -1,45 +1,47 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A type that contains values to fine-tune a response when requesting amiibo types.
|
/// A filter for amiibo type requests.
|
||||||
public struct AmiiboTypeFilter: KeyNameFilter {
|
public struct AmiiboTypeFilter: KeyNameFilter, Sendable {
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key to return, if any.
|
/// A hexadecimal key in `0x` format, such as `0x01`, to match exactly, if any.
|
||||||
public let key: String?
|
public let key: String?
|
||||||
|
|
||||||
/// A name to return, if any.
|
/// A name, or part of one, to match, if any.
|
||||||
public let name: String?
|
public let name: String?
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this filter without key or name values.
|
/// Initializes a filter that matches every amiibo type.
|
||||||
public init() {
|
public init() {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a key value.
|
/// Initializes a filter that matches the amiibo type with a given key.
|
||||||
/// - Parameter key: A key to return.
|
/// - Parameter key: A hexadecimal key in `0x` format, such as `0x01`.
|
||||||
public init(key: String) {
|
public init(key: String) {
|
||||||
self.key = key
|
self.key = key
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a name value.
|
/// Initializes a filter that matches amiibo types by name.
|
||||||
/// - Parameter name: A name to return.
|
/// - Parameter name: A name, or part of one.
|
||||||
public init(name: String) {
|
public init(name: String) {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|||||||
@@ -1,45 +1,47 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A filter for game character requests.
|
||||||
|
public struct GameCharacterFilter: KeyNameFilter, Sendable {
|
||||||
|
|
||||||
/// A type that contains values to fine-tune a response when requesting game characters.
|
|
||||||
public struct GameCharacterFilter: KeyNameFilter {
|
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key to return, if any.
|
/// A hexadecimal key in `0x` format, such as `0x0001`, to match exactly, if any.
|
||||||
public let key: String?
|
public let key: String?
|
||||||
|
|
||||||
/// A name to return, if any.
|
/// A name, or part of one, to match, if any.
|
||||||
public let name: String?
|
public let name: String?
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this filter without key or name values.
|
/// Initializes a filter that matches every game character.
|
||||||
public init() {
|
public init() {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a key value.
|
/// Initializes a filter that matches the game character with a given key.
|
||||||
/// - Parameter key: A key to return.
|
/// - Parameter key: A hexadecimal key in `0x` format, such as `0x0001`.
|
||||||
public init(key: String) {
|
public init(key: String) {
|
||||||
self.key = key
|
self.key = key
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a name value.
|
/// Initializes a filter that matches game characters by name.
|
||||||
/// - Parameter name: A name to return.
|
/// - Parameter name: A name, or part of one.
|
||||||
public init(name: String) {
|
public init(name: String) {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|||||||
@@ -1,45 +1,47 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
/// A filter for game series requests.
|
||||||
|
public struct GameSeriesFilter: KeyNameFilter, Sendable {
|
||||||
|
|
||||||
/// A type that contains values to fine-tune a response when requesting game series.
|
|
||||||
public struct GameSeriesFilter: KeyNameFilter {
|
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
// TODO: Remove the documentation from the properties and initializers of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key to return, if any.
|
/// A hexadecimal key in `0x` format, such as `0x001`, to match exactly, if any.
|
||||||
public let key: String?
|
public let key: String?
|
||||||
|
|
||||||
/// A name to return, if any.
|
/// A name, or part of one, to match, if any.
|
||||||
public let name: String?
|
public let name: String?
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this filter without key or name values.
|
/// Initializes a filter that matches every game series.
|
||||||
public init() {
|
public init() {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a key value.
|
/// Initializes a filter that matches the game series with a given key.
|
||||||
/// - Parameter key: A key to return.
|
/// - Parameter key: A hexadecimal key in `0x` format, such as `0x001`.
|
||||||
public init(key: String) {
|
public init(key: String) {
|
||||||
self.key = key
|
self.key = key
|
||||||
self.name = nil
|
self.name = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initializes this filter with a name value.
|
/// Initializes a filter that matches game series by name.
|
||||||
/// - Parameter name: A name to return.
|
/// - Parameter name: A name, or part of one.
|
||||||
public init(name: String) {
|
public init(name: String) {
|
||||||
self.key = nil
|
self.key = nil
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|||||||
@@ -1,54 +1,83 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// A model that represents an amiibo item.
|
/// A model that represents an amiibo.
|
||||||
public struct Amiibo: Sendable {
|
public struct Amiibo: Sendable, Hashable, Codable, Identifiable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A game character.
|
/// The name of the game character associated with this amiibo.
|
||||||
public let gameCharacter: String
|
public let gameCharacter: String
|
||||||
|
|
||||||
/// A game series.
|
/// The name of the game series associated with this amiibo.
|
||||||
public let gameSeries: String
|
public let gameSeries: String
|
||||||
|
|
||||||
/// The first 8 hexadecimal characters of an identifier.
|
/// The first 8 hexadecimal characters of the amiibo identifier.
|
||||||
public let head: String
|
public let head: String
|
||||||
|
|
||||||
/// An image link.
|
/// A URL string pointing to the image of this amiibo.
|
||||||
public let image: String
|
public let image: String
|
||||||
|
|
||||||
/// An amiibo name.
|
/// The name of this amiibo.
|
||||||
public let name: String
|
public let name: String
|
||||||
|
|
||||||
/// A game platform type, if any.
|
/// The related games of this amiibo, grouped by platform.
|
||||||
|
///
|
||||||
|
/// `nil` unless the request sets ``AmiiboFilter/showGames`` or ``AmiiboFilter/showUsage``, or when there are no related games.
|
||||||
public let platform: Platform?
|
public let platform: Platform?
|
||||||
|
|
||||||
/// A release date.
|
/// The release dates of this amiibo across different regions.
|
||||||
public let release: Release
|
public let release: Release
|
||||||
|
|
||||||
/// An amiibo series.
|
/// The name of the amiibo series this amiibo belongs to.
|
||||||
public let series: String
|
public let series: String
|
||||||
|
|
||||||
/// The last 8 hexadecimal characters of an identifier.
|
/// The last 8 hexadecimal characters of the amiibo identifier.
|
||||||
public let tail: String
|
public let tail: String
|
||||||
|
|
||||||
/// An amiibo type.
|
/// The type of this amiibo (e.g., Figure, Card, Yarn, Band).
|
||||||
public let type: String
|
public let type: String
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
|
/// Initializes this model.
|
||||||
|
package init(
|
||||||
|
head: String,
|
||||||
|
tail: String,
|
||||||
|
name: String,
|
||||||
|
type: String,
|
||||||
|
series: String,
|
||||||
|
gameCharacter: String,
|
||||||
|
gameSeries: String,
|
||||||
|
image: String,
|
||||||
|
release: Release = .init(),
|
||||||
|
platform: Platform? = nil
|
||||||
|
) {
|
||||||
|
self.gameCharacter = gameCharacter
|
||||||
|
self.gameSeries = gameSeries
|
||||||
|
self.head = head
|
||||||
|
self.image = image
|
||||||
|
self.name = name
|
||||||
|
self.platform = platform
|
||||||
|
self.release = release
|
||||||
|
self.series = series
|
||||||
|
self.tail = tail
|
||||||
|
self.type = type
|
||||||
|
}
|
||||||
|
|
||||||
/// Initializes this model from a given payload.
|
/// Initializes this model from a given payload.
|
||||||
/// - Parameter payload: A payload that contains the values for the model.
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
init(_ payload: Components.Schemas.Amiibo) {
|
init(_ payload: Components.Schemas.Amiibo) {
|
||||||
@@ -59,6 +88,7 @@ public struct Amiibo: Sendable {
|
|||||||
self.name = payload.name
|
self.name = payload.name
|
||||||
self.platform = .init(
|
self.platform = .init(
|
||||||
payload.gamesSwitch,
|
payload.gamesSwitch,
|
||||||
|
payload.gamesSwitch2,
|
||||||
payload.games3DS,
|
payload.games3DS,
|
||||||
payload.gamesWiiU
|
payload.gamesWiiU
|
||||||
)
|
)
|
||||||
@@ -69,13 +99,18 @@ public struct Amiibo: Sendable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Computed
|
// MARK: Computed
|
||||||
|
|
||||||
/// An identifier.
|
/// The ``identifier`` of this amiibo.
|
||||||
|
public var id: String {
|
||||||
|
identifier
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The full 16-character hexadecimal identifier, composed of the ``head`` and ``tail``.
|
||||||
public var identifier: String {
|
public var identifier: String {
|
||||||
head + tail
|
head + tail
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A URL related to an image link, if any.
|
/// A URL constructed from the ``image`` string, if valid.
|
||||||
public var imageURL: URL? {
|
public var imageURL: URL? {
|
||||||
.init(string: image)
|
.init(string: image)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,45 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
extension Amiibo {
|
extension Amiibo {
|
||||||
/// A model that represents a game related to an amiibo item.
|
/// A model that represents a game related to an amiibo.
|
||||||
public struct Game: Sendable {
|
public struct Game: Sendable, Hashable, Codable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A list of identifiers.
|
/// A list of game identifiers associated with this game.
|
||||||
public let identifiers: [String]
|
public let identifiers: [String]
|
||||||
|
|
||||||
/// A name.
|
/// The name of this game.
|
||||||
public let name: String
|
public let name: String
|
||||||
|
|
||||||
/// A list of amiibo usages, if any.
|
/// A list of amiibo usages within this game, or `nil` unless the request sets ``AmiiboFilter/showUsage``.
|
||||||
public let usages: [Usage]?
|
public let usages: [Usage]?
|
||||||
|
|
||||||
// MARK: Initializers
|
// 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.
|
/// Initializes this model from a given payload.
|
||||||
/// - Parameter payload: A payload that contains the values for the model.
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
init(_ payload: Components.Schemas.AmiiboGame) {
|
init(_ payload: Components.Schemas.AmiiboGame) {
|
||||||
|
|||||||
@@ -1,64 +1,77 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
extension Amiibo {
|
extension Amiibo {
|
||||||
/// A model that represents a collection of `WiiU`, `3DS`, and `Switch` games related to an amiibo item.
|
/// A model that groups the games related to an amiibo by platform.
|
||||||
public struct Platform: Sendable {
|
public struct Platform: Sendable, Hashable, Codable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A list of `Switch` games related to an amiibo item.
|
/// A list of `Switch` games related to an amiibo.
|
||||||
public let `switch`: [Game]
|
public let `switch`: [Game]
|
||||||
|
|
||||||
|
/// A list of `Switch 2` games related to an amiibo.
|
||||||
|
public let switch2: [Game]
|
||||||
|
|
||||||
/// A list of `3DS` games related to an amiibo item.
|
/// A list of `3DS` games related to an amiibo.
|
||||||
public let threeDS: [Game]
|
public let threeDS: [Game]
|
||||||
|
|
||||||
/// A list of `WiiU` games related to an amiibo item.
|
/// A list of `Wii U` games related to an amiibo.
|
||||||
public let wiiU: [Game]
|
public let wiiU: [Game]
|
||||||
|
|
||||||
// MARK: Initialisers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this model.
|
/// 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.
|
/// > important: In case no data is provided, then an instance of this model is not created.
|
||||||
///
|
///
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - switch: A list of `Switch` games related to an amiibo item, if any.
|
/// - switch: A list of `Switch` games related to an amiibo, if any.
|
||||||
/// - threeDS: A list of `3DS` games related to an amiibo item, if any.
|
/// - switch2: A list of `Switch 2` games related to an amiibo, if any.
|
||||||
/// - wiiU: A list of `WiiU` games related to an amiibo item, if any.
|
/// - threeDS: A list of `3DS` games related to an amiibo, if any.
|
||||||
|
/// - wiiU: A list of `Wii U` games related to an amiibo, if any.
|
||||||
init?(
|
init?(
|
||||||
_ `switch`: [Components.Schemas.AmiiboGame]?,
|
_ `switch`: [Components.Schemas.AmiiboGame]?,
|
||||||
|
_ switch2: [Components.Schemas.AmiiboGame]?,
|
||||||
_ threeDS: [Components.Schemas.AmiiboGame]?,
|
_ threeDS: [Components.Schemas.AmiiboGame]?,
|
||||||
_ wiiU: [Components.Schemas.AmiiboGame]?
|
_ wiiU: [Components.Schemas.AmiiboGame]?
|
||||||
) {
|
) {
|
||||||
guard (`switch` != nil && `switch`?.isEmpty == false)
|
guard `switch`?.isEmpty == false
|
||||||
|| (threeDS != nil && threeDS?.isEmpty == false)
|
|| switch2?.isEmpty == false
|
||||||
|| (wiiU != nil && wiiU?.isEmpty == false)
|
|| threeDS?.isEmpty == false
|
||||||
|
|| wiiU?.isEmpty == false
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
self.switch = {
|
self.switch = `switch`?.map { .init($0) } ?? []
|
||||||
guard let `switch` else { return [] }
|
self.switch2 = switch2?.map { .init($0) } ?? []
|
||||||
return `switch`.map { .init($0) }
|
self.threeDS = threeDS?.map { .init($0) } ?? []
|
||||||
}()
|
self.wiiU = wiiU?.map { .init($0) } ?? []
|
||||||
self.threeDS = {
|
|
||||||
guard let threeDS else { return [] }
|
|
||||||
return threeDS.map { .init($0) }
|
|
||||||
}()
|
|
||||||
self.wiiU = {
|
|
||||||
guard let wiiU else { return [] }
|
|
||||||
return wiiU.map { .init($0) }
|
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
extension Amiibo {
|
extension Amiibo {
|
||||||
/// A model that represents a collection of release dates related to an amiibo item.
|
/// A model that represents the regional release dates of an amiibo.
|
||||||
public struct Release: Sendable {
|
///
|
||||||
|
/// The service provides these dates as date-only values, which are decoded as midnight UTC.
|
||||||
|
public struct Release: Sendable, Hashable, Codable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
@@ -32,6 +36,19 @@ extension Amiibo {
|
|||||||
|
|
||||||
// MARK: Initializers
|
// 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.
|
/// Initializes this model from a given payload.
|
||||||
/// - Parameter payload: A payload that contains the values for the model.
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
init(_ payload: Components.Schemas.AmiiboRelease) {
|
init(_ payload: Components.Schemas.AmiiboRelease) {
|
||||||
|
|||||||
@@ -1,29 +1,37 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
extension Amiibo {
|
extension Amiibo {
|
||||||
/// A model that represents the usage of an amiibo item within a certain game.
|
/// A model that represents the usage of an amiibo within a certain game.
|
||||||
public struct Usage: Sendable {
|
public struct Usage: Sendable, Hashable, Codable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// An explanation of how to use an amiibo item.
|
/// A description of how the amiibo is used within the game.
|
||||||
public let explanation: String
|
public let explanation: String
|
||||||
|
|
||||||
/// A flag that indicates whether an amiibo item can save game data in it.
|
/// Whether the amiibo can save game data.
|
||||||
public let isWriteable: Bool
|
public let isWriteable: Bool
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
|
/// Initializes this model.
|
||||||
|
package init(explanation: String, isWriteable: Bool) {
|
||||||
|
self.explanation = explanation
|
||||||
|
self.isWriteable = isWriteable
|
||||||
|
}
|
||||||
|
|
||||||
/// Initializes this model from a given payload.
|
/// Initializes this model from a given payload.
|
||||||
/// - Parameter payload: A payload that contains the values for the model.
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
init(_ payload: Components.Schemas.AmiiboUsage) {
|
init(_ payload: Components.Schemas.AmiiboUsage) {
|
||||||
|
|||||||
@@ -1,33 +1,48 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A model that represents an amiibo series.
|
/// A model that represents an amiibo series.
|
||||||
public struct AmiiboSeries: KeyNameModel {
|
public struct AmiiboSeries: KeyNameModel {
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key.
|
/// The hexadecimal key that uniquely identifies this amiibo series.
|
||||||
public let key: String
|
public let key: String
|
||||||
|
|
||||||
/// A name.
|
/// The name of this amiibo series.
|
||||||
public let name: String
|
public let name: String
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
init(_ payload: Components.Schemas.Tuple) {
|
/// Initializes this model.
|
||||||
|
package init(key: String, name: String) {
|
||||||
|
self.key = key
|
||||||
|
self.name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Initializes this model from a given payload.
|
||||||
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
|
init(_ payload: some KeyNamePayload) {
|
||||||
self.key = payload.key
|
self.key = payload.key
|
||||||
self.name = payload.name
|
self.name = payload.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: Computed
|
||||||
|
|
||||||
|
/// The ``key`` of this amiibo series.
|
||||||
|
public var id: String {
|
||||||
|
key
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,48 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A model that represents an amiibo type.
|
/// A model that represents an amiibo type.
|
||||||
public struct AmiiboType: KeyNameModel {
|
public struct AmiiboType: KeyNameModel {
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key.
|
/// The hexadecimal key that uniquely identifies this amiibo type.
|
||||||
public let key: String
|
public let key: String
|
||||||
|
|
||||||
/// A name.
|
/// The name of this amiibo type (e.g., Figure, Card, Yarn, Band).
|
||||||
public let name: String
|
public let name: String
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
init(_ payload: Components.Schemas.Tuple) {
|
/// Initializes this model.
|
||||||
|
package init(key: String, name: String) {
|
||||||
|
self.key = key
|
||||||
|
self.name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Initializes this model from a given payload.
|
||||||
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
|
init(_ payload: some KeyNamePayload) {
|
||||||
self.key = payload.key
|
self.key = payload.key
|
||||||
self.name = payload.name
|
self.name = payload.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: Computed
|
||||||
|
|
||||||
|
/// The ``key`` of this amiibo type.
|
||||||
|
public var id: String {
|
||||||
|
key
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,48 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A model that represents a game character.
|
/// A model that represents a game character.
|
||||||
public struct GameCharacter: KeyNameModel {
|
public struct GameCharacter: KeyNameModel {
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key.
|
/// The hexadecimal key that uniquely identifies this game character.
|
||||||
public let key: String
|
public let key: String
|
||||||
|
|
||||||
/// A name.
|
/// The name of this game character.
|
||||||
public let name: String
|
public let name: String
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
init(_ payload: Components.Schemas.Tuple) {
|
/// Initializes this model.
|
||||||
|
package init(key: String, name: String) {
|
||||||
|
self.key = key
|
||||||
|
self.name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Initializes this model from a given payload.
|
||||||
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
|
init(_ payload: some KeyNamePayload) {
|
||||||
self.key = payload.key
|
self.key = payload.key
|
||||||
self.name = payload.name
|
self.name = payload.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: Computed
|
||||||
|
|
||||||
|
/// The ``key`` of this game character.
|
||||||
|
public var id: String {
|
||||||
|
key
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,48 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
/// A model that represents a game series.
|
/// A model that represents a game series.
|
||||||
public struct GameSeries: KeyNameModel {
|
public struct GameSeries: KeyNameModel {
|
||||||
|
|
||||||
// TODO: Remove the documentation from the properties of this type as the `--enable-inherited-docs` flag when generating DocC documentation is not working as intended (?).
|
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A key.
|
/// The hexadecimal key that uniquely identifies this game series.
|
||||||
public let key: String
|
public let key: String
|
||||||
|
|
||||||
/// A name.
|
/// The name of this game series.
|
||||||
public let name: String
|
public let name: String
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
init(_ payload: Components.Schemas.Tuple) {
|
/// Initializes this model.
|
||||||
|
package init(key: String, name: String) {
|
||||||
|
self.key = key
|
||||||
|
self.name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Initializes this model from a given payload.
|
||||||
|
/// - Parameter payload: A payload that contains the values for the model.
|
||||||
|
init(_ payload: some KeyNamePayload) {
|
||||||
self.key = payload.key
|
self.key = payload.key
|
||||||
self.name = payload.name
|
self.name = payload.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: Computed
|
||||||
|
|
||||||
|
/// The ``key`` of this game series.
|
||||||
|
public var id: String {
|
||||||
|
key
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,92 +1,59 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// A protocol that defines API clients containing all available endpoints to interact with.
|
/// A protocol that defines a client that fetches data from the Amiibo API.
|
||||||
public protocol AmiiboClient {
|
///
|
||||||
|
/// ``AmiiboLiveClient`` is the default implementation; conform to provide another, such as a mock. Conforming types must be `Sendable`.
|
||||||
|
public protocol AmiiboClient: Sendable {
|
||||||
|
|
||||||
// MARK: Functions
|
// MARK: Functions
|
||||||
|
|
||||||
#if swift(>=6.0)
|
|
||||||
/// Gets a list of amiibo items based on a given filter.
|
/// Gets a list of amiibo items based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo items.
|
/// - Returns: A list of filtered amiibo items.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
func getAmiibos(by filter: AmiiboFilter) async throws(AmiiboServiceError) -> [Amiibo]
|
func getAmiibos(by filter: AmiiboFilter) async throws(AmiiboServiceError) -> [Amiibo]
|
||||||
|
|
||||||
/// Gets a list of amiibo series based on a given filter.
|
/// Gets a list of amiibo series based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo series.
|
/// - Returns: A list of filtered amiibo series.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws(AmiiboServiceError) -> [AmiiboSeries]
|
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws(AmiiboServiceError) -> [AmiiboSeries]
|
||||||
|
|
||||||
/// Gets a list of amiibo types based on a given filter.
|
/// Gets a list of amiibo types based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo types.
|
/// - Returns: A list of filtered amiibo types.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws(AmiiboServiceError) -> [AmiiboType]
|
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws(AmiiboServiceError) -> [AmiiboType]
|
||||||
|
|
||||||
/// Gets a list of game characters based on a given filter.
|
/// Gets a list of game characters based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered game characters.
|
/// - Returns: A list of filtered game characters.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
func getGameCharacters(by filter: GameCharacterFilter) async throws(AmiiboServiceError) -> [GameCharacter]
|
func getGameCharacters(by filter: GameCharacterFilter) async throws(AmiiboServiceError) -> [GameCharacter]
|
||||||
|
|
||||||
/// Gets a list of game series based on a given filter.
|
/// Gets a list of game series based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered game series.
|
/// - Returns: A list of filtered game series.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
func getGameSeries(by filter: GameSeriesFilter) async throws(AmiiboServiceError) -> [GameSeries]
|
func getGameSeries(by filter: GameSeriesFilter) async throws(AmiiboServiceError) -> [GameSeries]
|
||||||
|
|
||||||
/// Gets the date when the data was last updated.
|
/// 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.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
func getLastUpdated() async throws(AmiiboServiceError) -> Date
|
func getLastUpdated() async throws(AmiiboServiceError) -> Date
|
||||||
#else
|
|
||||||
/// Gets a list of amiibo items based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo items.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
func getAmiibos(by filter: AmiiboFilter) async throws -> [Amiibo]
|
|
||||||
|
|
||||||
/// Gets a list of amiibo series based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo series.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws -> [AmiiboSeries]
|
|
||||||
|
|
||||||
/// Gets a list of amiibo types based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo types.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws -> [AmiiboType]
|
|
||||||
|
|
||||||
/// Gets a list of game characters based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered game characters.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
func getGameCharacters(by filter: GameCharacterFilter) async throws -> [GameCharacter]
|
|
||||||
|
|
||||||
/// Gets a list of game series based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered game series.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
func getGameSeries(by filter: GameSeriesFilter) async throws -> [GameSeries]
|
|
||||||
|
|
||||||
/// Gets the date when the data was last updated.
|
|
||||||
/// - Returns: A last updated date.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
func getLastUpdated() async throws -> Date
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,40 +1,43 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// A type that implements the service that uses a client to make calls.
|
/// The entry point for fetching data from the Amiibo API.
|
||||||
public struct AmiiboService {
|
///
|
||||||
|
/// It forwards every call to the ``AmiiboClient`` given at initialization, which defaults to ``AmiiboLiveClient``. Instances are `Sendable`.
|
||||||
|
public struct AmiiboService: Sendable {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
/// A client to interact with the endpoints.
|
/// A client to interact with the endpoints.
|
||||||
private let client: any AmiiboClient
|
private let client: any AmiiboClient
|
||||||
|
|
||||||
// MARK: Initializers
|
// MARK: Initializers
|
||||||
|
|
||||||
/// Initializes this service with a specific client type.
|
/// Initializes this service with a client.
|
||||||
/// - Parameter client: A client to use to interact with the endpoints.
|
/// - Parameter client: The client that performs the calls. Defaults to ``AmiiboLiveClient``.
|
||||||
public init(client: some AmiiboClient = AmiiboLiveClient()) {
|
public init(client: some AmiiboClient = AmiiboLiveClient()) {
|
||||||
self.client = client
|
self.client = client
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Functions
|
// MARK: Functions
|
||||||
|
|
||||||
#if swift(>=6.0)
|
|
||||||
/// Gets a list of amiibo items based on a given filter.
|
/// Gets a list of amiibo items based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo items.
|
/// - Returns: A list of filtered amiibo items.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getAmiibos(
|
public func getAmiibos(
|
||||||
_ filter: AmiiboFilter = .init()
|
_ filter: AmiiboFilter = .init()
|
||||||
) async throws(AmiiboServiceError) -> [Amiibo] {
|
) async throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
@@ -42,9 +45,9 @@ public struct AmiiboService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of amiibo series based on a given filter.
|
/// Gets a list of amiibo series based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo series.
|
/// - Returns: A list of filtered amiibo series.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getAmiiboSeries(
|
public func getAmiiboSeries(
|
||||||
_ filter: AmiiboSeriesFilter = .init()
|
_ filter: AmiiboSeriesFilter = .init()
|
||||||
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
||||||
@@ -52,9 +55,9 @@ public struct AmiiboService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of amiibo types based on a given filter.
|
/// Gets a list of amiibo types based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered amiibo types.
|
/// - Returns: A list of filtered amiibo types.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getAmiiboTypes(
|
public func getAmiiboTypes(
|
||||||
_ filter: AmiiboTypeFilter = .init()
|
_ filter: AmiiboTypeFilter = .init()
|
||||||
) async throws(AmiiboServiceError) -> [AmiiboType] {
|
) async throws(AmiiboServiceError) -> [AmiiboType] {
|
||||||
@@ -62,9 +65,9 @@ public struct AmiiboService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of game characters based on a given filter.
|
/// Gets a list of game characters based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered game characters.
|
/// - Returns: A list of filtered game characters.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getGameCharacters(
|
public func getGameCharacters(
|
||||||
_ filter: GameCharacterFilter = .init()
|
_ filter: GameCharacterFilter = .init()
|
||||||
) async throws(AmiiboServiceError) -> [GameCharacter] {
|
) async throws(AmiiboServiceError) -> [GameCharacter] {
|
||||||
@@ -72,9 +75,9 @@ public struct AmiiboService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a list of game series based on a given filter.
|
/// Gets a list of game series based on a given filter.
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
/// - Parameter filter: A filter for the result.
|
||||||
/// - Returns: A list of filtered game series.
|
/// - Returns: A list of filtered game series.
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getGameSeries(
|
public func getGameSeries(
|
||||||
_ filter: GameSeriesFilter = .init()
|
_ filter: GameSeriesFilter = .init()
|
||||||
) async throws(AmiiboServiceError) -> [GameSeries] {
|
) async throws(AmiiboServiceError) -> [GameSeries] {
|
||||||
@@ -82,68 +85,10 @@ public struct AmiiboService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the date when the data was last updated.
|
/// 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.
|
/// - Throws: An ``AmiiboServiceError`` if the call fails.
|
||||||
public func getLastUpdated() async throws(AmiiboServiceError) -> Date {
|
public func getLastUpdated() async throws(AmiiboServiceError) -> Date {
|
||||||
try await client.getLastUpdated()
|
try await client.getLastUpdated()
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/// Gets a list of amiibo items based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo items.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getAmiibos(
|
|
||||||
_ filter: AmiiboFilter = .init()
|
|
||||||
) async throws -> [Amiibo] {
|
|
||||||
try await client.getAmiibos(by: filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of amiibo series based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo series.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getAmiiboSeries(
|
|
||||||
_ filter: AmiiboSeriesFilter = .init()
|
|
||||||
) async throws -> [AmiiboSeries] {
|
|
||||||
try await client.getAmiiboSeries(by: filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of amiibo types based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered amiibo types.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getAmiiboTypes(
|
|
||||||
_ filter: AmiiboTypeFilter = .init()
|
|
||||||
) async throws -> [AmiiboType] {
|
|
||||||
try await client.getAmiiboTypes(by: filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of game characters based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered game characters.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getGameCharacters(
|
|
||||||
_ filter: GameCharacterFilter = .init()
|
|
||||||
) async throws -> [GameCharacter] {
|
|
||||||
try await client.getGameCharacters(by: filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets a list of game series based on a given filter.
|
|
||||||
/// - Parameter filter: A filter to remove unwanted items from the result.
|
|
||||||
/// - Returns: A list of filtered game series.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getGameSeries(
|
|
||||||
_ filter: GameSeriesFilter = .init()
|
|
||||||
) async throws -> [GameSeries] {
|
|
||||||
try await client.getGameSeries(by: filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets the date when the data was last updated.
|
|
||||||
/// - Returns: A last updated date.
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
|
|
||||||
public func getLastUpdated() async throws -> Date {
|
|
||||||
try await client.getLastUpdated()
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
# ===----------------------------------------------------------------------===
|
## ===----------------------------------------------------------------------===
|
||||||
#
|
##
|
||||||
# This source file is part of the AmiiboService open source project
|
## This source file is part of the Amiibo Service open source project
|
||||||
#
|
##
|
||||||
# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
## Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
# Licensed under the EUPL 1.2 or later.
|
## Licensed under Apache license v2.0
|
||||||
#
|
##
|
||||||
# See LICENSE for license information
|
## See LICENSE for license information
|
||||||
# See CONTRIBUTORS for the list of AmiiboAPI project authors
|
## See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
#
|
##
|
||||||
# ===----------------------------------------------------------------------===
|
## SPDX-License-Identifier: Apache-2.0
|
||||||
|
##
|
||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
generate:
|
generate:
|
||||||
- types
|
- types
|
||||||
|
|||||||
+484
-219
@@ -1,274 +1,397 @@
|
|||||||
# ===----------------------------------------------------------------------===
|
## ===----------------------------------------------------------------------===
|
||||||
#
|
##
|
||||||
# This source file is part of the AmiiboService open source project
|
## This source file is part of the Amiibo Service open source project
|
||||||
#
|
##
|
||||||
# Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
## Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
# Licensed under the EUPL 1.2 or later.
|
## Licensed under Apache license v2.0
|
||||||
#
|
##
|
||||||
# See LICENSE for license information
|
## See LICENSE for license information
|
||||||
# See CONTRIBUTORS for the list of AmiiboAPI project authors
|
## See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
#
|
##
|
||||||
# ===----------------------------------------------------------------------===
|
## SPDX-License-Identifier: Apache-2.0
|
||||||
|
##
|
||||||
|
## ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
openapi: '3.1.0'
|
openapi: '3.1.1'
|
||||||
info:
|
info:
|
||||||
title: Amiibo API service
|
title: Amiibo API
|
||||||
description: The Amiibo API RESTful service.
|
summary: A RESTFul API for Amiibo.
|
||||||
|
description: |
|
||||||
|
# Information
|
||||||
|
|
||||||
|
The [AmiiboAPI](https://www.amiiboapi.org) service is primarily used for educational purposes.
|
||||||
|
|
||||||
|
This is a **reading-only API**. Only HTTP GET method is allowed by this API.
|
||||||
|
**No authentication** is required to use this API. All resources are allowed to access.
|
||||||
|
If you are going to be calling this API regularly. We recommend that you use **caching** on your system.
|
||||||
|
|
||||||
|
# Terms & Conditions
|
||||||
|
|
||||||
|
By using our API, you hereby accepted the following terms and conditions:
|
||||||
|
|
||||||
|
* *This API has no affiliation with Nintendo or any other companies that own the rights to it.*
|
||||||
|
* *Other reports collected by the respective companies that own the rights are not our responsibility.*
|
||||||
|
* *User agrees that the use of this API is entirely at user's own risks.*
|
||||||
|
* *You will require your end users to comply with (and not knowingly enable them to violate) applicable law, regulation, and the Terms.*
|
||||||
|
* *You will comply with all applicable law, regulation, and third party rights (including without limitation laws regarding the import or export of data or software, privacy, and local laws). You will not use the APIs to encourage or promote illegal activity or violation of third party rights.*
|
||||||
|
* *These Terms and Conditions are subject to change without notice, from time to time in our sole discretion.*
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
termsOfService: https://www.amiiboapi.org/docs/#termscondition
|
||||||
|
contact:
|
||||||
|
name: FAQ
|
||||||
|
url: https://www.amiiboapi.org/faq/
|
||||||
|
license:
|
||||||
|
name: MIT license
|
||||||
|
identifier: MIT
|
||||||
|
externalDocs:
|
||||||
|
url: https://www.amiiboapi.org/docs
|
||||||
|
description: Amiibo API documentation
|
||||||
servers:
|
servers:
|
||||||
- url: https://www.amiiboapi.com/api
|
- url: https://www.amiiboapi.org/api
|
||||||
description: Amiibo API service (live)
|
description: Live service
|
||||||
|
tags:
|
||||||
|
- name: Amiibo
|
||||||
|
description: Amiibo-related endpoints.
|
||||||
|
- name: Game
|
||||||
|
description: Game-related endpoints.
|
||||||
|
- name: Service
|
||||||
|
description: Service-related endpoints.
|
||||||
paths:
|
paths:
|
||||||
/amiibo:
|
/amiibo:
|
||||||
get:
|
get:
|
||||||
description: Get a list of all the Amiibo items available in the database.
|
summary: Get a list of amiibos.
|
||||||
|
description: |
|
||||||
|
Get a list of all the amiibo items available in the database, optionally filtered by various criteria such as name, type, series, or game.
|
||||||
|
|
||||||
|
Please refer to [the documentation of the endpoint](https://www.amiiboapi.org/docs/#amiibo) for further information.
|
||||||
operationId: getAmiibos
|
operationId: getAmiibos
|
||||||
|
tags:
|
||||||
|
- Amiibo
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/components/parameters/Identifier'
|
||||||
|
- $ref: '#/components/parameters/IdentifierHead'
|
||||||
|
- $ref: '#/components/parameters/IdentifierTail'
|
||||||
|
- $ref: '#/components/parameters/Name'
|
||||||
|
description: A name of an amiibo to include in the response.
|
||||||
|
- $ref: '#/components/parameters/AmiiboType'
|
||||||
|
- $ref: '#/components/parameters/AmiiboSeries'
|
||||||
|
- $ref: '#/components/parameters/GameCharacter'
|
||||||
|
- $ref: '#/components/parameters/GameSeries'
|
||||||
|
- $ref: '#/components/parameters/ShowGames'
|
||||||
|
- $ref: '#/components/parameters/ShowUsage'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successful response returning the object that contains a list of Amiibo items.
|
description: Successful response returning an object that contains zero, one or more amiibos matching the filter criteria.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/AmiiboWrapper'
|
$ref: '#/components/schemas/AmiiboWrapper'
|
||||||
'400':
|
'400':
|
||||||
description: Bad Amiibo request.
|
$ref: '#/components/responses/BadRequest'
|
||||||
parameters:
|
'404':
|
||||||
- name: amiiboSeries
|
$ref: '#/components/responses/NotFound'
|
||||||
in: query
|
'500':
|
||||||
description: The Amiibo series identifier or name to filter the response.
|
$ref: '#/components/responses/InternalServerError'
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: character
|
|
||||||
in: query
|
|
||||||
description: The game character identifier or name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: gameseries
|
|
||||||
in: query
|
|
||||||
description: The game series identifier or name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: id
|
|
||||||
in: query
|
|
||||||
description: The Amiibo identifier to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: name
|
|
||||||
in: query
|
|
||||||
description: The Amiibo name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: showgames
|
|
||||||
in: query
|
|
||||||
description: The flag that indicates whether to include information about related games.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: boolean
|
|
||||||
style: form
|
|
||||||
- name: showusage
|
|
||||||
in: query
|
|
||||||
description: The flag that indicates whether to include information about Amiibo usage in related games.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: boolean
|
|
||||||
style: form
|
|
||||||
- name: type
|
|
||||||
in: query
|
|
||||||
description: The Amiibo type to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
|
|
||||||
/amiiboseries:
|
/amiiboseries:
|
||||||
get:
|
get:
|
||||||
description: Get a list of all the Amiibo series available in the database.
|
tags:
|
||||||
|
- Amiibo
|
||||||
|
summary: Get the amiibo series.
|
||||||
|
description: |
|
||||||
|
Get a list of all the amiibo series available in the database, optionally filtered by key or name.
|
||||||
|
|
||||||
|
Please refer to [the documentation of the endpoint](https://www.amiiboapi.org/docs/#series) for further information.
|
||||||
operationId: getAmiiboSeries
|
operationId: getAmiiboSeries
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/components/parameters/Key'
|
||||||
|
description: A key of an amiibo series to include in the response.
|
||||||
|
- $ref: '#/components/parameters/Name'
|
||||||
|
description: A name of an amiibo series to include in the response.
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successful response returning the object that contains a list of Amiibo series.
|
description: Successful response returning an object that contains one or more amiibo series matching the filter criteria.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/TupleWrapper'
|
$ref: '#/components/schemas/AmiiboSeriesWrapper'
|
||||||
'400':
|
'400':
|
||||||
description: Bad Amiibo series request.
|
$ref: '#/components/responses/BadRequest'
|
||||||
'404':
|
'404':
|
||||||
description: Amiibo series not found.
|
$ref: '#/components/responses/NotFound'
|
||||||
'500':
|
'500':
|
||||||
description: Service currently not available.
|
$ref: '#/components/responses/InternalServerError'
|
||||||
parameters:
|
|
||||||
- name: key
|
|
||||||
in: query
|
|
||||||
description: The Amiibo series key to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: name
|
|
||||||
in: query
|
|
||||||
description: The Amiibo series name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
|
|
||||||
/character:
|
/character:
|
||||||
get:
|
get:
|
||||||
description: Get a list of all the game characters available in the database.
|
tags:
|
||||||
|
- Game
|
||||||
|
summary: Get the game characters.
|
||||||
|
description: |
|
||||||
|
Get a list of all the game characters available in the database, optionally filtered by key or name.
|
||||||
|
|
||||||
|
Please refer to [the documentation of the endpoint](https://www.amiiboapi.org/docs/#character) for further information.
|
||||||
operationId: getGameCharacters
|
operationId: getGameCharacters
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/components/parameters/Key'
|
||||||
|
description: A key of a game character to include in the response.
|
||||||
|
- $ref: '#/components/parameters/Name'
|
||||||
|
description: A name of a game character to include in the response.
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successful response returning the object that contains a list of game characters.
|
description: Successful response returning an object that contains one or more game characters matching the filter criteria.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/TupleWrapper'
|
$ref: '#/components/schemas/GameCharacterWrapper'
|
||||||
'400':
|
'400':
|
||||||
description: Bad game character request.
|
$ref: '#/components/responses/BadRequest'
|
||||||
'404':
|
'404':
|
||||||
description: Game character not found.
|
$ref: '#/components/responses/NotFound'
|
||||||
'500':
|
'500':
|
||||||
description: Service currently not available.
|
$ref: '#/components/responses/InternalServerError'
|
||||||
parameters:
|
|
||||||
- name: key
|
|
||||||
in: query
|
|
||||||
description: The game character key to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: name
|
|
||||||
in: query
|
|
||||||
description: The game character name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
|
|
||||||
/gameseries:
|
/gameseries:
|
||||||
get:
|
get:
|
||||||
description: Gets a list of all the game series available in the database.
|
tags:
|
||||||
|
- Game
|
||||||
|
summary: Get the game series.
|
||||||
|
description: |
|
||||||
|
Get a list of all the game series available in the database, optionally filtered by key or name.
|
||||||
|
|
||||||
|
Please refer to [the documentation of the endpoint](https://www.amiiboapi.org/docs/#gameSeries) for further information.
|
||||||
operationId: getGameSeries
|
operationId: getGameSeries
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/components/parameters/Key'
|
||||||
|
description: A key of a game series to include in the response.
|
||||||
|
- $ref: '#/components/parameters/Name'
|
||||||
|
description: A name of a game series to include in the response.
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successful response returning the object that contains a list of game series.
|
description: Successful response returning an object that contains one or more game series matching the filter criteria.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/TupleWrapper'
|
$ref: '#/components/schemas/GameSeriesWrapper'
|
||||||
'400':
|
'400':
|
||||||
description: Bad game series request.
|
$ref: '#/components/responses/BadRequest'
|
||||||
'404':
|
'404':
|
||||||
description: Game series not found.
|
$ref: '#/components/responses/NotFound'
|
||||||
'500':
|
'500':
|
||||||
description: Service currently not available.
|
$ref: '#/components/responses/InternalServerError'
|
||||||
parameters:
|
|
||||||
- name: key
|
|
||||||
in: query
|
|
||||||
description: The game series key to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: name
|
|
||||||
in: query
|
|
||||||
description: The game series name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
|
|
||||||
/type:
|
/type:
|
||||||
get:
|
get:
|
||||||
description: Gets a list of all the Amiibo types available in the database.
|
tags:
|
||||||
|
- Amiibo
|
||||||
|
summary: Get the amiibo types.
|
||||||
|
description: |
|
||||||
|
Get a list of all the amiibo types available in the database, optionally filtered by key or name.
|
||||||
|
|
||||||
|
Please refer to [the documentation of the endpoint](https://www.amiiboapi.org/docs/#type) for further information.
|
||||||
operationId: getAmiiboTypes
|
operationId: getAmiiboTypes
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/components/parameters/Key'
|
||||||
|
description: A key of an amiibo type to include in the response.
|
||||||
|
- $ref: '#/components/parameters/Name'
|
||||||
|
description: A name of an amiibo type to include in the response.
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successful response returning the object that contains a list of Amiibo types.
|
description: Successful response returning an object that contains one or more amiibo types matching the filter criteria.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/TupleWrapper'
|
$ref: '#/components/schemas/AmiiboTypeWrapper'
|
||||||
'400':
|
'400':
|
||||||
description: Bad Amiibo type request.
|
$ref: '#/components/responses/BadRequest'
|
||||||
'404':
|
'404':
|
||||||
description: Amiibo type not found.
|
$ref: '#/components/responses/NotFound'
|
||||||
'500':
|
'500':
|
||||||
description: Service currently not available.
|
$ref: '#/components/responses/InternalServerError'
|
||||||
parameters:
|
|
||||||
- name: key
|
|
||||||
in: query
|
|
||||||
description: The Amiibo type key to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- name: name
|
|
||||||
in: query
|
|
||||||
description: The Amiibo type name to filter the response.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
|
|
||||||
/lastupdated:
|
/lastupdated:
|
||||||
get:
|
get:
|
||||||
description: Gets a timestamp when the Amiibo data was last updated.
|
tags:
|
||||||
|
- Service
|
||||||
|
summary: Get the date when data was last updated.
|
||||||
|
description: |
|
||||||
|
Get an ISO-formatted date and time when the amiibo data was last updated.
|
||||||
|
|
||||||
|
Please refer to [the documentation of the endpoint](https://www.amiiboapi.org/docs/#lastUpdated) for further information.
|
||||||
operationId: getLastUpdated
|
operationId: getLastUpdated
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successful response returning the object that contains the date and time when the database was last updated.
|
description: Successful response returning an object that contains the date and time when the database was last updated.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/LastUpdated'
|
$ref: '#/components/schemas/LastUpdated'
|
||||||
|
'500':
|
||||||
|
$ref: '#/components/responses/InternalServerError'
|
||||||
components:
|
components:
|
||||||
|
parameters:
|
||||||
|
AmiiboSeries:
|
||||||
|
description: A hexadecimal key or name of an amiibo series to include in the response.
|
||||||
|
name: amiiboSeries
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
AmiiboType:
|
||||||
|
description: A hexadecimal key or name of an amiibo type to include in the response.
|
||||||
|
name: type
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
GameCharacter:
|
||||||
|
description: A hexadecimal key or name of a game character to include in the response.
|
||||||
|
name: character
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
GameSeries:
|
||||||
|
description: A hexadecimal key or name of a game series to include in the response.
|
||||||
|
name: gameseries
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
Identifier:
|
||||||
|
description: The full 16-character hexadecimal identifier of an amiibo to include in the response, with an optional `0x` prefix. An empty value is rejected with a `400` response.
|
||||||
|
name: id
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: "^(0x)?[0-9a-fA-F]{16}$"
|
||||||
|
minLength: 16
|
||||||
|
maxLength: 18
|
||||||
|
IdentifierHead:
|
||||||
|
description: The first 8 hexadecimal characters of an amiibo identifier to include in the response, with an optional `0x` prefix. A shorter value matches as a prefix, while an empty value is rejected with a `400` response.
|
||||||
|
name: head
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: "^(0x)?[0-9a-fA-F]+$"
|
||||||
|
minLength: 1
|
||||||
|
maxLength: 10
|
||||||
|
IdentifierTail:
|
||||||
|
description: The last 8 hexadecimal characters of an amiibo identifier to include in the response, with an optional `0x` prefix. A shorter value matches as a prefix, while an empty value is rejected with a `400` response.
|
||||||
|
name: tail
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: "^(0x)?[0-9a-fA-F]+$"
|
||||||
|
minLength: 1
|
||||||
|
maxLength: 10
|
||||||
|
Key:
|
||||||
|
description: A hexadecimal key to filter the results by, in the `0x`-prefixed format used by the `key` property of the resources. A value without hexadecimal digits after the prefix, or an empty value, is rejected with a `400` response.
|
||||||
|
name: key
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: "^0x[0-9a-fA-F]+$"
|
||||||
|
minLength: 3
|
||||||
|
Name:
|
||||||
|
description: A name to filter the results by.
|
||||||
|
name: name
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
ShowGames:
|
||||||
|
description: A flag that indicates whether to include information about related games.
|
||||||
|
name: showgames
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
ShowUsage:
|
||||||
|
description: A flag that indicates whether to include information about amiibo usages in related games.
|
||||||
|
name: showusage
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
responses:
|
||||||
|
BadRequest:
|
||||||
|
description: The request was malformed or contained invalid parameters.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ServiceError'
|
||||||
|
InternalServerError:
|
||||||
|
description: The service is currently unavailable.
|
||||||
|
NotFound:
|
||||||
|
description: No results were found matching the given filter criteria.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ServiceError'
|
||||||
schemas:
|
schemas:
|
||||||
|
# Core Entities
|
||||||
Amiibo:
|
Amiibo:
|
||||||
|
description: A type that represents an amiibo figurine, card, or other collectible.
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
amiiboSeries:
|
amiiboSeries:
|
||||||
|
description: The name of the amiibo series this amiibo belongs to.
|
||||||
type: string
|
type: string
|
||||||
character:
|
character:
|
||||||
|
description: |
|
||||||
|
The name of the game character associated with this amiibo.
|
||||||
|
|
||||||
|
Multiple characters can have different amiibo designs.
|
||||||
type: string
|
type: string
|
||||||
gameSeries:
|
gameSeries:
|
||||||
|
description: The name of the game series associated with this amiibo.
|
||||||
type: string
|
type: string
|
||||||
games3DS:
|
games3DS:
|
||||||
|
description: A list of 3DS games an amiibo could be used in, if any.
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/AmiiboGame'
|
$ref: '#/components/schemas/AmiiboGame'
|
||||||
gamesSwitch:
|
gamesSwitch:
|
||||||
|
description: A list of Switch games an amiibo could be used in, if any.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/AmiiboGame'
|
||||||
|
gamesSwitch2:
|
||||||
|
description: A list of Switch 2 games an amiibo could be used in, if any.
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/AmiiboGame'
|
$ref: '#/components/schemas/AmiiboGame'
|
||||||
gamesWiiU:
|
gamesWiiU:
|
||||||
|
description: A list of Wii U games an amiibo could be used in, if any.
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/AmiiboGame'
|
$ref: '#/components/schemas/AmiiboGame'
|
||||||
head:
|
head:
|
||||||
|
description: |
|
||||||
|
The first 8 characters of the hexadecimal value that identifies an amiibo.
|
||||||
|
|
||||||
|
The positions 0 to 7 of the hexadecimal string.
|
||||||
type: string
|
type: string
|
||||||
|
pattern: "^[0-9a-fA-F]{8}$"
|
||||||
image:
|
image:
|
||||||
|
description: A URL pointing to an image of this amiibo.
|
||||||
type: string
|
type: string
|
||||||
|
format: uri
|
||||||
name:
|
name:
|
||||||
|
description: The name of this amiibo.
|
||||||
type: string
|
type: string
|
||||||
release:
|
release:
|
||||||
type: object
|
description: The regional release dates of this amiibo, if known.
|
||||||
$ref: '#/components/schemas/AmiiboRelease'
|
$ref: '#/components/schemas/AmiiboRelease'
|
||||||
tail:
|
tail:
|
||||||
|
description: |
|
||||||
|
The last 8 characters of the hexadecimal value that identifies an amiibo.
|
||||||
|
|
||||||
|
The positions 8 to 15 of the hexadecimal string.
|
||||||
type: string
|
type: string
|
||||||
|
pattern: "^[0-9a-fA-F]{8}$"
|
||||||
type:
|
type:
|
||||||
|
description: The type of this amiibo (e.g., Figure, Card, Yarn, Band).
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- amiiboSeries
|
- amiiboSeries
|
||||||
@@ -280,97 +403,239 @@ components:
|
|||||||
- release
|
- release
|
||||||
- tail
|
- tail
|
||||||
- type
|
- type
|
||||||
|
|
||||||
AmiiboGame:
|
AmiiboGame:
|
||||||
|
description: A type that represents a game in which an amiibo can be used.
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
amiiboUsage:
|
amiiboUsage:
|
||||||
|
description: A list of available usages an amiibo has in a game, if any.
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/AmiiboUsage'
|
$ref: '#/components/schemas/AmiiboUsage'
|
||||||
gameID:
|
gameID:
|
||||||
|
description: A list of identifiers for the game.
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
gameName:
|
gameName:
|
||||||
|
description: The name of the game.
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- gameID
|
- gameID
|
||||||
- gameName
|
- gameName
|
||||||
|
|
||||||
AmiiboList:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Amiibo'
|
|
||||||
|
|
||||||
AmiiboRelease:
|
AmiiboRelease:
|
||||||
|
description: |
|
||||||
|
A type that contains the regional release dates of an amiibo.
|
||||||
|
|
||||||
|
Note: The service returns these dates as date-only strings (`yyyy-MM-dd`) without a time component, even though the properties declare the `date-time` format. The `date-time` format is kept deliberately so the generated code produces `Date` values, and the date-only strings are decoded by the custom transcoder configured in the live client, which interprets them as midnight UTC.
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
au:
|
au:
|
||||||
|
description: The release date in Australia, if known.
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
eu:
|
eu:
|
||||||
|
description: The release date in Europe, if known.
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
jp:
|
jp:
|
||||||
|
description: The release date in Japan, if known.
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
na:
|
na:
|
||||||
|
description: The release date in North America, if known.
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
AmiiboSeries:
|
||||||
AmiiboUsage:
|
description: A type that represents an amiibo series.
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
Usage:
|
|
||||||
type: string
|
|
||||||
write:
|
|
||||||
type: boolean
|
|
||||||
required:
|
|
||||||
- Usage
|
|
||||||
- write
|
|
||||||
|
|
||||||
AmiiboWrapper:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
amiibo:
|
|
||||||
oneOf:
|
|
||||||
- $ref: '#/components/schemas/Amiibo'
|
|
||||||
- $ref: '#/components/schemas/AmiiboList'
|
|
||||||
required:
|
|
||||||
- amiibo
|
|
||||||
|
|
||||||
LastUpdated:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
lastUpdated:
|
|
||||||
type: string
|
|
||||||
format: date-time
|
|
||||||
required:
|
|
||||||
- lastUpdated
|
|
||||||
|
|
||||||
Tuple:
|
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
|
description: The hexadecimal key that uniquely identifies this amiibo series.
|
||||||
type: string
|
type: string
|
||||||
|
pattern: "^0x[0-9a-fA-F]+$"
|
||||||
|
minLength: 3
|
||||||
name:
|
name:
|
||||||
|
description: The name of this amiibo series.
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- name
|
- name
|
||||||
|
AmiiboType:
|
||||||
TupleList:
|
description: A type that represents an amiibo type (e.g., Figure, Card, Yarn, Band).
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Tuple'
|
|
||||||
|
|
||||||
TupleWrapper:
|
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
amiibo:
|
key:
|
||||||
oneOf:
|
description: The hexadecimal key that uniquely identifies this amiibo type.
|
||||||
- $ref: '#/components/schemas/Tuple'
|
type: string
|
||||||
- $ref: '#/components/schemas/TupleList'
|
pattern: "^0x[0-9a-fA-F]+$"
|
||||||
|
minLength: 3
|
||||||
|
name:
|
||||||
|
description: The name of this amiibo type.
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
|
- key
|
||||||
|
- name
|
||||||
|
AmiiboUsage:
|
||||||
|
description: A type that represents how an amiibo is used within a game.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
Usage:
|
||||||
|
description: A description of how the amiibo is used within the game.
|
||||||
|
type: string
|
||||||
|
write:
|
||||||
|
description: A flag that indicates whether the amiibo can save game data.
|
||||||
|
type: boolean
|
||||||
|
required:
|
||||||
|
- Usage
|
||||||
|
- write
|
||||||
|
GameCharacter:
|
||||||
|
description: A type that represents a game character.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: The hexadecimal key that uniquely identifies this game character.
|
||||||
|
type: string
|
||||||
|
pattern: "^0x[0-9a-fA-F]+$"
|
||||||
|
minLength: 3
|
||||||
|
name:
|
||||||
|
description: The name of this game character.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- name
|
||||||
|
GameSeries:
|
||||||
|
description: A type that represents a game series.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: The hexadecimal key that uniquely identifies this game series.
|
||||||
|
type: string
|
||||||
|
pattern: "^0x[0-9a-fA-F]+$"
|
||||||
|
minLength: 3
|
||||||
|
name:
|
||||||
|
description: The name of this game series.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- name
|
||||||
|
LastUpdated:
|
||||||
|
description: |
|
||||||
|
A type that contains the date and time when the service data was last updated.
|
||||||
|
|
||||||
|
Note: The service returns this timestamp in the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` format without a timezone offset, so it is not a strictly valid RFC 3339 `date-time` value. The `date-time` format is kept deliberately so the generated code produces a `Date` value, and the timestamp is decoded by the custom transcoder configured in the live client, which interprets it as UTC.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
lastUpdated:
|
||||||
|
description: The date and time when the data in the database was last updated.
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
required:
|
||||||
|
- lastUpdated
|
||||||
|
# List Entities
|
||||||
|
AmiiboList:
|
||||||
|
description: A list that contains amiibos.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Amiibo'
|
||||||
|
AmiiboSeriesList:
|
||||||
|
description: A list that contains amiibo series.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/AmiiboSeries'
|
||||||
|
AmiiboTypeList:
|
||||||
|
description: A list that contains amiibo types.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/AmiiboType'
|
||||||
|
GameCharacterList:
|
||||||
|
description: A list that contains game characters.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/GameCharacter'
|
||||||
|
GameSeriesList:
|
||||||
|
description: A list that contains game series.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/GameSeries'
|
||||||
|
# Wrapper Entities
|
||||||
|
AmiiboWrapper:
|
||||||
|
description: |
|
||||||
|
A response wrapper that contains zero, one, or more amiibos.
|
||||||
|
|
||||||
|
Note: Unlike the other response wrappers, the `amiibo` property is deliberately not required: the service returns `"amiibo": null` when an `id` filter matches nothing, and an empty list when other filters match nothing. The property must therefore remain optional for decoding to succeed in both cases.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
amiibo:
|
||||||
|
description: A container that holds zero, one or more amiibos.
|
||||||
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/Amiibo'
|
||||||
|
description: A certain amiibo.
|
||||||
|
- $ref: '#/components/schemas/AmiiboList'
|
||||||
|
description: A list that contains amiibos.
|
||||||
|
AmiiboSeriesWrapper:
|
||||||
|
description: A response wrapper that contains one or more amiibo series.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
amiibo:
|
||||||
|
description: A container that holds one or more amiibo series.
|
||||||
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/AmiiboSeries'
|
||||||
|
description: A certain amiibo series.
|
||||||
|
- $ref: '#/components/schemas/AmiiboSeriesList'
|
||||||
|
description: A list that contains amiibo series.
|
||||||
|
required:
|
||||||
|
- amiibo
|
||||||
|
AmiiboTypeWrapper:
|
||||||
|
description: A response wrapper that contains one or more amiibo types.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
amiibo:
|
||||||
|
description: A container that holds one or more amiibo types.
|
||||||
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/AmiiboType'
|
||||||
|
description: A certain amiibo type.
|
||||||
|
- $ref: '#/components/schemas/AmiiboTypeList'
|
||||||
|
description: A list that contains amiibo types.
|
||||||
|
required:
|
||||||
- amiibo
|
- amiibo
|
||||||
|
GameCharacterWrapper:
|
||||||
|
description: A response wrapper that contains one or more game characters.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
amiibo:
|
||||||
|
description: A container that holds one or more game characters.
|
||||||
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/GameCharacter'
|
||||||
|
description: A certain game character.
|
||||||
|
- $ref: '#/components/schemas/GameCharacterList'
|
||||||
|
description: A list that contains game characters.
|
||||||
|
required:
|
||||||
|
- amiibo
|
||||||
|
GameSeriesWrapper:
|
||||||
|
description: A response wrapper that contains one or more game series.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
amiibo:
|
||||||
|
description: A container that holds one or more game series.
|
||||||
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/GameSeries'
|
||||||
|
description: A certain game series.
|
||||||
|
- $ref: '#/components/schemas/GameSeriesList'
|
||||||
|
description: A list that contains game series.
|
||||||
|
required:
|
||||||
|
- amiibo
|
||||||
|
# Error Entities
|
||||||
|
ServiceError:
|
||||||
|
description: A type that represents an error response from the service.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
description: The HTTP status code of the error.
|
||||||
|
type: integer
|
||||||
|
error:
|
||||||
|
description: A human-readable message describing the error.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- code
|
||||||
|
- error
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
@testable import AmiiboService
|
||||||
|
import Foundation
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
@Suite("ISO Date Time Transcoder")
|
||||||
|
struct ISODateTimeTranscoderTests {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
private let transcoder = ISODateTimeTranscoder()
|
||||||
|
|
||||||
|
// MARK: Decode tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `decodes a timestamp as UTC`() throws {
|
||||||
|
// GIVEN
|
||||||
|
let string = "2026-07-24T12:34:56.123000"
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let date = try transcoder.decode(string)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(abs(date.timeIntervalSince(.utc(2026, 7, 24, 12, 34, 56)) - 0.123) < 0.001)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `decodes a date-only string as midnight UTC`() throws {
|
||||||
|
// GIVEN
|
||||||
|
let string = "2014-11-21"
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let date = try transcoder.decode(string)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(date == .utc(2014, 11, 21))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: [
|
||||||
|
"", "2014-11", "2014-11-21T12:34:56", "2014-11-21T12:34:56Z", "21/11/2014", "yesterday"
|
||||||
|
])
|
||||||
|
func `throws a decoding error for an unsupported string`(string: String) {
|
||||||
|
// GIVEN
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(throws: DecodingError.self) {
|
||||||
|
try transcoder.decode(string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Encode tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `encodes a date as a timestamp`() throws {
|
||||||
|
// GIVEN
|
||||||
|
let date: Date = .utc(2026, 7, 24, 12, 34, 56)
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let string = try transcoder.encode(date)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(string == "2026-07-24T12:34:56.000000")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,480 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
@testable import AmiiboService
|
||||||
|
import Foundation
|
||||||
|
import HTTPTypes
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
@Suite("Amiibo Live Client")
|
||||||
|
struct AmiiboLiveClientTests {
|
||||||
|
|
||||||
|
// MARK: Server URL tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `resolves the server URL defined in the OpenAPI specification`() throws {
|
||||||
|
// GIVEN
|
||||||
|
// WHEN
|
||||||
|
let url = try Servers.Server1.url()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(url.absoluteString == "https://www.amiiboapi.org/api")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `uses the server URL from the OpenAPI specification`() throws {
|
||||||
|
// GIVEN
|
||||||
|
let expected = try Servers.Server1.url()
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let url = AmiiboLiveClient.serverURL
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(url == expected)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Error mapping tests
|
||||||
|
|
||||||
|
@Test(arguments: zip(
|
||||||
|
TransportErrors.thrown,
|
||||||
|
TransportErrors.expected
|
||||||
|
))
|
||||||
|
func `maps an error thrown by the transport to the matching service error`(
|
||||||
|
thrown: any Error,
|
||||||
|
expected: AmiiboServiceError
|
||||||
|
) async {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: ThrowingTransport(error: thrown))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: expected) {
|
||||||
|
try await client.getAmiibos(by: .init())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: zip(
|
||||||
|
Responses.failing,
|
||||||
|
Responses.expected
|
||||||
|
))
|
||||||
|
func `maps a response status to the matching service error`(
|
||||||
|
response: (status: Int, json: String?),
|
||||||
|
expected: AmiiboServiceError
|
||||||
|
) async {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(
|
||||||
|
status: .init(code: response.status),
|
||||||
|
json: response.json
|
||||||
|
))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: expected) {
|
||||||
|
try await client.getAmiibos(by: .init())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Amiibos tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns amiibos sorted by identifier`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.amiibos))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await client.getAmiibos(by: .init())
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos.map(\.identifier) == ["0000000000000002", "0100000000040002"])
|
||||||
|
#expect(amiibos.map(\.name) == ["Mario", "Zelda"])
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns a single amiibo when the response holds an object`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.amiibo))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await client.getAmiibos(by: .init(identifier: "0100000000040002"))
|
||||||
|
let amiibo = try #require(amiibos.first)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos.count == 1)
|
||||||
|
#expect(amiibo.head == "01000000")
|
||||||
|
#expect(amiibo.tail == "00040002")
|
||||||
|
#expect(amiibo.name == "Zelda")
|
||||||
|
#expect(amiibo.type == "Figure")
|
||||||
|
#expect(amiibo.series == "Super Smash Bros.")
|
||||||
|
#expect(amiibo.gameCharacter == "Zelda")
|
||||||
|
#expect(amiibo.gameSeries == "The Legend of Zelda")
|
||||||
|
#expect(amiibo.imageURL?.host() == "example.com")
|
||||||
|
#expect(amiibo.platform == nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns no amiibos when the response holds null`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.amiibosNull))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await client.getAmiibos(by: .init(identifier: "0000000000000000"))
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns no amiibos when the response holds an empty list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.amiibosEmpty))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await client.getAmiibos(by: .init(name: "Something"))
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `decodes release dates as midnight UTC, and missing or null ones as nil`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.amiibos))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await client.getAmiibos(by: .init())
|
||||||
|
let mario = try #require(amiibos.first)
|
||||||
|
let zelda = try #require(amiibos.last)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(mario.release.america == .utc(2014, 11, 21))
|
||||||
|
#expect(mario.release.australia == .utc(2014, 11, 29))
|
||||||
|
#expect(mario.release.europe == .utc(2014, 11, 28))
|
||||||
|
#expect(mario.release.japan == .utc(2014, 12, 6))
|
||||||
|
#expect(zelda.release.australia == nil)
|
||||||
|
#expect(zelda.release.japan == nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `maps related games and usages into the platform`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.amiiboWithGames))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await client.getAmiibos(by: .init(showUsage: true))
|
||||||
|
let platform = try #require(amiibos.first?.platform)
|
||||||
|
let game = try #require(platform.switch.first)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(platform.switch.count == 1)
|
||||||
|
#expect(platform.switch2.isEmpty)
|
||||||
|
#expect(platform.threeDS.isEmpty)
|
||||||
|
#expect(platform.wiiU.count == 1)
|
||||||
|
#expect(game.identifiers == ["01007EF00011E000"])
|
||||||
|
#expect(game.name == "The Legend of Zelda: Breath of the Wild")
|
||||||
|
#expect(game.usages == [.init(explanation: "Spawns a random selection of items.", isWriteable: false)])
|
||||||
|
#expect(platform.wiiU.first?.usages == nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `encodes the amiibo filter as query parameters`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
let path = request.path ?? ""
|
||||||
|
|
||||||
|
#expect(path.hasPrefix("/amiibo?"))
|
||||||
|
#expect(path.contains("id=0100000000040002"))
|
||||||
|
#expect(path.contains("head=01000000"))
|
||||||
|
#expect(path.contains("tail=00040002"))
|
||||||
|
#expect(path.contains("name=zelda"))
|
||||||
|
#expect(path.contains("type=0x00"))
|
||||||
|
#expect(path.contains("amiiboSeries=0x00"))
|
||||||
|
#expect(path.contains("character=0x0100"))
|
||||||
|
#expect(path.contains("gameseries=0x010"))
|
||||||
|
#expect(path.contains("showgames=true"))
|
||||||
|
#expect(path.contains("showusage=false"))
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.amiibosEmpty)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
_ = try await client.getAmiibos(by: .init(
|
||||||
|
head: "01000000",
|
||||||
|
tail: "00040002",
|
||||||
|
identifier: "0100000000040002",
|
||||||
|
name: "zelda",
|
||||||
|
type: "0x00",
|
||||||
|
series: "0x00",
|
||||||
|
gameCharacter: "0x0100",
|
||||||
|
gameSeries: "0x010",
|
||||||
|
showGames: true,
|
||||||
|
showUsage: false
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `omits nil filter values from the query`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
#expect(request.path == "/amiibo")
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.amiibosEmpty)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
_ = try await client.getAmiibos(by: .init())
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Key-name endpoints tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns amiibo series sorted by key`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .ok, json: JSON.keyNameList))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let series = try await client.getAmiiboSeries(by: .init())
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(series == [.init(key: "0x00", name: "Second"), .init(key: "0x01", name: "First")])
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns a single amiibo series when the response holds an object`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
#expect(request.path == "/amiiboseries?key=0x01")
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.keyName)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let series = try await client.getAmiiboSeries(by: .init(key: "0x01"))
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(series == [.init(key: "0x01", name: "First")])
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns amiibo types sorted by key`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
#expect(request.path == "/type")
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.keyNameList)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let types = try await client.getAmiiboTypes(by: .init())
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(types == [.init(key: "0x00", name: "Second"), .init(key: "0x01", name: "First")])
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns game characters sorted by key`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
#expect(request.path == "/character?name=First")
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.keyNameList)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let characters = try await client.getGameCharacters(by: .init(name: "First"))
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(characters == [.init(key: "0x00", name: "Second"), .init(key: "0x01", name: "First")])
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns game series sorted by key`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
#expect(request.path == "/gameseries")
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.keyNameList)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let series = try await client.getGameSeries(by: .init())
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(series == [.init(key: "0x00", name: "Second"), .init(key: "0x01", name: "First")])
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when a key-name endpoint matches nothing`() async {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .notFound, json: JSON.notFound))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await client.getGameSeries(by: .init(key: "0xffff"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Last Updated tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns the last updated timestamp as UTC`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport { request in
|
||||||
|
#expect(request.path == "/lastupdated")
|
||||||
|
|
||||||
|
return StubTransport.response(status: .ok, json: JSON.lastUpdated)
|
||||||
|
})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let lastUpdated = try await client.getLastUpdated()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(lastUpdated == .utc(2026, 7, 24, 12, 34, 56))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notAvailable when the last updated endpoint fails`() async {
|
||||||
|
// GIVEN
|
||||||
|
let client = AmiiboLiveClient(transport: StubTransport(status: .internalServerError))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notAvailable) {
|
||||||
|
try await client.getLastUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Arguments
|
||||||
|
|
||||||
|
private enum TransportErrors {
|
||||||
|
/// Errors thrown by the transport.
|
||||||
|
static let thrown: [any Error] = [
|
||||||
|
CancellationError(),
|
||||||
|
URLError(.cancelled),
|
||||||
|
URLError(.cannotParseResponse),
|
||||||
|
URLError(.notConnectedToInternet),
|
||||||
|
URLError(.timedOut),
|
||||||
|
URLError(.badURL)
|
||||||
|
]
|
||||||
|
/// The service error expected for each thrown error.
|
||||||
|
static let expected: [AmiiboServiceError] = [
|
||||||
|
.cancelled,
|
||||||
|
.cancelled,
|
||||||
|
.decoding,
|
||||||
|
.notAvailable,
|
||||||
|
.notAvailable,
|
||||||
|
.unknown(String(describing: URLError(.badURL)))
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum Responses {
|
||||||
|
/// Failing responses, with a body where the specification documents one.
|
||||||
|
static let failing: [(status: Int, json: String?)] = [
|
||||||
|
(400, JSON.badRequest),
|
||||||
|
(404, JSON.notFound),
|
||||||
|
(500, nil),
|
||||||
|
(418, nil),
|
||||||
|
(200, "not json")
|
||||||
|
]
|
||||||
|
/// The service error expected for each failing response.
|
||||||
|
static let expected: [AmiiboServiceError] = [
|
||||||
|
.badRequest,
|
||||||
|
.notFound,
|
||||||
|
.notAvailable,
|
||||||
|
.undocumented(418),
|
||||||
|
.decoding
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Payloads
|
||||||
|
|
||||||
|
private enum JSON {
|
||||||
|
/// Two amiibos in reverse identifier order; the first lacks `au` and has a null `jp`.
|
||||||
|
static let amiibos = """
|
||||||
|
{"amiibo": [
|
||||||
|
{
|
||||||
|
"amiiboSeries": "Super Smash Bros.", "character": "Zelda", "gameSeries": "The Legend of Zelda",
|
||||||
|
"head": "01000000", "tail": "00040002", "name": "Zelda", "type": "Figure",
|
||||||
|
"image": "https://example.com/zelda.png",
|
||||||
|
"release": {"eu": "2014-11-28", "jp": null, "na": "2014-11-21"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amiiboSeries": "Super Smash Bros.", "character": "Mario", "gameSeries": "Super Mario",
|
||||||
|
"head": "00000000", "tail": "00000002", "name": "Mario", "type": "Figure",
|
||||||
|
"image": "https://example.com/mario.png",
|
||||||
|
"release": {"au": "2014-11-29", "eu": "2014-11-28", "jp": "2014-12-06", "na": "2014-11-21"}
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
"""
|
||||||
|
/// A single amiibo, as returned for an `id` filter.
|
||||||
|
static let amiibo = """
|
||||||
|
{"amiibo": {
|
||||||
|
"amiiboSeries": "Super Smash Bros.", "character": "Zelda", "gameSeries": "The Legend of Zelda",
|
||||||
|
"head": "01000000", "tail": "00040002", "name": "Zelda", "type": "Figure",
|
||||||
|
"image": "https://example.com/zelda.png",
|
||||||
|
"release": {"au": "2014-12-04", "eu": "2014-11-28", "jp": "2014-12-06", "na": "2014-11-21"}
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
/// An amiibo with Switch and Wii U games, an empty 3DS list, and no Switch 2 key.
|
||||||
|
static let amiiboWithGames = """
|
||||||
|
{"amiibo": [{
|
||||||
|
"amiiboSeries": "Super Smash Bros.", "character": "Zelda", "gameSeries": "The Legend of Zelda",
|
||||||
|
"head": "01000000", "tail": "00040002", "name": "Zelda", "type": "Figure",
|
||||||
|
"image": "https://example.com/zelda.png",
|
||||||
|
"release": {"na": "2014-11-21"},
|
||||||
|
"games3DS": [],
|
||||||
|
"gamesSwitch": [{
|
||||||
|
"gameID": ["01007EF00011E000"],
|
||||||
|
"gameName": "The Legend of Zelda: Breath of the Wild",
|
||||||
|
"amiiboUsage": [{"Usage": "Spawns a random selection of items.", "write": false}]
|
||||||
|
}],
|
||||||
|
"gamesWiiU": [{
|
||||||
|
"gameID": ["0005000010145000"],
|
||||||
|
"gameName": "Super Smash Bros. for Wii U"
|
||||||
|
}]
|
||||||
|
}]}
|
||||||
|
"""
|
||||||
|
/// The response for an `id` filter that matches nothing.
|
||||||
|
static let amiibosNull = """
|
||||||
|
{"amiibo": null}
|
||||||
|
"""
|
||||||
|
/// The response for any other filter that matches nothing.
|
||||||
|
static let amiibosEmpty = """
|
||||||
|
{"amiibo": []}
|
||||||
|
"""
|
||||||
|
/// Two key-name items in reverse key order.
|
||||||
|
static let keyNameList = """
|
||||||
|
{"amiibo": [{"key": "0x01", "name": "First"}, {"key": "0x00", "name": "Second"}]}
|
||||||
|
"""
|
||||||
|
/// A single key-name item, as returned for a `key` filter.
|
||||||
|
static let keyName = """
|
||||||
|
{"amiibo": {"key": "0x01", "name": "First"}}
|
||||||
|
"""
|
||||||
|
/// The last updated timestamp.
|
||||||
|
static let lastUpdated = """
|
||||||
|
{"lastUpdated": "2026-07-24T12:34:56.000000"}
|
||||||
|
"""
|
||||||
|
/// The body of a 400 response.
|
||||||
|
static let badRequest = """
|
||||||
|
{"code": 400, "error": "Bad request."}
|
||||||
|
"""
|
||||||
|
/// The body of a 404 response.
|
||||||
|
static let notFound = """
|
||||||
|
{"code": 404, "error": "Not found."}
|
||||||
|
"""
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import AmiiboService
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
@Suite("Filter conformances")
|
||||||
|
struct FilterConformanceTests {
|
||||||
|
|
||||||
|
// MARK: Equatable tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `compares amiibo filters by value`() {
|
||||||
|
// GIVEN
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(AmiiboFilter() == AmiiboFilter())
|
||||||
|
#expect(AmiiboFilter(name: "zelda") == AmiiboFilter(name: "zelda"))
|
||||||
|
#expect(AmiiboFilter(name: "zelda") != AmiiboFilter(name: "mario"))
|
||||||
|
#expect(AmiiboFilter() != AmiiboFilter(showGames: true))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `compares key-name filters by value`() {
|
||||||
|
// GIVEN
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(AmiiboSeriesFilter() == AmiiboSeriesFilter())
|
||||||
|
#expect(AmiiboSeriesFilter(key: "0x01") == AmiiboSeriesFilter(key: "0x01"))
|
||||||
|
#expect(AmiiboSeriesFilter(key: "0x01") != AmiiboSeriesFilter(name: "0x01"))
|
||||||
|
#expect(AmiiboTypeFilter(name: "Card") != AmiiboTypeFilter(name: "Figure"))
|
||||||
|
#expect(GameCharacterFilter(key: "0x0100") != GameCharacterFilter())
|
||||||
|
#expect(GameSeriesFilter(name: "Pikmin") == GameSeriesFilter(name: "Pikmin"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Hashable tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `hashes equal filters alike`() {
|
||||||
|
// GIVEN
|
||||||
|
let amiiboFilters: Set = [AmiiboFilter(name: "zelda"), AmiiboFilter(name: "zelda"), AmiiboFilter(name: "mario")]
|
||||||
|
let seriesFilters: Set = [AmiiboSeriesFilter(key: "0x01"), AmiiboSeriesFilter(key: "0x01"), AmiiboSeriesFilter()]
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(amiiboFilters.count == 2)
|
||||||
|
#expect(seriesFilters.count == 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import AmiiboService
|
||||||
|
import Foundation
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
@Suite("Model conformances")
|
||||||
|
struct ModelConformanceTests {
|
||||||
|
|
||||||
|
// MARK: Identifiable tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `identifies an amiibo by its identifier`() {
|
||||||
|
// GIVEN
|
||||||
|
let amiibos = Fixtures.amiibos
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos.map(\.id) == amiibos.map(\.identifier))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `identifies key-name models by their keys`() {
|
||||||
|
// GIVEN
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(Fixtures.amiiboSeries.map(\.id) == Fixtures.amiiboSeries.map(\.key))
|
||||||
|
#expect(Fixtures.amiiboTypes.map(\.id) == Fixtures.amiiboTypes.map(\.key))
|
||||||
|
#expect(Fixtures.gameCharacters.map(\.id) == Fixtures.gameCharacters.map(\.key))
|
||||||
|
#expect(Fixtures.gameSeries.map(\.id) == Fixtures.gameSeries.map(\.key))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Codable tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `round-trips amiibos through JSON`() throws {
|
||||||
|
// GIVEN
|
||||||
|
let amiibos = Fixtures.amiibos
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let decoded = try roundTrip(amiibos)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(decoded == amiibos)
|
||||||
|
#expect(decoded.first?.platform?.switch.first?.usages?.isEmpty == false)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `round-trips key-name models through JSON`() throws {
|
||||||
|
// GIVEN
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
#expect(try roundTrip(Fixtures.amiiboSeries) == Fixtures.amiiboSeries)
|
||||||
|
#expect(try roundTrip(Fixtures.amiiboTypes) == Fixtures.amiiboTypes)
|
||||||
|
#expect(try roundTrip(Fixtures.gameCharacters) == Fixtures.gameCharacters)
|
||||||
|
#expect(try roundTrip(Fixtures.gameSeries) == Fixtures.gameSeries)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Helpers
|
||||||
|
|
||||||
|
private extension ModelConformanceTests {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
/// Encodes a value to JSON and decodes it back.
|
||||||
|
func roundTrip<Value: Codable>(_ value: Value) throws -> Value {
|
||||||
|
try JSONDecoder().decode(Value.self, from: JSONEncoder().encode(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+133
-225
@@ -1,20 +1,29 @@
|
|||||||
//===----------------------------------------------------------------------===
|
// ===----------------------------------------------------------------------===
|
||||||
//
|
//
|
||||||
// This source file is part of the AmiiboService open source project
|
// This source file is part of the Amiibo Service open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
// Licensed under the EUPL 1.2 or later.
|
// Licensed under Apache license v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE for license information
|
// See LICENSE for license information
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
import AmiiboService
|
import AmiiboService
|
||||||
import Foundation
|
import Foundation
|
||||||
import Testing
|
import Testing
|
||||||
|
|
||||||
@Suite("Amiibo Service", .tags(.live))
|
@Suite(
|
||||||
|
"Amiibo Service",
|
||||||
|
.tags(.live),
|
||||||
|
.enabled(
|
||||||
|
if: ProcessInfo.processInfo.environment["AMIIBO_LIVE_TESTS"] == "1",
|
||||||
|
"Set the 'AMIIBO_LIVE_TESTS' environment variable to '1' to run these tests against the live service."
|
||||||
|
)
|
||||||
|
)
|
||||||
struct AmiiboServiceLiveTests {
|
struct AmiiboServiceLiveTests {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
@@ -29,18 +38,17 @@ struct AmiiboServiceLiveTests {
|
|||||||
|
|
||||||
// MARK: Functions tests
|
// MARK: Functions tests
|
||||||
|
|
||||||
#if swift(>=6.2)
|
|
||||||
@Test(arguments: zip(
|
@Test(arguments: zip(
|
||||||
Input.amiibos,
|
Input.amiibos,
|
||||||
Output.amiibos
|
Output.amiibos
|
||||||
))
|
))
|
||||||
func `get amiibos`(
|
func `get amiibos`(
|
||||||
filter: AmiiboFilter,
|
filter: AmiiboFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
try await assertAmiibos(
|
try await assertAmiibos(
|
||||||
with: filter,
|
with: filter,
|
||||||
expects: numberOfItems
|
expects: count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,11 +72,11 @@ struct AmiiboServiceLiveTests {
|
|||||||
))
|
))
|
||||||
func `get amiibo series`(
|
func `get amiibo series`(
|
||||||
filter: AmiiboSeriesFilter,
|
filter: AmiiboSeriesFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
try await assertAmiiboSeries(
|
try await assertAmiiboSeries(
|
||||||
with: filter,
|
with: filter,
|
||||||
expects: numberOfItems
|
expects: count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,11 +100,11 @@ struct AmiiboServiceLiveTests {
|
|||||||
))
|
))
|
||||||
func `get amiibo types`(
|
func `get amiibo types`(
|
||||||
filter: AmiiboTypeFilter,
|
filter: AmiiboTypeFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
try await assertAmiiboTypes(
|
try await assertAmiiboTypes(
|
||||||
with: filter,
|
with: filter,
|
||||||
expects: numberOfItems
|
expects: count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,11 +128,11 @@ struct AmiiboServiceLiveTests {
|
|||||||
))
|
))
|
||||||
func `get game characters`(
|
func `get game characters`(
|
||||||
filter: GameCharacterFilter,
|
filter: GameCharacterFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
try await assertGameCharacters(
|
try await assertGameCharacters(
|
||||||
with: filter,
|
with: filter,
|
||||||
expects: numberOfItems
|
expects: count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,11 +156,11 @@ struct AmiiboServiceLiveTests {
|
|||||||
))
|
))
|
||||||
func `get game series`(
|
func `get game series`(
|
||||||
filter: GameSeriesFilter,
|
filter: GameSeriesFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
try await assertGameSeries(
|
try await assertGameSeries(
|
||||||
with: filter,
|
with: filter,
|
||||||
expects: numberOfItems
|
expects: count
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,161 +181,11 @@ struct AmiiboServiceLiveTests {
|
|||||||
@Test
|
@Test
|
||||||
func `get the last updated timestamp`() async throws {
|
func `get the last updated timestamp`() async throws {
|
||||||
try await assertLastUpdated(
|
try await assertLastUpdated(
|
||||||
day: 21,
|
onOrAfterDay: 22,
|
||||||
month: 9,
|
month: 10,
|
||||||
year: 2025
|
year: 2026
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
@Test("get amiibos", arguments: zip(
|
|
||||||
Input.amiibos,
|
|
||||||
Output.amiibos
|
|
||||||
))
|
|
||||||
func getAmiibos(
|
|
||||||
filter: AmiiboFilter,
|
|
||||||
expects numberOfItems: Int
|
|
||||||
) async throws {
|
|
||||||
try await assertAmiibos(
|
|
||||||
with: filter,
|
|
||||||
expects: numberOfItems
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get amiibos throws", arguments: zip(
|
|
||||||
Input.amiibosThrows,
|
|
||||||
Output.amiibosThrows
|
|
||||||
))
|
|
||||||
func getAmiibosThrows(
|
|
||||||
filter: AmiiboFilter,
|
|
||||||
expects error: AmiiboServiceError
|
|
||||||
) async throws {
|
|
||||||
try await assertsAmiibosThrows(
|
|
||||||
error: error,
|
|
||||||
when: filter
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get amiibo series", arguments: zip(
|
|
||||||
Input.amiiboSeries,
|
|
||||||
Output.amiiboSeries
|
|
||||||
))
|
|
||||||
func getAmiiboSeries(
|
|
||||||
filter: AmiiboSeriesFilter,
|
|
||||||
expects numberOfItems: Int
|
|
||||||
) async throws {
|
|
||||||
try await assertAmiiboSeries(
|
|
||||||
with: filter,
|
|
||||||
expects: numberOfItems
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get amiibo series throws", arguments: zip(
|
|
||||||
Input.amiiboSeriesThrows,
|
|
||||||
Output.amiiboSeriesThrows
|
|
||||||
))
|
|
||||||
func getAmiiboSeriesThrows(
|
|
||||||
filter: AmiiboSeriesFilter,
|
|
||||||
expects error: AmiiboServiceError
|
|
||||||
) async throws {
|
|
||||||
try await assertsAmiiboSeriesThrows(
|
|
||||||
error: error,
|
|
||||||
when: filter
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get amiibo types", arguments: zip(
|
|
||||||
Input.amiiboTypes,
|
|
||||||
Output.amiiboTypes
|
|
||||||
))
|
|
||||||
func getAmiiboTypes(
|
|
||||||
filter: AmiiboTypeFilter,
|
|
||||||
expects numberOfItems: Int
|
|
||||||
) async throws {
|
|
||||||
try await assertAmiiboTypes(
|
|
||||||
with: filter,
|
|
||||||
expects: numberOfItems
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get amiibo types throws", arguments: zip(
|
|
||||||
Input.amiiboTypesThrows,
|
|
||||||
Output.amiiboTypesThrows
|
|
||||||
))
|
|
||||||
func getAmiiboTypesThrows(
|
|
||||||
filter: AmiiboTypeFilter,
|
|
||||||
expects error: AmiiboServiceError
|
|
||||||
) async throws {
|
|
||||||
try await assertsAmiiboTypesThrows(
|
|
||||||
error: error,
|
|
||||||
when: filter
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get game characters", arguments: zip(
|
|
||||||
Input.gameCharacters,
|
|
||||||
Output.gameCharacters
|
|
||||||
))
|
|
||||||
func getGameCharacters(
|
|
||||||
filter: GameCharacterFilter,
|
|
||||||
expects numberOfItems: Int
|
|
||||||
) async throws {
|
|
||||||
try await assertGameCharacters(
|
|
||||||
with: filter,
|
|
||||||
expects: numberOfItems
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get game characters throws", arguments: zip(
|
|
||||||
Input.gameCharactersThrows,
|
|
||||||
Output.gameCharactersThrows
|
|
||||||
))
|
|
||||||
func getGameCharactersThrows(
|
|
||||||
filter: GameCharacterFilter,
|
|
||||||
expects error: AmiiboServiceError
|
|
||||||
) async throws {
|
|
||||||
try await assertsGameCharactersThrows(
|
|
||||||
error: error,
|
|
||||||
when: filter
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get game series", arguments: zip(
|
|
||||||
Input.gameSeries,
|
|
||||||
Output.gameSeries
|
|
||||||
))
|
|
||||||
func getGameSeries(
|
|
||||||
filter: GameSeriesFilter,
|
|
||||||
expects numberOfItems: Int
|
|
||||||
) async throws {
|
|
||||||
try await assertGameSeries(
|
|
||||||
with: filter,
|
|
||||||
expects: numberOfItems
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get game series throws", arguments: zip(
|
|
||||||
Input.gameSeriesThrows,
|
|
||||||
Output.gameSeriesThrows
|
|
||||||
))
|
|
||||||
func getGameSeriesThrows(
|
|
||||||
filter: GameSeriesFilter,
|
|
||||||
expects error: AmiiboServiceError
|
|
||||||
) async throws {
|
|
||||||
try await assertsGameSeriesThrows(
|
|
||||||
error: error,
|
|
||||||
when: filter
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test("get last updated timestamp")
|
|
||||||
func getLastUpdated() async throws {
|
|
||||||
try await assertLastUpdated(
|
|
||||||
day: 21,
|
|
||||||
month: 9,
|
|
||||||
year: 2025
|
|
||||||
)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,17 +198,17 @@ private extension AmiiboServiceLiveTests {
|
|||||||
/// Asserts the number of items returned by the `amiibos` endpoint that matched a given filter.
|
/// Asserts the number of items returned by the `amiibos` endpoint that matched a given filter.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - filter: An amiibo filter type.
|
/// - filter: An amiibo filter type.
|
||||||
/// - numberOfItems: An expected number of items returned.
|
/// - count: An expected count of items to be returned.
|
||||||
func assertAmiibos(
|
func assertAmiibos(
|
||||||
with filter: AmiiboFilter,
|
with filter: AmiiboFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
// WHEN
|
// WHEN
|
||||||
let amiibos = try await service.getAmiibos(filter)
|
let amiibos = try await service.getAmiibos(filter)
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
#expect(amiibos.count == numberOfItems)
|
assert(amiibos.count, matches: count)
|
||||||
|
|
||||||
guard
|
guard
|
||||||
!amiibos.isEmpty,
|
!amiibos.isEmpty,
|
||||||
@@ -363,6 +221,7 @@ private extension AmiiboServiceLiveTests {
|
|||||||
|
|
||||||
if filter.showUsage == true {
|
if filter.showUsage == true {
|
||||||
#expect(firstAmiiboPlatform.switch.first?.usages?.isEmpty == false)
|
#expect(firstAmiiboPlatform.switch.first?.usages?.isEmpty == false)
|
||||||
|
#expect(firstAmiiboPlatform.switch2.first?.usages?.isEmpty == false)
|
||||||
#expect(firstAmiiboPlatform.threeDS.first?.usages?.isEmpty == false)
|
#expect(firstAmiiboPlatform.threeDS.first?.usages?.isEmpty == false)
|
||||||
#expect(firstAmiiboPlatform.wiiU.first?.usages?.isEmpty == false)
|
#expect(firstAmiiboPlatform.wiiU.first?.usages?.isEmpty == false)
|
||||||
}
|
}
|
||||||
@@ -387,17 +246,17 @@ private extension AmiiboServiceLiveTests {
|
|||||||
/// Asserts the number of items returned by the `amiiboSeries` endpoint that matched a given filter.
|
/// Asserts the number of items returned by the `amiiboSeries` endpoint that matched a given filter.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - filter: An amiibo series filter type.
|
/// - filter: An amiibo series filter type.
|
||||||
/// - numberOfItems: An expected number of items returned.
|
/// - count: An expected count of items to be returned.
|
||||||
func assertAmiiboSeries(
|
func assertAmiiboSeries(
|
||||||
with filter: AmiiboSeriesFilter,
|
with filter: AmiiboSeriesFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
// WHEN
|
// WHEN
|
||||||
let amiiboSeries = try await service.getAmiiboSeries(filter)
|
let amiiboSeries = try await service.getAmiiboSeries(filter)
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
#expect(amiiboSeries.count == numberOfItems)
|
assert(amiiboSeries.count, matches: count)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Asserts the error thrown by the `amiiboSeries` endpoint.
|
/// Asserts the error thrown by the `amiiboSeries` endpoint.
|
||||||
@@ -419,17 +278,17 @@ private extension AmiiboServiceLiveTests {
|
|||||||
/// Asserts the number of items returned by the `amiiboTypes` endpoint that matched a given filter.
|
/// Asserts the number of items returned by the `amiiboTypes` endpoint that matched a given filter.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - filter: An amiibo type filter type.
|
/// - filter: An amiibo type filter type.
|
||||||
/// - numberOfItems: An expected number of items returned.
|
/// - count: An expected count of items to be returned.
|
||||||
func assertAmiiboTypes(
|
func assertAmiiboTypes(
|
||||||
with filter: AmiiboTypeFilter,
|
with filter: AmiiboTypeFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
// WHEN
|
// WHEN
|
||||||
let amiiboTypes = try await service.getAmiiboTypes(filter)
|
let amiiboTypes = try await service.getAmiiboTypes(filter)
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
#expect(amiiboTypes.count == numberOfItems)
|
assert(amiiboTypes.count, matches: count)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Asserts the error thrown by the `amiiboTypes` endpoint.
|
/// Asserts the error thrown by the `amiiboTypes` endpoint.
|
||||||
@@ -451,17 +310,17 @@ private extension AmiiboServiceLiveTests {
|
|||||||
/// Asserts the number of items returned by the `gameCharacters` endpoint that matched a given filter.
|
/// Asserts the number of items returned by the `gameCharacters` endpoint that matched a given filter.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - filter: A game character filter type.
|
/// - filter: A game character filter type.
|
||||||
/// - numberOfItems: An expected number of items returned.
|
/// - count: An expected count of items to be returned.
|
||||||
func assertGameCharacters(
|
func assertGameCharacters(
|
||||||
with filter: GameCharacterFilter,
|
with filter: GameCharacterFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
// WHEN
|
// WHEN
|
||||||
let gameCharacters = try await service.getGameCharacters(filter)
|
let gameCharacters = try await service.getGameCharacters(filter)
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
#expect(gameCharacters.count == numberOfItems)
|
assert(gameCharacters.count, matches: count)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Asserts the error thrown by the `gameCharacters` endpoint.
|
/// Asserts the error thrown by the `gameCharacters` endpoint.
|
||||||
@@ -483,17 +342,17 @@ private extension AmiiboServiceLiveTests {
|
|||||||
/// Asserts the number of items returned by the `gameSeries` endpoint that matched a given filter.
|
/// Asserts the number of items returned by the `gameSeries` endpoint that matched a given filter.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - filter: A game series filter type.
|
/// - filter: A game series filter type.
|
||||||
/// - numberOfItems: An expected number of items returned.
|
/// - count: An expected count of items to be returned.
|
||||||
func assertGameSeries(
|
func assertGameSeries(
|
||||||
with filter: GameSeriesFilter,
|
with filter: GameSeriesFilter,
|
||||||
expects numberOfItems: Int
|
expects count: ExpectedCount
|
||||||
) async throws {
|
) async throws {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
// WHEN
|
// WHEN
|
||||||
let gameSeries = try await service.getGameSeries(filter)
|
let gameSeries = try await service.getGameSeries(filter)
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
#expect(gameSeries.count == numberOfItems)
|
assert(gameSeries.count, matches: count)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Asserts the error thrown by the `gameSeries` endpoint.
|
/// Asserts the error thrown by the `gameSeries` endpoint.
|
||||||
@@ -512,31 +371,61 @@ private extension AmiiboServiceLiveTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Asserts the date returned by the `lastUpdated` endpoint.
|
/// Asserts the date returned by the `lastUpdated` endpoint is within a plausible range.
|
||||||
|
///
|
||||||
|
/// The live service updates its data over time, so this assertion checks the returned date is not before the last known update and not in the future, instead of matching an exact date that would break on every update.
|
||||||
|
///
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - day: A number of day of the last updated date.
|
/// - day: A number of day of the earliest expected last updated date.
|
||||||
/// - month: A number of month of the last updated date.
|
/// - month: A number of month of the earliest expected last updated date.
|
||||||
/// - year: A number of year of the last updated date.
|
/// - year: A number of year of the earliest expected last updated date.
|
||||||
func assertLastUpdated(
|
func assertLastUpdated(
|
||||||
day: Int,
|
onOrAfterDay day: Int,
|
||||||
month: Int,
|
month: Int,
|
||||||
year: Int
|
year: Int
|
||||||
) async throws {
|
) async throws {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
|
var calendar = Calendar(identifier: .gregorian)
|
||||||
|
|
||||||
|
calendar.timeZone = try #require(TimeZone(secondsFromGMT: 0))
|
||||||
|
|
||||||
|
let earliest = try #require(calendar.date(from: .init(
|
||||||
|
year: year,
|
||||||
|
month: month,
|
||||||
|
day: day
|
||||||
|
)))
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
let dateLastUpdated = try await service.getLastUpdated()
|
let dateLastUpdated = try await service.getLastUpdated()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
let dateComponents = Calendar.current.dateComponents(
|
#expect(dateLastUpdated >= earliest)
|
||||||
[.year, .month, .day],
|
#expect(dateLastUpdated <= .now)
|
||||||
from: dateLastUpdated
|
|
||||||
)
|
|
||||||
|
|
||||||
#expect(dateComponents.year == year)
|
|
||||||
#expect(dateComponents.month == month)
|
|
||||||
#expect(dateComponents.day == day)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Asserts an actual number of items matches an expected count.
|
||||||
|
/// - Parameters:
|
||||||
|
/// - actualCount: A number of items returned by an endpoint.
|
||||||
|
/// - expectation: An expected count to match the number of items against.
|
||||||
|
func assert(_ actualCount: Int, matches expectation: ExpectedCount) {
|
||||||
|
switch expectation {
|
||||||
|
case let .exactly(expected):
|
||||||
|
#expect(actualCount == expected)
|
||||||
|
case let .atLeast(minimum):
|
||||||
|
#expect(actualCount >= minimum)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Expectations
|
||||||
|
|
||||||
|
/// An expectation about the number of items returned by an endpoint of the live service.
|
||||||
|
enum ExpectedCount {
|
||||||
|
/// The endpoint is expected to return exactly the associated number of items.
|
||||||
|
case exactly(Int)
|
||||||
|
/// The endpoint is expected to return at least the associated number of items, as the data at the live service grows over time.
|
||||||
|
case atLeast(Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Arguments
|
// MARK: - Arguments
|
||||||
@@ -545,7 +434,13 @@ 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(identifier: "0000000000000000"),
|
||||||
|
.init(identifier: "0000000"),
|
||||||
.init(name: "zelda"),
|
.init(name: "zelda"),
|
||||||
.init(name: "Something"),
|
.init(name: "Something"),
|
||||||
.init(name: "zel"),
|
.init(name: "zel"),
|
||||||
@@ -579,8 +474,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(identifier: "0000000000000000"),
|
.init(head: .empty),
|
||||||
.init(identifier: "0000000"),
|
.init(tail: .empty),
|
||||||
.init(identifier: .empty),
|
.init(identifier: .empty),
|
||||||
.init(type: "0x"),
|
.init(type: "0x"),
|
||||||
.init(series: "0x"),
|
.init(series: "0x"),
|
||||||
@@ -650,24 +545,37 @@ enum Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum Output {
|
enum Output {
|
||||||
/// A list of number of items that are expected from the `assertAmiibos` assertion.
|
/// A list of expected counts 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]
|
///
|
||||||
|
/// Counts for filters that match a growing set of items are expressed as `atLeast` minimums, so the tests do not break whenever new amiibo items are added to the live service.
|
||||||
|
static let amiibos: [ExpectedCount] = [
|
||||||
|
.atLeast(.minimumAmiibos),
|
||||||
|
.atLeast(7), .atLeast(7),
|
||||||
|
.exactly(1), .atLeast(1),
|
||||||
|
.exactly(1), .exactly(.zero), .exactly(.zero),
|
||||||
|
.atLeast(5), .exactly(.zero), .atLeast(7), .atLeast(.minimumAmiibos),
|
||||||
|
.atLeast(254), .atLeast(254), .exactly(.zero), .exactly(.zero), .exactly(.zero), .exactly(.zero),
|
||||||
|
.atLeast(96), .atLeast(26), .exactly(.zero), .exactly(.zero), .atLeast(63), .atLeast(.minimumAmiibos),
|
||||||
|
.atLeast(14), .atLeast(6), .exactly(.zero), .exactly(.zero), .exactly(.zero), .atLeast(.minimumAmiibos),
|
||||||
|
.atLeast(53), .atLeast(32), .exactly(.zero), .exactly(.zero), .atLeast(152), .atLeast(.minimumAmiibos),
|
||||||
|
.atLeast(.minimumAmiibos), .atLeast(.minimumAmiibos)
|
||||||
|
]
|
||||||
/// 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, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest]
|
||||||
/// A list of number of items that are expected from the `assertAmiiboSeries` assertion.
|
/// A list of expected counts from the `assertAmiiboSeries` assertion.
|
||||||
static let amiiboSeries: [Int] = [.totalAmiiboSeries, 1, 1, 1, .totalAmiiboSeries]
|
static let amiiboSeries: [ExpectedCount] = [.atLeast(.minimumAmiiboSeries), .exactly(1), .exactly(1), .exactly(1), .atLeast(.minimumAmiiboSeries)]
|
||||||
/// 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.
|
||||||
static let amiiboSeriesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
static let amiiboSeriesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
||||||
/// A list of number of items that are expected from the `assertAmiiboTypes` assertion.
|
/// A list of expected counts from the `assertAmiiboTypes` assertion.
|
||||||
static let amiiboTypes: [Int] = [.totalAmiiboTypes, 1, 1, 1, .totalAmiiboTypes]
|
static let amiiboTypes: [ExpectedCount] = [.atLeast(.minimumAmiiboTypes), .exactly(1), .exactly(1), .exactly(1), .atLeast(.minimumAmiiboTypes)]
|
||||||
/// A list of errors are expected to be thrown from the `assertAmiiboTypesThrows` assertion.
|
/// A list of errors are expected to be thrown from the `assertAmiiboTypesThrows` assertion.
|
||||||
static let amiiboTypesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
static let amiiboTypesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
||||||
/// A list of number of items that are expected from the `assertGameCharacters` assertion.
|
/// A list of expected counts from the `assertGameCharacters` assertion.
|
||||||
static let gameCharacters: [Int] = [.totalGameCharacters, 1, 1, 1, .totalGameCharacters]
|
static let gameCharacters: [ExpectedCount] = [.atLeast(.minimumGameCharacters), .exactly(1), .exactly(1), .exactly(1), .atLeast(.minimumGameCharacters)]
|
||||||
/// A list of errors are expected to be thrown from the `assertGameCharactersThrows` assertion.
|
/// A list of errors are expected to be thrown from the `assertGameCharactersThrows` assertion.
|
||||||
static let gameCharactersThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
static let gameCharactersThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
||||||
/// A list of number of items that are expected from the `assertGameSeries` assertion.
|
/// A list of expected counts from the `assertGameSeries` assertion.
|
||||||
static let gameSeries: [Int] = [.totalGameSeries, 1, 1, 1, .totalGameSeries]
|
static let gameSeries: [ExpectedCount] = [.atLeast(.minimumGameSeries), .exactly(1), .exactly(1), .exactly(1), .atLeast(.minimumGameSeries)]
|
||||||
/// A list of errors are expected to be thrown from the `assertGameSeriesThrows` assertion.
|
/// A list of errors are expected to be thrown from the `assertGameSeriesThrows` assertion.
|
||||||
static let gameSeriesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
static let gameSeriesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
|
||||||
}
|
}
|
||||||
@@ -675,16 +583,16 @@ enum Output {
|
|||||||
// MARK: - Constants
|
// MARK: - Constants
|
||||||
|
|
||||||
private extension Int {
|
private extension Int {
|
||||||
/// A number that represents the total number of amiibo items currently available at the live service.
|
/// A number that represents the minimum number of amiibo items expected from the live service, as of October 2026.
|
||||||
static let totalAmiibos = 889
|
static let minimumAmiibos = 952
|
||||||
/// A number that represents the total number of amiibo series currently available at the live service.
|
/// A number that represents the minimum number of amiibo series expected from the live service, as of October 2026.
|
||||||
static let totalAmiiboSeries = 29
|
static let minimumAmiiboSeries = 32
|
||||||
/// A number that represents the total number of amiibo types currently available at the live service.
|
/// A number that represents the minimum number of amiibo types expected from the live service, as of October 2026.
|
||||||
static let totalAmiiboTypes = 5
|
static let minimumAmiiboTypes = 5
|
||||||
/// A number that represents the total number of game characters currently available at the live service.
|
/// A number that represents the minimum number of game characters expected from the live service, as of October 2026.
|
||||||
static let totalGameCharacters = 668
|
static let minimumGameCharacters = 685
|
||||||
/// A number that represents the total number of game series currently available at the live service.
|
/// A number that represents the minimum number of game series expected from the live service, as of October 2026.
|
||||||
static let totalGameSeries = 117
|
static let minimumGameSeries = 119
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension String {
|
private extension String {
|
||||||
@@ -0,0 +1,328 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import AmiiboService
|
||||||
|
import Foundation
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
@Suite("Amiibo Service [Mock]", .tags(.mock))
|
||||||
|
struct AmiiboServiceMockTests {
|
||||||
|
|
||||||
|
// MARK: Get Amiibos tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns empty amiibos when mock provides an empty list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(amiibos: []))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await service.getAmiibos()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns amiibos when mock provides a list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(amiibos: Fixtures.amiibos))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiibos = try await service.getAmiibos()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiibos == Fixtures.amiibos)
|
||||||
|
#expect(amiibos.first?.identifier == "0100000000040002")
|
||||||
|
#expect(amiibos.first?.imageURL != nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when mock provides no amiibos`() async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient())
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await service.getAmiibos()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: Errors.all)
|
||||||
|
func `throws error for amiibos when mock is configured with error`(error: AmiiboServiceError) async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(error: error))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: error) {
|
||||||
|
try await service.getAmiibos()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Amiibo Series tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns empty amiibo series when mock provides an empty list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(amiiboSeries: []))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiiboSeries = try await service.getAmiiboSeries()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiiboSeries.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns amiibo series when mock provides a list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(amiiboSeries: Fixtures.amiiboSeries))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiiboSeries = try await service.getAmiiboSeries()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiiboSeries == Fixtures.amiiboSeries)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when mock provides no amiibo series`() async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient())
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await service.getAmiiboSeries()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: Errors.all)
|
||||||
|
func `throws error for amiibo series when mock is configured with error`(error: AmiiboServiceError) async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(error: error))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: error) {
|
||||||
|
try await service.getAmiiboSeries()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Amiibo Types tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns empty amiibo types when mock provides an empty list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(amiiboTypes: []))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiiboTypes = try await service.getAmiiboTypes()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiiboTypes.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns amiibo types when mock provides a list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(amiiboTypes: Fixtures.amiiboTypes))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let amiiboTypes = try await service.getAmiiboTypes()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(amiiboTypes == Fixtures.amiiboTypes)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when mock provides no amiibo types`() async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient())
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await service.getAmiiboTypes()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: Errors.all)
|
||||||
|
func `throws error for amiibo types when mock is configured with error`(error: AmiiboServiceError) async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(error: error))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: error) {
|
||||||
|
try await service.getAmiiboTypes()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Game Characters tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns empty game characters when mock provides an empty list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(gameCharacters: []))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let gameCharacters = try await service.getGameCharacters()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(gameCharacters.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns game characters when mock provides a list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(gameCharacters: Fixtures.gameCharacters))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let gameCharacters = try await service.getGameCharacters()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(gameCharacters == Fixtures.gameCharacters)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when mock provides no game characters`() async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient())
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await service.getGameCharacters()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: Errors.all)
|
||||||
|
func `throws error for game characters when mock is configured with error`(error: AmiiboServiceError) async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(error: error))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: error) {
|
||||||
|
try await service.getGameCharacters()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Game Series tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns empty game series when mock provides an empty list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(gameSeries: []))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let gameSeries = try await service.getGameSeries()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(gameSeries.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns game series when mock provides a list`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(gameSeries: Fixtures.gameSeries))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let gameSeries = try await service.getGameSeries()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(gameSeries == Fixtures.gameSeries)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when mock provides no game series`() async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient())
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await service.getGameSeries()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: Errors.all)
|
||||||
|
func `throws error for game series when mock is configured with error`(error: AmiiboServiceError) async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(error: error))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: error) {
|
||||||
|
try await service.getGameSeries()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Get Last Updated tests
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `returns date when mock provides a last updated date`() async throws {
|
||||||
|
// GIVEN
|
||||||
|
let expectedDate = Date(timeIntervalSince1970: 1_700_000_000)
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(lastUpdated: expectedDate))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
let lastUpdated = try await service.getLastUpdated()
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
#expect(lastUpdated == expectedDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func `throws notFound when mock provides no last updated date`() async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient())
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: AmiiboServiceError.notFound) {
|
||||||
|
try await service.getLastUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(arguments: Errors.all)
|
||||||
|
func `throws error for last updated when mock is configured with error`(error: AmiiboServiceError) async {
|
||||||
|
// GIVEN
|
||||||
|
let service = AmiiboService(client: AmiiboMockClient(error: error))
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
// THEN
|
||||||
|
await #expect(throws: error) {
|
||||||
|
try await service.getLastUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Arguments
|
||||||
|
|
||||||
|
private enum Errors {
|
||||||
|
/// All possible errors that can be thrown by the service.
|
||||||
|
static let all: [AmiiboServiceError] = [
|
||||||
|
.badRequest,
|
||||||
|
.cancelled,
|
||||||
|
.decoding,
|
||||||
|
.notAvailable,
|
||||||
|
.notFound,
|
||||||
|
.undocumented(500),
|
||||||
|
.unknown("An underlying error description.")
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import AmiiboService
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
/// A mock implementation of ``AmiiboClient`` that returns pre-configured data or throws pre-configured errors, for testing purposes.
|
||||||
|
struct AmiiboMockClient {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// The list of amiibo items to return when ``getAmiibos(by:)`` is called, or `nil` to trigger a ``AmiiboServiceError/notFound`` error.
|
||||||
|
private let amiibos: [Amiibo]?
|
||||||
|
|
||||||
|
/// The list of amiibo series to return when ``getAmiiboSeries(by:)`` is called, or `nil` to trigger a ``AmiiboServiceError/notFound`` error.
|
||||||
|
private let amiiboSeries: [AmiiboSeries]?
|
||||||
|
|
||||||
|
/// The list of amiibo types to return when ``getAmiiboTypes(by:)`` is called, or `nil` to trigger a ``AmiiboServiceError/notFound`` error.
|
||||||
|
private let amiiboTypes: [AmiiboType]?
|
||||||
|
|
||||||
|
/// An error to throw before returning any data. Takes precedence over stored data when set.
|
||||||
|
private let error: AmiiboServiceError?
|
||||||
|
|
||||||
|
/// The list of game characters to return when ``getGameCharacters(by:)`` is called, or `nil` to trigger a ``AmiiboServiceError/notFound`` error.
|
||||||
|
private let gameCharacters: [GameCharacter]?
|
||||||
|
|
||||||
|
/// The list of game series to return when ``getGameSeries(by:)`` is called, or `nil` to trigger a ``AmiiboServiceError/notFound`` error.
|
||||||
|
private let gameSeries: [GameSeries]?
|
||||||
|
|
||||||
|
/// The last updated date to return when ``getLastUpdated()`` is called, or `nil` to trigger a ``AmiiboServiceError/notFound`` error.
|
||||||
|
private let lastUpdated: Date?
|
||||||
|
|
||||||
|
// MARK: Initializers
|
||||||
|
|
||||||
|
/// Initializes this client.
|
||||||
|
/// - Parameters:
|
||||||
|
/// - amiibos: A list of amiibo items to return, if any.
|
||||||
|
/// - amiiboSeries: A list of amiibo series to return, if any.
|
||||||
|
/// - amiiboTypes: A list of amiibo types to return, if any.
|
||||||
|
/// - gameCharacters: A list of game characters to return, if any.
|
||||||
|
/// - gameSeries: A list of game series to return, if any.
|
||||||
|
/// - lastUpdated: A last updated date to return, if any.
|
||||||
|
/// - error: An error to throw, if any.
|
||||||
|
init(
|
||||||
|
amiibos: [Amiibo]? = nil,
|
||||||
|
amiiboSeries: [AmiiboSeries]? = nil,
|
||||||
|
amiiboTypes: [AmiiboType]? = nil,
|
||||||
|
gameCharacters: [GameCharacter]? = nil,
|
||||||
|
gameSeries: [GameSeries]? = nil,
|
||||||
|
lastUpdated: Date? = nil,
|
||||||
|
error: AmiiboServiceError? = nil
|
||||||
|
) {
|
||||||
|
self.amiibos = amiibos
|
||||||
|
self.amiiboSeries = amiiboSeries
|
||||||
|
self.amiiboTypes = amiiboTypes
|
||||||
|
self.error = error
|
||||||
|
self.gameCharacters = gameCharacters
|
||||||
|
self.gameSeries = gameSeries
|
||||||
|
self.lastUpdated = lastUpdated
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - AmiiboClient
|
||||||
|
|
||||||
|
extension AmiiboMockClient: AmiiboClient {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
func getAmiibos(
|
||||||
|
by filter: AmiiboFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
|
try fetchAmiibosIfAny()
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAmiiboSeries(
|
||||||
|
by filter: AmiiboSeriesFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
||||||
|
try fetchAmiiboSeriesIfAny()
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAmiiboTypes(
|
||||||
|
by filter: AmiiboTypeFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [AmiiboType] {
|
||||||
|
try fetchAmiiboTypesIfAny()
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGameCharacters(
|
||||||
|
by filter: GameCharacterFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [GameCharacter] {
|
||||||
|
try fetchGameCharactersIfAny()
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGameSeries(
|
||||||
|
by filter: GameSeriesFilter
|
||||||
|
) async throws(AmiiboServiceError) -> [GameSeries] {
|
||||||
|
try fetchGameSeriesIfAny()
|
||||||
|
}
|
||||||
|
|
||||||
|
func getLastUpdated() async throws(AmiiboServiceError) -> Date {
|
||||||
|
try fetchLastUpdatedIfAny()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Helpers
|
||||||
|
|
||||||
|
private extension AmiiboMockClient {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
/// Fetches a list of amiibo items, if any.
|
||||||
|
/// - Returns: A list of amiibo items.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
||||||
|
func fetchAmiibosIfAny() throws(AmiiboServiceError) -> [Amiibo] {
|
||||||
|
try throwErrorIfExists()
|
||||||
|
|
||||||
|
guard let amiibos else {
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
}
|
||||||
|
|
||||||
|
return amiibos
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches a list of amiibo series, if any.
|
||||||
|
/// - Returns: A list of amiibo series.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
||||||
|
func fetchAmiiboSeriesIfAny() throws(AmiiboServiceError) -> [AmiiboSeries] {
|
||||||
|
try throwErrorIfExists()
|
||||||
|
|
||||||
|
guard let amiiboSeries else {
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
}
|
||||||
|
|
||||||
|
return amiiboSeries
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches a list of amiibo types, if any.
|
||||||
|
/// - Returns: A list of amiibo types.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
||||||
|
func fetchAmiiboTypesIfAny() throws(AmiiboServiceError) -> [AmiiboType] {
|
||||||
|
try throwErrorIfExists()
|
||||||
|
|
||||||
|
guard let amiiboTypes else {
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
}
|
||||||
|
|
||||||
|
return amiiboTypes
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches a list of game characters, if any.
|
||||||
|
/// - Returns: A list of game characters.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
||||||
|
func fetchGameCharactersIfAny() throws(AmiiboServiceError) -> [GameCharacter] {
|
||||||
|
try throwErrorIfExists()
|
||||||
|
|
||||||
|
guard let gameCharacters else {
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
}
|
||||||
|
|
||||||
|
return gameCharacters
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches a list of game series, if any.
|
||||||
|
/// - Returns: A list of game series, if any.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
||||||
|
func fetchGameSeriesIfAny() throws(AmiiboServiceError) -> [GameSeries] {
|
||||||
|
try throwErrorIfExists()
|
||||||
|
|
||||||
|
guard let gameSeries else {
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
}
|
||||||
|
|
||||||
|
return gameSeries
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetches a last updated date, if any.
|
||||||
|
/// - Returns: A last updated date.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
||||||
|
func fetchLastUpdatedIfAny() throws(AmiiboServiceError) -> Date {
|
||||||
|
try throwErrorIfExists()
|
||||||
|
|
||||||
|
guard let lastUpdated else {
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
}
|
||||||
|
|
||||||
|
return lastUpdated
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Throws the configured error if one has been provided.
|
||||||
|
/// - Throws: An ``AmiiboServiceError`` error if one was configured during initialization.
|
||||||
|
func throwErrorIfExists() throws(AmiiboServiceError) {
|
||||||
|
if let error {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
extension Date {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
/// Makes a date from UTC components.
|
||||||
|
static func utc(
|
||||||
|
_ year: Int,
|
||||||
|
_ month: Int,
|
||||||
|
_ day: Int,
|
||||||
|
_ hour: Int = 0,
|
||||||
|
_ minute: Int = 0,
|
||||||
|
_ second: Int = 0
|
||||||
|
) -> Date {
|
||||||
|
var calendar = Calendar(identifier: .gregorian)
|
||||||
|
|
||||||
|
calendar.timeZone = .init(secondsFromGMT: 0)!
|
||||||
|
|
||||||
|
return calendar.date(from: .init(
|
||||||
|
year: year,
|
||||||
|
month: month,
|
||||||
|
day: day,
|
||||||
|
hour: hour,
|
||||||
|
minute: minute,
|
||||||
|
second: second
|
||||||
|
))!
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
extension Tag {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// Tag that indicates tests against a live backend service.
|
||||||
|
@Tag static var live: Self
|
||||||
|
|
||||||
|
/// Tag that indicates tests using a mock client.
|
||||||
|
@Tag static var mock: Self
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import AmiiboService
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
/// Ready-made models for testing purposes.
|
||||||
|
enum Fixtures {
|
||||||
|
/// Amiibo items; the first one has release dates and related games with usages.
|
||||||
|
static let amiibos: [Amiibo] = [
|
||||||
|
.init(
|
||||||
|
head: "01000000",
|
||||||
|
tail: "00040002",
|
||||||
|
name: "Zelda",
|
||||||
|
type: "Figure",
|
||||||
|
series: "Super Smash Bros.",
|
||||||
|
gameCharacter: "Zelda",
|
||||||
|
gameSeries: "The Legend of Zelda",
|
||||||
|
image: "https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_01000000-00040002.png",
|
||||||
|
release: .init(
|
||||||
|
america: Date(timeIntervalSince1970: 1_416_441_600),
|
||||||
|
australia: Date(timeIntervalSince1970: 1_417_564_800),
|
||||||
|
europe: Date(timeIntervalSince1970: 1_417_132_800),
|
||||||
|
japan: Date(timeIntervalSince1970: 1_417_564_800)
|
||||||
|
),
|
||||||
|
platform: .init(
|
||||||
|
switch: [
|
||||||
|
.init(
|
||||||
|
identifiers: ["01007EF00011E000"],
|
||||||
|
name: "The Legend of Zelda: Breath of the Wild",
|
||||||
|
usages: [.init(explanation: "Spawns a random selection of items.", isWriteable: false)]
|
||||||
|
)
|
||||||
|
],
|
||||||
|
wiiU: [
|
||||||
|
.init(
|
||||||
|
identifiers: ["0005000010145000"],
|
||||||
|
name: "Super Smash Bros. for Wii U",
|
||||||
|
usages: [.init(explanation: "Unlocks a figure player.", isWriteable: true)]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
.init(
|
||||||
|
head: "00000000",
|
||||||
|
tail: "00000002",
|
||||||
|
name: "Mario",
|
||||||
|
type: "Figure",
|
||||||
|
series: "Super Smash Bros.",
|
||||||
|
gameCharacter: "Mario",
|
||||||
|
gameSeries: "Super Mario",
|
||||||
|
image: "https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_00000000-00000002.png"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
/// Amiibo series.
|
||||||
|
static let amiiboSeries: [AmiiboSeries] = [
|
||||||
|
.init(key: "0x00", name: "Super Smash Bros."),
|
||||||
|
.init(key: "0x01", name: "Super Mario")
|
||||||
|
]
|
||||||
|
/// Amiibo types.
|
||||||
|
static let amiiboTypes: [AmiiboType] = [
|
||||||
|
.init(key: "0x00", name: "Figure"),
|
||||||
|
.init(key: "0x01", name: "Card")
|
||||||
|
]
|
||||||
|
/// Game characters.
|
||||||
|
static let gameCharacters: [GameCharacter] = [
|
||||||
|
.init(key: "0x0000", name: "Mario"),
|
||||||
|
.init(key: "0x0100", name: "Zelda")
|
||||||
|
]
|
||||||
|
/// Game series.
|
||||||
|
static let gameSeries: [GameSeries] = [
|
||||||
|
.init(key: "0x000", name: "Super Mario"),
|
||||||
|
.init(key: "0x010", name: "The Legend of Zelda")
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import HTTPTypes
|
||||||
|
import OpenAPIRuntime
|
||||||
|
|
||||||
|
/// A transport that answers every request with a canned response, for testing purposes.
|
||||||
|
struct StubTransport: ClientTransport {
|
||||||
|
|
||||||
|
// MARK: Type aliases
|
||||||
|
|
||||||
|
/// A closure that builds the response for a request.
|
||||||
|
typealias Handler = @Sendable (HTTPRequest) throws -> (HTTPResponse, HTTPBody?)
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// The handler that builds the response.
|
||||||
|
private let handler: Handler
|
||||||
|
|
||||||
|
// MARK: Initializers
|
||||||
|
|
||||||
|
/// Initializes this transport with a response handler.
|
||||||
|
init(handler: @escaping Handler) {
|
||||||
|
self.handler = handler
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Initializes this transport with a fixed response.
|
||||||
|
init(status: HTTPResponse.Status, json: String? = nil) {
|
||||||
|
self.init { _ in
|
||||||
|
Self.response(status: status, json: json)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
func send(
|
||||||
|
_ request: HTTPRequest,
|
||||||
|
body: HTTPBody?,
|
||||||
|
baseURL: URL,
|
||||||
|
operationID: String
|
||||||
|
) async throws -> (HTTPResponse, HTTPBody?) {
|
||||||
|
try handler(request)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Builds a response with a status and an optional JSON body.
|
||||||
|
static func response(
|
||||||
|
status: HTTPResponse.Status,
|
||||||
|
json: String? = nil
|
||||||
|
) -> (HTTPResponse, HTTPBody?) {
|
||||||
|
guard let json else {
|
||||||
|
return (.init(status: status), nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
.init(status: status, headerFields: [.contentType: "application/json"]),
|
||||||
|
.init(json)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
//
|
||||||
|
// This source file is part of the Amiibo Service open source project
|
||||||
|
//
|
||||||
|
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||||
|
// Licensed under Apache license v2.0
|
||||||
|
//
|
||||||
|
// See LICENSE for license information
|
||||||
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// ===----------------------------------------------------------------------===
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import HTTPTypes
|
||||||
|
import OpenAPIRuntime
|
||||||
|
|
||||||
|
/// A transport that throws a given error instead of sending the request, for testing purposes.
|
||||||
|
///
|
||||||
|
/// The error reaches the live client wrapped in a `ClientError`, as it would from a real transport.
|
||||||
|
struct ThrowingTransport: ClientTransport {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// The error to throw.
|
||||||
|
private let error: any Error
|
||||||
|
|
||||||
|
// MARK: Initializers
|
||||||
|
|
||||||
|
/// Initializes this transport.
|
||||||
|
/// - Parameter error: An error to throw.
|
||||||
|
init(error: any Error) {
|
||||||
|
self.error = error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
func send(
|
||||||
|
_ request: HTTPRequest,
|
||||||
|
body: HTTPBody?,
|
||||||
|
baseURL: URL,
|
||||||
|
operationID: String
|
||||||
|
) async throws -> (HTTPResponse, HTTPBody?) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,217 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===
|
|
||||||
//
|
|
||||||
// This source file is part of the AmiiboService open source project
|
|
||||||
//
|
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
|
||||||
// Licensed under the EUPL 1.2 or later.
|
|
||||||
//
|
|
||||||
// See LICENSE for license information
|
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===
|
|
||||||
|
|
||||||
import AmiiboService
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
/// A type that implements a mock client, for testing purposes.
|
|
||||||
struct AmiiboMockClient {
|
|
||||||
|
|
||||||
// MARK: Properties
|
|
||||||
|
|
||||||
/// A list of amiibo items to return, if any.
|
|
||||||
private let amiibos: [Amiibo]?
|
|
||||||
|
|
||||||
/// A list of amiibo series to return, if any.
|
|
||||||
private let amiiboSeries: [AmiiboSeries]?
|
|
||||||
|
|
||||||
/// A list of amiibo types to return, if any.
|
|
||||||
private let amiiboTypes: [AmiiboType]?
|
|
||||||
|
|
||||||
/// An error to throw, if any.
|
|
||||||
private let error: AmiiboServiceError?
|
|
||||||
|
|
||||||
/// A list of game characters to return, if any.
|
|
||||||
private let gameCharacters: [GameCharacter]?
|
|
||||||
|
|
||||||
/// A list of game series to return, if any.
|
|
||||||
private let gameSeries: [GameSeries]?
|
|
||||||
|
|
||||||
/// A last updated date to return, if any.
|
|
||||||
private let lastUpdated: Date?
|
|
||||||
|
|
||||||
// MARK: Initializers
|
|
||||||
|
|
||||||
/// Initializes this client.
|
|
||||||
/// - Parameters:
|
|
||||||
/// - amiibos: A list of amiibo items to return, if any.
|
|
||||||
/// - amiiboSeries: A list of amiibo series to return, if any.
|
|
||||||
/// - amiiboTypes: A list of amiibo types to return, if any.
|
|
||||||
/// - gameCharacters: A list of game characters to return, if any.
|
|
||||||
/// - gameSeries: A list of game series to return, if any.
|
|
||||||
/// - lastUpdated: A last updated date to return, if any.
|
|
||||||
/// - error: An error to throw, if any.
|
|
||||||
init(
|
|
||||||
amiibos: [Amiibo]? = nil,
|
|
||||||
amiiboSeries: [AmiiboSeries]? = nil,
|
|
||||||
amiiboTypes: [AmiiboType]? = nil,
|
|
||||||
gameCharacters: [GameCharacter]? = nil,
|
|
||||||
gameSeries: [GameSeries]? = nil,
|
|
||||||
lastUpdated: Date? = nil,
|
|
||||||
error: AmiiboServiceError? = nil
|
|
||||||
) {
|
|
||||||
self.amiibos = amiibos
|
|
||||||
self.amiiboSeries = amiiboSeries
|
|
||||||
self.amiiboTypes = amiiboTypes
|
|
||||||
self.error = error
|
|
||||||
self.gameCharacters = gameCharacters
|
|
||||||
self.gameSeries = gameSeries
|
|
||||||
self.lastUpdated = lastUpdated
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - AmiiboClient
|
|
||||||
|
|
||||||
extension AmiiboMockClient: AmiiboClient {
|
|
||||||
|
|
||||||
// MARK: Functions
|
|
||||||
|
|
||||||
#if swift(>=6.0)
|
|
||||||
func getAmiibos(by filter: AmiiboFilter) async throws(AmiiboServiceError) -> [Amiibo] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let amiibos else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return amiibos
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws(AmiiboServiceError) -> [AmiiboSeries] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let amiiboSeries else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return amiiboSeries
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws(AmiiboServiceError) -> [AmiiboType] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let amiiboTypes else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return amiiboTypes
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGameCharacters(by filter: GameCharacterFilter) async throws(AmiiboServiceError) -> [GameCharacter] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let gameCharacters else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return gameCharacters
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGameSeries(by filter: GameSeriesFilter) async throws(AmiiboServiceError) -> [GameSeries] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let gameSeries else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return gameSeries
|
|
||||||
}
|
|
||||||
|
|
||||||
func getLastUpdated() async throws(AmiiboServiceError) -> Date {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let lastUpdated else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return lastUpdated
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
func getAmiibos(by filter: AmiiboFilter) async throws -> [Amiibo] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let amiibos else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return amiibos
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws -> [AmiiboSeries] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let amiiboSeries else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return amiiboSeries
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws -> [AmiiboType] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let amiiboTypes else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return amiiboTypes
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGameCharacters(by filter: GameCharacterFilter) async throws -> [GameCharacter] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let gameCharacters else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return gameCharacters
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGameSeries(by filter: GameSeriesFilter) async throws -> [GameSeries] {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let gameSeries else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return gameSeries
|
|
||||||
}
|
|
||||||
|
|
||||||
func getLastUpdated() async throws -> Date {
|
|
||||||
try throwErrorIfExists()
|
|
||||||
|
|
||||||
guard let lastUpdated else {
|
|
||||||
throw AmiiboServiceError.notFound
|
|
||||||
}
|
|
||||||
|
|
||||||
return lastUpdated
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Helpers
|
|
||||||
|
|
||||||
private extension AmiiboMockClient {
|
|
||||||
|
|
||||||
// MARK: Functions
|
|
||||||
|
|
||||||
/// Throws an error if it has been provided,
|
|
||||||
/// - Throws: An ``AmiiboServiceError`` error in case an error has been provided.
|
|
||||||
func throwErrorIfExists() throws(AmiiboServiceError) {
|
|
||||||
if let error {
|
|
||||||
throw error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===
|
|
||||||
//
|
|
||||||
// This source file is part of the AmiiboService open source project
|
|
||||||
//
|
|
||||||
// Copyright (c) 2024-2025 Röck+Cöde VoF. and the AmiiboAPI project authors
|
|
||||||
// Licensed under the EUPL 1.2 or later.
|
|
||||||
//
|
|
||||||
// See LICENSE for license information
|
|
||||||
// See CONTRIBUTORS for the list of AmiiboAPI project authors
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===
|
|
||||||
|
|
||||||
import Testing
|
|
||||||
|
|
||||||
extension Tag {
|
|
||||||
|
|
||||||
// MARK: Properties
|
|
||||||
|
|
||||||
/// Tag that indicates tests against a live backend service.
|
|
||||||
@Tag static var live: Self
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*!
|
|
||||||
* This source file is part of the Swift.org open source project
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
||||||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
|
||||||
*
|
|
||||||
* See https://swift.org/LICENSE.txt for license information
|
|
||||||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
|
||||||
*/aside[data-v-3ccce809]{-moz-column-break-inside:avoid;break-inside:avoid;border-radius:var(--aside-border-radius,var(--border-radius,4px));border-style:var(--aside-border-style,solid);border-width:var(--aside-border-width,0 0 0 6px);padding:.9411764706rem;text-align:start}aside .label[data-v-3ccce809]{font-size:1rem;line-height:1.5294117647;font-weight:600;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif)}aside .label+[data-v-3ccce809]{margin-top:var(--spacing-stacked-margin-small)}aside.deprecated[data-v-3ccce809]{background-color:var(--color-aside-deprecated-background);border-color:var(--color-aside-deprecated-border);box-shadow:0 0 0 0 var(--color-aside-deprecated-border) inset,0 0 0 0 var(--color-aside-deprecated-border)}aside.deprecated .label[data-v-3ccce809]{color:var(--color-aside-deprecated)}aside.experiment[data-v-3ccce809]{background-color:var(--color-aside-experiment-background);border-color:var(--color-aside-experiment-border);box-shadow:0 0 0 0 var(--color-aside-experiment-border) inset,0 0 0 0 var(--color-aside-experiment-border)}aside.experiment .label[data-v-3ccce809]{color:var(--color-aside-experiment)}aside.important[data-v-3ccce809]{background-color:var(--color-aside-important-background);border-color:var(--color-aside-important-border);box-shadow:0 0 0 0 var(--color-aside-important-border) inset,0 0 0 0 var(--color-aside-important-border)}aside.important .label[data-v-3ccce809]{color:var(--color-aside-important)}aside.note[data-v-3ccce809]{background-color:var(--color-aside-note-background);border-color:var(--color-aside-note-border);box-shadow:0 0 0 0 var(--color-aside-note-border) inset,0 0 0 0 var(--color-aside-note-border)}aside.note .label[data-v-3ccce809]{color:var(--color-aside-note)}aside.tip[data-v-3ccce809]{background-color:var(--color-aside-tip-background);border-color:var(--color-aside-tip-border);box-shadow:0 0 0 0 var(--color-aside-tip-border) inset,0 0 0 0 var(--color-aside-tip-border)}aside.tip .label[data-v-3ccce809]{color:var(--color-aside-tip)}aside.warning[data-v-3ccce809]{background-color:var(--color-aside-warning-background);border-color:var(--color-aside-warning-border);box-shadow:0 0 0 0 var(--color-aside-warning-border) inset,0 0 0 0 var(--color-aside-warning-border)}aside.warning .label[data-v-3ccce809]{color:var(--color-aside-warning)}code[data-v-08295b2f]:before{content:attr(data-before-code)}code[data-v-08295b2f]:after{content:attr(data-after-code)}code[data-v-08295b2f]:after,code[data-v-08295b2f]:before{display:block;position:absolute;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(0 0 99.9% 99.9%);clip-path:inset(0 0 99.9% 99.9%);overflow:hidden;height:1px;width:1px;padding:0;border:0}.swift-file-icon.file-icon[data-v-c01a6890]{height:1rem}.file-icon[data-v-7c381064]{position:relative;align-items:flex-end;height:24px;margin:0 .5rem 0 1rem}.filename[data-v-c8c40662]{color:var(--text,var(--colors-secondary-label,var(--color-secondary-label)));font-size:.9411764706rem;line-height:1.1875;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);margin-top:1rem}@media only screen and (max-width:735px){.filename[data-v-c8c40662]{font-size:.8235294118rem;line-height:1.4285714286;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);margin-top:0}}.filename>a[data-v-c8c40662],.filename>span[data-v-c8c40662]{display:flex;align-items:center;line-height:normal}a[data-v-c8c40662]{color:var(--url,var(--color-link))}.code-line-container[data-v-13e6923e]{display:inline-block;width:100%;box-sizing:border-box}.code-number[data-v-13e6923e]{display:inline-block;padding:0 1rem 0 8px;text-align:right;min-width:2em;color:#666;-webkit-user-select:none;-moz-user-select:none;user-select:none}.code-number[data-v-13e6923e]:before{content:attr(data-line-number)}.highlighted[data-v-13e6923e]{background:var(--line-highlight,var(--color-code-line-highlight));border-left:4px solid var(--color-code-line-highlight-border)}.highlighted .code-number[data-v-13e6923e]{padding-left:4px}pre[data-v-13e6923e]{padding:14px 0;display:flex;overflow:unset;-webkit-overflow-scrolling:touch;white-space:pre;word-wrap:normal;height:100%;-moz-tab-size:var(--code-indentationWidth,4);-o-tab-size:var(--code-indentationWidth,4);tab-size:var(--code-indentationWidth,4)}@media only screen and (max-width:735px){pre[data-v-13e6923e]{padding-top:.8235294118rem}}code[data-v-13e6923e]{white-space:pre;word-wrap:normal;flex-grow:9999}.code-listing[data-v-13e6923e],.container-general[data-v-13e6923e]{display:flex}.code-listing[data-v-13e6923e]{flex-direction:column;border-radius:var(--code-border-radius,var(--border-radius,4px));overflow:hidden;filter:blur(0)}.code-listing.single-line[data-v-13e6923e]{border-radius:var(--border-radius,4px)}.container-general[data-v-13e6923e]{overflow:auto}.container-general[data-v-13e6923e],pre[data-v-13e6923e]{flex-grow:1}.header-anchor[data-v-0d0d1Line truncated
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*!
|
|
||||||
* This source file is part of the Swift.org open source project
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
||||||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
|
||||||
*
|
|
||||||
* See https://swift.org/LICENSE.txt for license information
|
|
||||||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
|
||||||
*/.badge[data-v-04624022]{--badge-color:var(--color-badge-default);--badge-dark-color:var(--color-badge-dark-default);font-size:.7058823529rem;line-height:1.3333333333;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);display:inline-block;padding:2px 4px;white-space:nowrap;border-radius:var(--badge-border-radius,1px);border-style:var(--badge-border-style,none);border-width:var(--badge-border-width,1px);margin:auto;margin-left:5px;color:var(--colors-badge-text,var(--color-badge-text));background-color:var(--badge-color)}@media screen{[data-color-scheme=dark] .badge[data-v-04624022]{background-color:var(--badge-dark-color)}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .badge[data-v-04624022]{background-color:var(--badge-dark-color)}}.badge-deprecated[data-v-04624022]{--badge-color:var(--color-badge-deprecated);--badge-dark-color:var(--color-badge-dark-deprecated)}.badge-beta[data-v-04624022]{--badge-color:var(--color-badge-beta);--badge-dark-color:var(--color-badge-dark-beta)}[data-v-3a32ffd0] .code-listing{background:var(--background,var(--color-code-background));color:var(--text,var(--color-code-plain));border-color:var(--colors-grid,var(--color-grid));border-width:var(--code-border-width,1px);border-style:var(--code-border-style,solid)}[data-v-3a32ffd0] .code-listing pre{padding:var(--code-block-style-elements-padding)}[data-v-3a32ffd0] .code-listing pre>code{font-size:.8823529412rem;line-height:1.6666666667;font-weight:400;font-family:var(--typography-html-font-mono,Menlo,monospace)}[data-v-3a32ffd0] *+.code-listing,[data-v-3a32ffd0] *+.endpoint-example,[data-v-3a32ffd0] *+.inline-image-container,[data-v-3a32ffd0] *+aside,[data-v-3a32ffd0] *+figure,[data-v-3a32ffd0] .code-listing+*,[data-v-3a32ffd0] .endpoint-example+*,[data-v-3a32ffd0] .inline-image-container+*,[data-v-3a32ffd0] aside+*,[data-v-3a32ffd0] figure+*{margin-top:var(--spacing-stacked-margin-xlarge)}[data-v-3a32ffd0] *+dl,[data-v-3a32ffd0] dl+*{margin-top:var(--spacing-stacked-margin-large)}[data-v-3a32ffd0] img{display:block;margin:auto;max-width:100%}[data-v-3a32ffd0] ol,[data-v-3a32ffd0] ol li:not(:first-child),[data-v-3a32ffd0] ul,[data-v-3a32ffd0] ul li:not(:first-child){margin-top:var(--spacing-stacked-margin-large)}@media only screen and (max-width:735px){[data-v-3a32ffd0] ol,[data-v-3a32ffd0] ul{margin-left:1.25rem}}[data-v-3a32ffd0] dt:not(:first-child){margin-top:var(--spacing-stacked-margin-large)}[data-v-3a32ffd0] dd{margin-left:2em}.topic-icon-wrapper[data-v-55f9d05d]{display:flex;align-items:center;justify-content:center;height:1.4705882353rem;flex:0 0 1.294rem;width:1.294rem;margin-right:1rem}.topic-icon[data-v-55f9d05d]{height:.8823529412rem;transform:scale(1);-webkit-transform:scale(1);overflow:visible}.topic-icon[data-v-55f9d05d] img{margin:0;display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.topic-icon.curly-brackets-icon[data-v-55f9d05d]{height:1rem}.token-method[data-v-295ad0ff]{font-weight:700}.token-keyword[data-v-295ad0ff]{color:var(--syntax-keyword,var(--color-syntax-keywords))}.token-number[data-v-295ad0ff]{color:var(--syntax-number,var(--color-syntax-numbers))}.token-string[data-v-295ad0ff]{color:var(--syntax-string,var(--color-syntax-strings))}.attribute-link[data-v-295ad0ff],.token-attribute[data-v-295ad0ff]{color:var(--syntax-attribute,var(--color-syntax-keywords))}.token-internalParam[data-v-295ad0ff]{color:var(--color-syntax-param-internal-name)}.type-identifier-link[data-v-295ad0ff]{color:var(--syntax-type,var(--color-syntax-other-type-names))}.token-removed[data-v-295ad0ff]{background-color:var(--color-highlight-red)}.token-added[data-v-295ad0ff]{background-color:var(--color-highlight-green)}.decorator[data-v-17c84f82],.label[data-v-17c84f82]{color:var(--colors-secondary-label,var(--color-secondary-label))}.label[data-v-17c84f82]{font-size:1rem;line-height:1.4705882353;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif)}.empty-token[data-v-17c84f82]{font-size:0}.empty-token[data-v-17c84f82]:after{content:" ";font-size:1rem}.abstract[data-v-0d9c6bcc],.link-block[data-v-0d9c6bcc] .badge{margin-left:2.294rem}.link-block .badge+.badge[data-v-0d9c6bcc]{margin-left:1rem}.link[data-v-0d9c6bcc]{display:flex}.link-block .badge[data-v-0d9c6bcc]{margin-top:.5rem}.link-block.has-inline-element[data-v-0d9c6bcc]{display:flex;align-items:flex-start;flex-flow:row wrap}.link-block.has-inline-element .badge[data-v-0d9c6bcc]{margin-left:1rem;margin-top:0}.link-block .has-adjacent-elements[data-v-0d9c6bcc]{padding-top:5px;padding-bottom:5px;display:inline-flex}.link-block[data-v-0d9c6bcc],.link[data-v-0d9c6bcc]{box-sizing:inherit}.link-block.changed[data-v-0d9c6bcc],.link.changed[data-v-0d9c6bcc]{padding-right:1rem;padding-left:2.1764705882rem;padding-top:8px;padding-bottom:8px;display:inline-flex;width:100%;box-sizing:border-box}.link-block.changed.changed[data-v-0d9c6Line truncated
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*!
|
|
||||||
* This source file is part of the Swift.org open source project
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
||||||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
|
||||||
*
|
|
||||||
* See https://swift.org/LICENSE.txt for license information
|
|
||||||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
|
||||||
*/.betainfo[data-v-ba3b3cc0]{font-size:.9411764706rem;padding:3rem 0;background-color:var(--color-fill-secondary)}.full-width-container .betainfo-container[data-v-ba3b3cc0]{max-width:820px;margin-left:auto;margin-right:auto;padding-left:80px;padding-right:80px;box-sizing:border-box}@media print{.full-width-container .betainfo-container[data-v-ba3b3cc0]{padding-left:20px;padding-right:20px;max-width:none}}@media only screen and (min-width:1251px){.full-width-container .betainfo-container[data-v-ba3b3cc0]{max-width:980px}}@media only screen and (min-width:1500px){.full-width-container .betainfo-container[data-v-ba3b3cc0]{max-width:1080px}}@media only screen and (max-width:735px){.full-width-container .betainfo-container[data-v-ba3b3cc0]{width:auto;padding-left:20px;padding-right:20px}}.static-width-container .betainfo-container[data-v-ba3b3cc0]{margin-left:auto;margin-right:auto;width:1536px;width:980px}@media only screen and (max-width:1250px){.static-width-container .betainfo-container[data-v-ba3b3cc0]{width:692px}}@media only screen and (max-width:735px){.static-width-container .betainfo-container[data-v-ba3b3cc0]{width:87.5%}}@media only screen and (max-width:320px){.static-width-container .betainfo-container[data-v-ba3b3cc0]{width:215px}}.betainfo-label[data-v-ba3b3cc0]{font-weight:600;font-size:.9411764706rem}.betainfo-content[data-v-ba3b3cc0] p{margin-bottom:10px}a[data-v-2ca5e993]{text-decoration:underline;color:inherit;font-weight:600}.summary-section[data-v-3aa6f694]:last-of-type{margin-right:0}@media only screen and (max-width:735px){.summary-section[data-v-3aa6f694]{margin-right:0}}.title[data-v-246c819c]{color:var(--colors-text,var(--color-text));font-size:.8235294118rem;margin-right:.5rem;text-rendering:optimizeLegibility}.language[data-v-0e39c0ba]{padding-bottom:10px;justify-content:flex-end}.language-list[data-v-0e39c0ba],.language[data-v-0e39c0ba]{font-size:.8235294118rem;line-height:1.4285714286;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);margin-top:0;display:flex;align-items:center}.language-option.swift[data-v-0e39c0ba]{padding-right:10px;border-right:1px solid var(--colors-secondary-label,var(--color-secondary-label))}.language-option.objc[data-v-0e39c0ba]{padding-left:10px}.view-more-link[data-v-3f54e653]{font-size:.8235294118rem;line-height:1.2857142857;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);display:flex;flex-flow:row-reverse;margin-bottom:1.3rem}.documentation-hero[data-v-283b44ff]{color:var(--color-documentation-intro-figure,var(--color-figure-gray));overflow:hidden;text-align:left;position:relative;padding-right:var(--doc-hero-right-offset)}.documentation-hero[data-v-283b44ff]:before{content:"";background:var(--standard-accent-color,var(--color-documentation-intro-fill,var(--color-fill-tertiary)));position:absolute;width:100%;height:100%}.documentation-hero[data-v-283b44ff]:after{background:transparent;opacity:.85;width:100%;position:absolute;content:"";height:100%;left:0;top:0}@media screen{[data-color-scheme=dark] .documentation-hero[data-v-283b44ff]:after{opacity:.55}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .documentation-hero[data-v-283b44ff]:after{opacity:.55}}.documentation-hero .icon[data-v-283b44ff]{position:absolute;margin-top:10px;margin-right:25px;right:0;width:250px;height:calc(100% - 20px);box-sizing:border-box}@media only screen and (max-width:735px){.documentation-hero .icon[data-v-283b44ff]{display:none}}.documentation-hero .background-icon[data-v-283b44ff]{color:var(--color-documentation-intro-accent,var(--color-figure-gray-secondary));display:block;width:250px;height:auto;opacity:.15;mix-blend-mode:normal;position:absolute;top:50%;left:0;transform:translateY(-50%);max-height:100%}.documentation-hero .background-icon[data-v-283b44ff] img,.documentation-hero .background-icon[data-v-283b44ff] svg{width:100%;height:100%}@media screen{[data-color-scheme=dark] .documentation-hero .background-icon[data-v-283b44ff]{mix-blend-mode:normal;opacity:.15}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .documentation-hero .background-icon[data-v-283b44ff]{mix-blend-mode:normal;opacity:.15}}.documentation-hero__content[data-v-283b44ff]:not(.minimized-hero){padding-top:2.3529411765rem;padding-bottom:2.3529411765rem;position:relative;z-index:1}.full-width-container .documentation-hero__content[data-v-283b44ff]:not(.minimized-hero){max-width:820px;margin-left:auto;margin-right:auto;padding-left:80px;padding-right:80px;box-sizing:border-box}@media print{.full-width-container .documentation-hero__content[data-v-283b44ff]:not(.minimized-hero){padding-left:20px;padding-right:20px;max-width:none}}@media only screen and (min-width:1251px){.full-width-container .documentation-hero__content[data-v-283b44ff]:not(.minimized-hero){max-width:980px}}@media only screen and (min-width:1500px){.full-width-container .documLine truncated
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*!
|
|
||||||
* This source file is part of the Swift.org open source project
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
||||||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
|
||||||
*
|
|
||||||
* See https://swift.org/LICENSE.txt for license information
|
|
||||||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
|
||||||
*/.color-scheme-toggle[data-v-0c0360ce]{--toggle-color-fill:var(--color-button-background);--toggle-color-text:var(--color-fill-blue);font-size:.7058823529rem;line-height:1.3333333333;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);border:1px solid var(--toggle-color-fill);border-radius:var(--toggle-border-radius-outer,var(--border-radius,4px));display:inline-flex;padding:1px}@media screen{[data-color-scheme=dark] .color-scheme-toggle[data-v-0c0360ce]{--toggle-color-text:var(--color-figure-blue)}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .color-scheme-toggle[data-v-0c0360ce]{--toggle-color-text:var(--color-figure-blue)}}@media print{.color-scheme-toggle[data-v-0c0360ce]{display:none}}:root.no-js .color-scheme-toggle[data-v-0c0360ce]{visibility:hidden}input[data-v-0c0360ce]{position:absolute;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(0 0 99.9% 99.9%);clip-path:inset(0 0 99.9% 99.9%);overflow:hidden;height:1px;width:1px;padding:0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.fromkeyboard label[data-v-0c0360ce]:focus-within{outline:4px solid var(--color-focus-color);outline-offset:1px}.text[data-v-0c0360ce]{border:1px solid transparent;border-radius:var(--toggle-border-radius-inner,2px);color:var(--toggle-color-text);display:inline-block;text-align:center;padding:1px 6px;min-width:42px;box-sizing:border-box}.text[data-v-0c0360ce]:hover{cursor:pointer}input:checked+.text[data-v-0c0360ce]{--toggle-color-text:var(--color-button-text);background:var(--toggle-color-fill);border-color:var(--toggle-color-fill)}.footer[data-v-f1d65b2a]{border-top:1px solid var(--color-grid)}.row[data-v-f1d65b2a]{margin-left:auto;margin-right:auto;width:1536px;width:980px;display:flex;flex-direction:row-reverse;margin:20px auto}@media only screen and (max-width:1250px){.row[data-v-f1d65b2a]{width:692px}}@media only screen and (max-width:735px){.row[data-v-f1d65b2a]{width:87.5%}}@media only screen and (max-width:320px){.row[data-v-f1d65b2a]{width:215px}}@media only screen and (max-width:735px){.row[data-v-f1d65b2a]{width:100%;padding:0 .9411764706rem;box-sizing:border-box}}.InitialLoadingPlaceholder[data-v-35c356b6]{background:var(--colors-loading-placeholder-background,var(--color-loading-placeholder-background));height:100vh;width:100%}.svg-icon[data-v-06e5463e]{fill:var(--colors-svg-icon-fill-light,var(--color-svg-icon));transform:scale(1);-webkit-transform:scale(1);overflow:visible}.theme-dark .svg-icon[data-v-06e5463e]{fill:var(--colors-svg-icon-fill-dark,var(--color-svg-icon))}@media screen{[data-color-scheme=dark] .svg-icon[data-v-06e5463e]{fill:var(--colors-svg-icon-fill-dark,var(--color-svg-icon))}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto] .svg-icon[data-v-06e5463e]{fill:var(--colors-svg-icon-fill-dark,var(--color-svg-icon))}}.svg-icon.icon-inline[data-v-06e5463e]{display:inline-block;vertical-align:middle;fill:currentColor}.svg-icon.icon-inline[data-v-06e5463e] .svg-icon-stroke{stroke:currentColor}[data-v-06e5463e] .svg-icon-stroke{stroke:var(--colors-svg-icon-fill-light,var(--color-svg-icon))}.theme-dark[data-v-06e5463e] .svg-icon-stroke{stroke:var(--colors-svg-icon-fill-dark,var(--color-svg-icon))}@media screen{[data-color-scheme=dark][data-v-06e5463e] .svg-icon-stroke{stroke:var(--colors-svg-icon-fill-dark,var(--color-svg-icon))}}@media screen and (prefers-color-scheme:dark){[data-color-scheme=auto][data-v-06e5463e] .svg-icon-stroke{stroke:var(--colors-svg-icon-fill-dark,var(--color-svg-icon))}}.suggest-lang[data-v-c2dca0ae]{background:#000;color:#fff;display:flex;justify-content:center;border-bottom:1px solid var(--color-grid)}.suggest-lang__wrapper[data-v-c2dca0ae]{display:flex;align-items:center;width:100%;max-width:var(--wrapper-max-width,1920px);margin:0 .9411764706rem;position:relative;height:52px}.suggest-lang__link[data-v-c2dca0ae]{font-size:.8235294118rem;line-height:1.4285714286;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);margin:0 auto;color:#09f}.suggest-lang__close-icon-wrapper[data-v-c2dca0ae]{position:absolute;right:-.2352941176rem;top:0;height:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1}.suggest-lang__close-icon-button[data-v-c2dca0ae]{padding:.2352941176rem}.suggest-lang__close-icon-button .close-icon[data-v-c2dca0ae]{width:8px;display:block}.suggest-lang .inline-chevron-right-icon[data-v-c2dca0ae]{padding-left:.2352941176rem;width:8px}select[data-v-d21858a2]{font-size:.7058823529rem;line-height:1.3333333333;font-weight:600;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);color:var(--color-fill-blue);padding-right:15px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;cursor:pointer}select[data-v-d21858a2]:hover{text-decoration:underline}.locale-selector[data-v-d21858a2]{position:relative}.svg-iLine truncated
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*!
|
|
||||||
* This source file is part of the Swift.org open source project
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
||||||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
|
||||||
*
|
|
||||||
* See https://swift.org/LICENSE.txt for license information
|
|
||||||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
|
||||||
*/.nav-title-content[data-v-854b4dd6]{max-width:100%}.title[data-v-854b4dd6]{color:var(--color-nav-root-title,currentColor);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:inline-block;vertical-align:top;max-width:296px}@media only screen and (max-width:1023px){.title[data-v-854b4dd6]{max-width:205px}}@media only screen and (max-width:767px){.title[data-v-854b4dd6]{flex-basis:fill;display:initial;vertical-align:initial;max-width:none}}.subhead[data-v-854b4dd6]{color:var(--color-nav-root-subhead)}.theme-dark .subhead[data-v-854b4dd6]{color:var(--color-nav-dark-root-subhead)}.mobile-dropdown[data-v-2c27d339]{box-sizing:border-box}.nav--in-breakpoint-range .mobile-dropdown[data-v-2c27d339]{padding-left:.2352941176rem;padding-right:.2352941176rem}.mobile-dropdown ul[data-v-2c27d339]{list-style:none}.mobile-dropdown .option[data-v-2c27d339]{cursor:pointer;font-size:.7058823529rem;padding:.5rem 0;display:block;text-decoration:none;color:inherit}.mobile-dropdown .option[data-v-2c27d339]:focus{outline-offset:0}.mobile-dropdown .option.depth1[data-v-2c27d339]{padding-left:.4705882353rem}.active[data-v-2c27d339],.tutorial.router-link-active[data-v-2c27d339]{font-weight:600}.active[data-v-2c27d339]:focus,.tutorial.router-link-active[data-v-2c27d339]:focus{outline:none}.chapter-list[data-v-2c27d339]:not(:first-child){margin-top:1rem}.chapter-name[data-v-2c27d339],.tutorial[data-v-2c27d339]{padding:.5rem 0;font-size:1rem;line-height:1.4705882353;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif)}.section-list[data-v-2c27d339],.tutorial-list[data-v-2c27d339]{padding:0 .5882352941rem}.chapter-list:last-child .tutorial-list[data-v-2c27d339]:last-child{padding-bottom:10em}.chapter-list[data-v-2c27d339]{display:inline-block}.form-element[data-v-f934959a]{position:relative}.form-dropdown[data-v-f934959a]{font-size:1rem;line-height:1.2352941176;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);display:block;box-sizing:border-box;width:100%;height:3.3em;color:var(--color-dropdown-text);padding:1.1176470588rem 2.3529411765rem 0 .9411764706rem;text-align:left;border:1px solid var(--color-dropdown-border);border-radius:var(--border-radius,4px);background-clip:padding-box;margin-bottom:.8235294118rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;min-height:32px}.form-dropdown[data-v-f934959a]:focus{box-shadow:0 0 0 4px var(--color-focus-color);outline:none;border-color:var(--color-focus-border-color)}.form-dropdown.no-eyebrow[data-v-f934959a]{padding-top:0}.form-dropdown[data-v-f934959a]:-moz-focusring{color:transparent;text-shadow:0 0 0 var(--color-dropdown-text)}.form-dropdown[data-v-f934959a]::-ms-expand{opacity:0}.form-dropdown~.form-icon[data-v-f934959a]{position:absolute;display:block;pointer-events:none;fill:var(--color-figure-gray-tertiary);right:14px;width:13px;height:auto;top:50%;transform:translateY(-50%)}.is-open .form-dropdown~.form-icon[data-v-f934959a]{transform:translateY(-50%) scale(-1)}@media only screen and (max-width:735px){.form-dropdown~.form-icon[data-v-f934959a]{right:14px}}.form-dropdown~.form-label[data-v-f934959a]{font-size:.7058823529rem;line-height:1.75;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);position:absolute;top:.4705882353rem;left:17px;color:var(--color-figure-gray-secondary);pointer-events:none;padding:0;z-index:1}.form-dropdown[data-v-f934959a] option{color:var(--color-dropdown-text)}.form-dropdown-selectnone[data-v-f934959a]{color:transparent}.form-dropdown-selectnone~.form-label[data-v-f934959a]{font-size:1rem;line-height:1.2352941176;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif);top:19px;left:17px;color:var(--color-figure-gray-tertiary)}.form-dropdown-selectnone[data-v-f934959a]:-moz-focusring{text-shadow:none}.form-dropdown-selectnone[data-v-f934959a]::-ms-value{display:none}.theme-dark .form-dropdown[data-v-f934959a]{color:var(--color-dropdown-dark-text);background-color:var(--color-dropdown-dark-background);border-color:var(--color-dropdown-dark-border)}.theme-dark .form-dropdown~.form-label[data-v-f934959a]{color:#ccc}.theme-dark .form-dropdown[data-v-f934959a]:-moz-focusring{color:transparent;text-shadow:0 0 0 var(--color-dropdown-dark-text)}.theme-dark .form-dropdown.form-dropdown-selectnone[data-v-f934959a]{color:transparent}.theme-dark .form-dropdown.form-dropdown-selectnone[data-v-f934959a]:-moz-focusring{text-shadow:none}.theme-dark .form-dropdown-selectnone~.form-label[data-v-f934959a]{color:#b0b0b0}.dropdown-small[data-v-6adda760]{height:30px;display:flex;align-items:center;position:relative;background:var(--color-fill)}.dropdown-small .form-dropdown-toggle[data-v-6adda760]{line-height:1.5;font-size:12px;padding-top:0;padding-bottom:0;padding-left:20px;min-height:unseLine truncated
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*!
|
|
||||||
* This source file is part of the Swift.org open source project
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
||||||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
|
||||||
*
|
|
||||||
* See https://swift.org/LICENSE.txt for license information
|
|
||||||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
|
||||||
*/.tutorials-navigation-link[data-v-e9f9b59c]{color:var(--color-tutorials-overview-navigation-link);transition:color .3s linear}.tutorials-navigation-link[data-v-e9f9b59c]:hover{text-decoration:none;transition:none;color:var(--color-tutorials-overview-navigation-link-hover)}.tutorials-navigation-link.active[data-v-e9f9b59c]{color:var(--color-tutorials-overview-navigation-link-active)}.tutorials-navigation-list[data-v-4e0180fa]{list-style-type:none;margin:0}.tutorials-navigation-list li+li[data-v-4e0180fa]:not(.volume--named){margin-top:24px}.tutorials-navigation-list .volume--named+.volume--named[data-v-4e0180fa]{margin-top:12px}.expand-enter-active,.expand-leave-active{transition:height .3s ease-in-out;overflow:hidden}.expand-enter,.expand-leave-to{height:0}.toggle[data-v-489416f8]{color:#f0f0f0;line-height:21px;display:flex;align-items:center;width:100%;font-weight:600;padding:6px 6px 6px 0;border-bottom:1px solid #2a2a2a;text-decoration:none;box-sizing:border-box}@media only screen and (max-width:767px){.toggle[data-v-489416f8]{padding-right:6px;border-bottom-color:hsla(0,0%,100%,.1)}}.toggle .text[data-v-489416f8]{word-break:break-word}.toggle[data-v-489416f8]:hover{text-decoration:none}.toggle .toggle-icon[data-v-489416f8]{display:inline-block;transition:transform .2s ease-in;height:.4em;width:.4em;margin-left:auto;margin-right:.2em}.collapsed .toggle .toggle-icon[data-v-489416f8]{transform:rotate(45deg)}.collapsed .toggle[data-v-489416f8],.collapsed .toggle[data-v-489416f8]:hover{color:#b0b0b0}.tutorials-navigation-menu-content[data-v-489416f8]{opacity:1;transition:height .2s ease-in,opacity .2s ease-in}.collapsed .tutorials-navigation-menu-content[data-v-489416f8]{height:0;opacity:0}.tutorials-navigation-menu-content .tutorials-navigation-list[data-v-489416f8]{padding:24px 0 12px 0}.tutorials-navigation[data-v-79093ed6]{font-size:1rem;line-height:1.2352941176;font-weight:400;font-family:var(--typography-html-font,"Helvetica Neue","Helvetica","Arial",sans-serif)}.nav-title-content[data-v-854b4dd6]{max-width:100%}.title[data-v-854b4dd6]{color:var(--color-nav-root-title,currentColor);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:inline-block;vertical-align:top;max-width:296px}@media only screen and (max-width:1023px){.title[data-v-854b4dd6]{max-width:205px}}@media only screen and (max-width:767px){.title[data-v-854b4dd6]{flex-basis:fill;display:initial;vertical-align:initial;max-width:none}}.subhead[data-v-854b4dd6]{color:var(--color-nav-root-subhead)}.theme-dark .subhead[data-v-854b4dd6]{color:var(--color-nav-dark-root-subhead)}.nav[data-v-54bcce6d] .nav-menu{padding-top:0}.nav[data-v-54bcce6d] .nav-menu .nav-menu-items{margin-left:auto}@media only screen and (min-width:768px){.nav[data-v-54bcce6d] .nav-menu .nav-menu-items .in-page-navigation{display:none}}@media only screen and (min-width:320px)and (max-width:735px){.nav[data-v-54bcce6d] .nav-menu .nav-menu-items{padding:18px 0 40px}}.hero[data-v-400ffab5]{margin-left:auto;margin-right:auto;width:1536px;width:980px;padding-bottom:4.7058823529rem;padding-top:4.7058823529rem}@media only screen and (max-width:1250px){.hero[data-v-400ffab5]{width:692px}}@media only screen and (max-width:735px){.hero[data-v-400ffab5]{width:87.5%}}@media only screen and (max-width:320px){.hero[data-v-400ffab5]{width:215px}}@media screen{.hero[data-v-400ffab5]{--color-fill:#fff;--color-fill-secondary:#f7f7f7;--color-fill-tertiary:#f0f0f0;--color-fill-quaternary:#282828;--color-fill-blue:#00f;--color-fill-light-blue-secondary:#d1d1ff;--color-fill-gray:#ccc;--color-fill-gray-secondary:#f5f5f5;--color-fill-gray-tertiary:#f0f0f0;--color-fill-gray-quaternary:#f0f0f0;--color-fill-green-secondary:#f0fff0;--color-fill-orange-secondary:#fffaf6;--color-fill-red-secondary:#fff0f5;--color-figure-blue:#36f;--color-figure-gray:#000;--color-figure-gray-secondary:#666;--color-figure-gray-secondary-alt:#666;--color-figure-gray-tertiary:#666;--color-figure-green:green;--color-figure-light-gray:#666;--color-figure-orange:#c30;--color-figure-red:red;--color-tutorials-teal:#000;--color-article-background:var(--color-fill-tertiary);--color-article-body-background:var(--color-fill);--color-aside-deprecated:var(--color-figure-gray);--color-aside-deprecated-background:var(--color-fill-orange-secondary);--color-aside-deprecated-border:var(--color-figure-orange);--color-aside-experiment:var(--color-figure-gray);--color-aside-experiment-background:var(--color-fill-gray-secondary);--color-aside-experiment-border:var(--color-figure-light-gray);--color-aside-important:var(--color-figure-gray);--color-aside-important-background:var(--color-fill-gray-secondary);--color-aside-important-border:var(--color-figure-light-gray);--color-aside-note:var(--color-figure-gray);--color-aside-note-background:var(--color-fill-gray-secondary);--color-aside-note-border:var(--color-figure-light-gray);--color-aside-tip:var(--color-figure-gray);--color-aside-tip-background:var(--color-fill-gray-secondaryLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"content","content":[{"type":"heading","level":2,"text":"Overview","anchor":"Overview"},{"inlineContent":[{"text":"The ","type":"text"},{"type":"codeVoice","code":"AmiiboService"},{"text":" library is a Swift Package Manager package dependency aims at allowing the developer to interact with the ","type":"text"},{"identifier":"https:\/\/www.amiiboapi.com","isActive":true,"type":"reference"},{"text":" backend service seamlessly, by not only providing the ","type":"text"},{"inlineContent":[{"type":"text","text":"service"}],"type":"emphasis"},{"text":" type but also any possible ","type":"text"},{"inlineContent":[{"type":"text","text":"clients"}],"type":"emphasis"},{"text":", ","type":"text"},{"inlineContent":[{"type":"text","text":"models"}],"type":"emphasis"},{"text":", ","type":"text"},{"inlineContent":[{"type":"text","text":"filters"}],"type":"emphasis"},{"text":" and ","type":"text"},{"inlineContent":[{"type":"text","text":"errors"}],"type":"emphasis"},{"text":" types that might be needed during implementation.","type":"text"}],"type":"paragraph"},{"type":"heading","level":2,"text":"Design","anchor":"Design"},{"inlineContent":[{"text":"Although it could have been possible to generate a one-to-one RESTful client based on the Open API specification document that describe the available endpoints of the backend service, it was decided to design a ","type":"text"},{"type":"codeVoice","code":"AmiiboService"},{"text":" service type that removes the complexities of the API design imposed by the backend service, and provides the developer with a simple interface, and a seamless experience.","type":"text"}],"type":"paragraph"},{"type":"heading","level":2,"text":"Installation","anchor":"Installation"},{"inlineContent":[{"text":"To use the ","type":"text"},{"type":"codeVoice","code":"AmiiboService"},{"text":" library with your package, then add it as a dependency in the ","type":"text"},{"type":"codeVoice","code":"Package.swift"},{"text":" file:","type":"text"}],"type":"paragraph"},{"type":"codeListing","code":["let package = Package("," \/\/ name, platforms, products, etc."," dependencies: ["," .package(url: \"https:\/\/github.com\/rock-n-code\/amiibo-service\", from: \"1.0.0\"),"," \/\/ other dependencies"," ],"," targets: ["," .target("," name: \"SomeTarget\", "," dependencies: ["," .product(name: \"AmiiboService\", package: \"amiibo-service\"),"," ]"," )"," \/\/ other targets"," ]",")"],"syntax":"swift"},{"inlineContent":[{"text":"It is also possible to use the ","type":"text"},{"type":"codeVoice","code":"AmiiboService"},{"text":" library with your app in Xcode, then add it as a dependency in your Xcode project.","type":"text"}],"type":"paragraph"},{"style":"important","type":"aside","content":[{"inlineContent":[{"type":"text","text":"Swift 5.10 or higher is required in order to compile this library."}],"type":"paragraph"}],"name":"Important"},{"type":"heading","level":2,"text":"Tasks","anchor":"Tasks"},{"inlineContent":[{"text":"This library offers a set of ready-to-use project management tasks that the developer could use from the command line. To show the list of tasks on the ","type":"text"},{"type":"codeVoice","code":"Terminal"},{"text":" app, plus display some explanations about each and every one of them; please enter the following command:","type":"text"}],"type":"paragraph"},{"type":"codeListing","code":["$ make"],"syntax":"bash"}]}],"schemaVersion":{"minor":3,"major":0,"patch":0},"hierarchy":{"paths":[[]]},"metadata":{"roleHeading":"Framework","modules":[{"name":"AmiiboService"}],"title":"AmiiboService","role":"collection","symbolKind":"module","externalID":"AmiiboService"},"abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"inlineContent":[{"text":"Amiibo API","type":"text"}],"type":"strong"},{"type":"text","text":" backend service."}],"kind":"symbol","sections":[],"topicSections":[{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboService"],"title":"Service","anchor":"Service"},{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboLiveClient"],"title":"Clients","anchor":"Clients"},{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","doc:\/\/AmiiboService\/documentation\Line truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"platforms":["macOS"],"languages":["swift"]}]}],"schemaVersion":{"patch":0,"major":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService"]]},"metadata":{"roleHeading":"Structure","title":"Amiibo","role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"externalID":"s:13AmiiboService0A0V","symbolKind":"struct","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"kind":"symbol","sections":[],"topicSections":[{"generated":true,"anchor":"Structures","title":"Structures","identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage"]},{"generated":true,"anchor":"Instance-Properties","title":"Instance Properties","identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameCharacter","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/head","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/identifier","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/image","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/imageURL","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/name","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/platform-swift.property","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/release-swift.property","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/series","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/tail","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/type"]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo"]}],"relationshipsSections":[{"type":"conformsTo","kind":"relationships","title":"Conforms To","identifiers":["doc:\/\/AmiiboService\/s8SendableP","doc:\/\/AmiiboService\/s16SendableMetatypeP"]}],"seeAlsoSections":[{"generated":true,"anchor":"Models","title":"Models","identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/name":{"kind":"symbol","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"name"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"type":"topic","abstract":[{"type":"text","text":"An amiibo name."}],"title":"name","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/name","url":"\/documentation\/amiiboservice\/amiibo\/name"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/s8SendableP":{"identifier":"doc:\/\/AmiiboService\/s8SendableP","type":"unresolvable","title":"Swift.Sendable"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/series":{"role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/series","title":"series","type":"topic","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"series","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"}],"kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/series","abstract":[{"type":"text","text":"An amiibo series."}]},"doc://AmiiboService/documentation/AmiiboService/GaLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"seeAlsoSections":[{"anchor":"Models","generated":true,"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries"],"title":"Models"}],"primaryContentSections":[{"declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}]}],"kind":"declarations"}],"sections":[],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","interfaceLanguage":"swift"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/game"]}],"topicSections":[{"anchor":"Instance-Properties","generated":true,"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/identifiers","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/name","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/usages"],"title":"Instance Properties"}],"kind":"symbol","metadata":{"navigatorTitle":[{"text":"Game","kind":"identifier"}],"roleHeading":"Structure","externalID":"s:13AmiiboService0A0V4GameV","modules":[{"name":"AmiiboService"}],"extendedModule":"AmiiboService","role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"symbolKind":"struct","title":"Amiibo.Game"},"relationshipsSections":[{"type":"conformsTo","kind":"relationships","identifiers":["doc:\/\/AmiiboService\/s8SendableP","doc:\/\/AmiiboService\/s16SendableMetatypeP"],"title":"Conforms To"}],"schemaVersion":{"major":0,"minor":3,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/identifiers":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/identifiers","url":"\/documentation\/amiiboservice\/amiibo\/game\/identifiers","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifiers","kind":"identifier"},{"text":": [","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"text":"]","kind":"text"}],"abstract":[{"type":"text","text":"A list of identifiers."}],"title":"identifiers"},"doc://AmiiboService/documentation/AmiiboService/AmiiboType":{"title":"AmiiboType","url":"\/documentation\/amiiboservice\/amiibotype","kind":"symbol","role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboType","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents an amiibo type."}],"navigatorTitle":[{"text":"AmiiboType","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"},"doc://AmiiboService/s8SendableP":{"identifier":"doc:\/\/AmiiboService\/s8SendableP","type":"unresolvable","title":"Swift.Sendable"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/name":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/name","url":"\/documentation\/amiiboservice\/amiibo\/game\/name","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"idLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/identifiers","interfaceLanguage":"swift"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/game\/identifiers"]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifiers","kind":"identifier"},{"text":": [","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"kind":"symbol","metadata":{"roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V4GameV11identifiersSaySSGvp","modules":[{"name":"AmiiboService"}],"role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifiers","kind":"identifier"},{"text":": [","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"text":"]","kind":"text"}],"symbolKind":"property","title":"identifiers"},"schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"]]},"abstract":[{"text":"A list of identifiers.","type":"text"}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/identifiers":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/identifiers","url":"\/documentation\/amiiboservice\/amiibo\/game\/identifiers","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifiers","kind":"identifier"},{"text":": [","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"},{"text":"]","kind":"text"}],"abstract":[{"type":"text","text":"A list of identifiers."}],"title":"identifiers"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"patch":0,"minor":3,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"]]},"metadata":{"roleHeading":"Instance Property","title":"name","role":"symbol","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"name"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"symbolKind":"property","externalID":"s:13AmiiboService0A0V4GameV4nameSSvp","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"A name."}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/game\/name"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/name"},"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/name":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/name","url":"\/documentation\/amiiboservice\/amiibo\/game\/name","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"abstract":[{"type":"text","text":"A name."}],"title":"name"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/usages"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/game\/usages"]}],"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"usages"},{"text":": [","kind":"text"},{"text":"Amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Usage","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V5UsageV"},{"text":"]?","kind":"text"}]}],"kind":"declarations"}],"kind":"symbol","metadata":{"roleHeading":"Instance Property","role":"symbol","modules":[{"name":"AmiiboService"}],"externalID":"s:13AmiiboService0A0V4GameV6usagesSayAC5UsageVGSgvp","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"usages"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Usage","preciseIdentifier":"s:13AmiiboService0A0V5UsageV"},{"kind":"text","text":"]?"}],"symbolKind":"property","title":"usages"},"schemaVersion":{"minor":3,"patch":0,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"]]},"abstract":[{"type":"text","text":"A list of amiibo usages, if any."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","navigatorTitle":[{"text":"Usage","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/usage","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents the usage of an amiibo item within a certain game."}],"title":"Amiibo.Usage"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/usages":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/usages","url":"\/documentation\/amiiboservice\/amiibo\/game\/usages","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"usages","kind":"identifier"},{"text":": [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Usage","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V5UsageV"},{"text":"]?","kind":"text"}],"abstract":[{"type":"text","text":"A list of amiibo usages, if any."}],"title":"usages"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V13gameCharacterSSvp","title":"gameCharacter","symbolKind":"property","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"gameCharacter","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameCharacter"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/gamecharacter"]}],"kind":"symbol","schemaVersion":{"minor":3,"major":0,"patch":0},"abstract":[{"type":"text","text":"A game character."}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"gameCharacter","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"platforms":["macOS"],"languages":["swift"]}]}],"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/gameCharacter":{"role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameCharacter","type":"topic","title":"gameCharacter","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"gameCharacter","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/gamecharacter","abstract":[{"type":"text","text":"A game character."}]},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"gameSeries"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"metadata":{"roleHeading":"Instance Property","title":"gameSeries","role":"symbol","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"gameSeries"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"externalID":"s:13AmiiboService0A0V10gameSeriesSSvp","symbolKind":"property","modules":[{"name":"AmiiboService"}]},"abstract":[{"text":"A game series.","type":"text"}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/gameseries"]}],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameSeries","interfaceLanguage":"swift"},"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/gameSeries":{"role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameSeries","title":"gameSeries","type":"topic","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"gameSeries","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/gameseries","abstract":[{"text":"A game series.","type":"text"}]},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"head"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"languages":["swift"]}]}],"schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"metadata":{"roleHeading":"Instance Property","title":"head","role":"symbol","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"head"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"externalID":"s:13AmiiboService0A0V4headSSvp","symbolKind":"property","modules":[{"name":"AmiiboService"}]},"abstract":[{"text":"The first 8 hexadecimal characters of an identifier.","type":"text"}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/head"]}],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/head","interfaceLanguage":"swift"},"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/head":{"type":"topic","title":"head","abstract":[{"type":"text","text":"The first 8 hexadecimal characters of an identifier."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/head","fragments":[{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"text":"head","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/head"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V10identifierSSvp","title":"identifier","symbolKind":"property","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifier","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/identifier"},"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/identifier"],"traits":[{"interfaceLanguage":"swift"}]}],"kind":"symbol","schemaVersion":{"patch":0,"minor":3,"major":0},"abstract":[{"text":"An identifier.","type":"text"}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":" { "},{"kind":"keyword","text":"get"},{"kind":"text","text":" }"}],"languages":["swift"]}],"kind":"declarations"}],"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/identifier":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/identifier","url":"\/documentation\/amiiboservice\/amiibo\/identifier","role":"symbol","kind":"symbol","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifier","kind":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"abstract":[{"type":"text","text":"An identifier."}],"title":"identifier"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"image","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"platforms":["macOS"],"languages":["swift"]}]}],"schemaVersion":{"minor":3,"major":0,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"metadata":{"roleHeading":"Instance Property","title":"image","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"image","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"symbolKind":"property","externalID":"s:13AmiiboService0A0V5imageSSvp","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"An image link."}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/image"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/image"},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/image":{"type":"topic","title":"image","abstract":[{"type":"text","text":"An image link."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/image","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"image","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/image"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"imageURL","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:10Foundation3URLV","text":"URL","kind":"typeIdentifier"},{"text":"? { ","kind":"text"},{"text":"get","kind":"keyword"},{"text":" }","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"schemaVersion":{"patch":0,"minor":3,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"metadata":{"roleHeading":"Instance Property","title":"imageURL","role":"symbol","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"imageURL","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:10Foundation3URLV","text":"URL","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"externalID":"s:13AmiiboService0A0V8imageURL10Foundation0D0VSgvp","symbolKind":"property","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"A URL related to an image link, if any."}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/imageurl"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/imageURL"},"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/imageURL":{"type":"topic","title":"imageURL","abstract":[{"type":"text","text":"A URL related to an image link, if any."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/imageurl","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"imageURL","kind":"identifier"},{"text":": ","kind":"text"},{"text":"URL","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation3URLV"},{"text":"?","kind":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/imageURL"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/name","interfaceLanguage":"swift"},"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/name"],"traits":[{"interfaceLanguage":"swift"}]}],"primaryContentSections":[{"declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"}]}],"kind":"declarations"}],"kind":"symbol","metadata":{"roleHeading":"Instance Property","role":"symbol","modules":[{"name":"AmiiboService"}],"externalID":"s:13AmiiboService0A0V4nameSSvp","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"}],"symbolKind":"property","title":"name"},"schemaVersion":{"major":0,"minor":3,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"abstract":[{"type":"text","text":"An amiibo name."}],"references":{"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/name":{"kind":"symbol","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"name"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"type":"topic","abstract":[{"type":"text","text":"An amiibo name."}],"title":"name","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/name","url":"\/documentation\/amiiboservice\/amiibo\/name"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"kind":"symbol","hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/platform-swift.property"]}],"abstract":[{"text":"A game platform type, if any.","type":"text"}],"schemaVersion":{"major":0,"patch":0,"minor":3},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/platform-swift.property","interfaceLanguage":"swift"},"metadata":{"roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V8platformAC8PlatformVSgvp","modules":[{"name":"AmiiboService"}],"role":"symbol","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"platform"},{"text":": ","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Platform","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V8PlatformV"},{"text":"?","kind":"text"}],"symbolKind":"property","title":"platform"},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"platform","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V8PlatformV","text":"Platform","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct"},{"text":"?","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","navigatorTitle":[{"text":"Platform","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Platform","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a collection of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":", "},{"type":"codeVoice","code":"3DS"},{"type":"text","text":", and "},{"type":"codeVoice","code":"Switch"},{"type":"text","text":" games related to an amiibo item."}],"title":"Amiibo.Platform"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/platform-swift.property":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"platform","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Platform","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V8PlatformV"},{"text":"?","kind":"text"}],"type":"topic","abstract":[{"type":"text","text":"A game platform type, if any."}],"title":"platform","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/platform-swift.property","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.property"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V8PlatformV","extendedModule":"AmiiboService","title":"Amiibo.Platform","navigatorTitle":[{"text":"Platform","kind":"identifier"}],"symbolKind":"struct","fragments":[{"kind":"keyword","text":"struct"},{"text":" ","kind":"text"},{"text":"Platform","kind":"identifier"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Structure"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","interfaceLanguage":"swift"},"topicSections":[{"generated":true,"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/switch","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/threeDS","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/wiiU"],"anchor":"Instance-Properties","title":"Instance Properties"}],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Platform"}],"languages":["swift"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/platform-swift.struct"]}],"kind":"symbol","schemaVersion":{"major":0,"patch":0,"minor":3},"seeAlsoSections":[{"generated":true,"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries"],"anchor":"Models","title":"Models"}],"abstract":[{"text":"A model that represents a collection of ","type":"text"},{"code":"WiiU","type":"codeVoice"},{"text":", ","type":"text"},{"code":"3DS","type":"codeVoice"},{"text":", and ","type":"text"},{"code":"Switch","type":"codeVoice"},{"text":" games related to an amiibo item.","type":"text"}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"relationshipsSections":[{"identifiers":["doc:\/\/AmiiboService\/s8SendableP","doc:\/\/AmiiboService\/s16SendableMetatypeP"],"kind":"relationships","type":"conformsTo","title":"Conforms To"}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/s8SendableP":{"identifier":"doc:\/\/AmiiboService\/s8SendableP","type":"unresolvable","title":"Swift.Sendable"},"doc://AmiiboService/documentation/AmiiboService/GameSeries":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"GameSeries","kind":"identifier"}],"type":"topic","abstract":[{"text":"A model that represents a game series.","type":"text"}],"navigatorTitle":[{"text":"GameSeries","kind":"identifier"}],"title":"GameSeries","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries","url":"\/documentation\/amiiboservice\/gameseries"},"doc://AmiiboService/documentation/AmiiboService/AmiiboType":{"title":"AmiiboType","url":"\/documentation\/amiiboservice\/amiibotype","kind":"symbol","role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboType","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents an amiibo type."}],"navigatorTitle":[{"text":"AmiiboType","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct/threeDS":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/threeDS","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/threeds","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"threeDS","kind":"identifier"},{"text":": [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V4GameV","text":"Game","kind":"typeIdentifier"},{"text":"]","kind":"teLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"kind":"text","text":" "},{"text":"`switch`","kind":"identifier"},{"text":": [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V4GameV","text":"Game","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct"]]},"metadata":{"roleHeading":"Instance Property","title":"switch","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"`switch`","kind":"identifier"},{"text":": [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Game","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V4GameV"},{"text":"]","kind":"text"}],"externalID":"s:13AmiiboService0A0V8PlatformV6switchSayAC4GameVGvp","symbolKind":"property","modules":[{"name":"AmiiboService"}]},"abstract":[{"text":"A list of ","type":"text"},{"code":"Switch","type":"codeVoice"},{"text":" games related to an amiibo item.","type":"text"}],"kind":"symbol","sections":[],"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/switch"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/switch","interfaceLanguage":"swift"},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","navigatorTitle":[{"text":"Platform","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Platform","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a collection of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":", "},{"type":"codeVoice","code":"3DS"},{"type":"text","text":", and "},{"type":"codeVoice","code":"Switch"},{"type":"text","text":" games related to an amiibo item."}],"title":"Amiibo.Platform"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct/switch":{"role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/switch","type":"topic","title":"switch","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"`switch`","kind":"identifier"},{"text":": [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V4GameV","text":"Game","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/switch","abstract":[{"text":"A list of ","type":"text"},{"code":"Switch","type":"codeVoice"},{"type":"text","text":" games related to an amiibo item."}]},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":Line truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/threeDS"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/threeds"]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"threeDS","kind":"identifier"},{"text":": [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V4GameV","text":"Game","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"kind":"symbol","metadata":{"roleHeading":"Instance Property","role":"symbol","modules":[{"name":"AmiiboService"}],"externalID":"s:13AmiiboService0A0V8PlatformV7threeDSSayAC4GameVGvp","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"threeDS","kind":"identifier"},{"text":": [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Game","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V4GameV"},{"text":"]","kind":"text"}],"symbolKind":"property","title":"threeDS"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct"]]},"schemaVersion":{"minor":3,"major":0,"patch":0},"abstract":[{"type":"text","text":"A list of "},{"type":"codeVoice","code":"3DS"},{"type":"text","text":" games related to an amiibo item."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct/threeDS":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/threeDS","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/threeds","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"threeDS","kind":"identifier"},{"text":": [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V4GameV","text":"Game","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"abstract":[{"type":"text","text":"A list of "},{"type":"codeVoice","code":"3DS"},{"text":" games related to an amiibo item.","type":"text"}],"title":"threeDS"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","navigatorTitle":[{"text":"Platform","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Platform","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a collection of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":", "},{"type":"codeVoice","code":"3DS"},{"type":"text","text":", and "},{"type":"codeVoicLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V8PlatformV4wiiUSayAC4GameVGvp","title":"wiiU","symbolKind":"property","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"wiiU","kind":"identifier"},{"text":": [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V4GameV","text":"Game","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/wiiU"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/wiiu"]}],"kind":"symbol","schemaVersion":{"minor":3,"major":0,"patch":0},"abstract":[{"type":"text","text":"A list of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":" games related to an amiibo item."}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"wiiU","kind":"identifier"},{"text":": [","kind":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V","kind":"typeIdentifier"},{"text":".","kind":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","text":"Game","preciseIdentifier":"s:13AmiiboService0A0V4GameV","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","navigatorTitle":[{"text":"Platform","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Platform","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a collection of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":", "},{"type":"codeVoice","code":"3DS"},{"type":"text","text":", and "},{"type":"codeVoice","code":"Switch"},{"type":"text","text":" games related to an amiibo item."}],"title":"Amiibo.Platform"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct/wiiU":{"role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct\/wiiU","type":"topic","title":"wiiU","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"wiiU","kind":"identifier"},{"text":": [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Game","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V4GameV"},{"text":"]","kind":"text"}],"kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct\/wiiu","abstract":[{"type":"text","text":"A list of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":" games related to an amiibo item."}]},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboServiLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/release-swift.property"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.property"]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"release","kind":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Release","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V7ReleaseV"}],"platforms":["macOS"],"languages":["swift"]}]}],"kind":"symbol","metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V7releaseAC7ReleaseVvp","title":"release","symbolKind":"property","fragments":[{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"kind":"identifier","text":"release"},{"kind":"text","text":": "},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"kind":"text","text":"."},{"preciseIdentifier":"s:13AmiiboService0A0V7ReleaseV","kind":"typeIdentifier","text":"Release"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"schemaVersion":{"patch":0,"minor":3,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"abstract":[{"type":"text","text":"A release date."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/release-swift.property":{"type":"topic","title":"release","abstract":[{"type":"text","text":"A release date."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.property","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"release","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Release","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V7ReleaseV"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/release-swift.property"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"type":"topic","title":"Amiibo.Release","abstract":[{"type":"text","text":"A model that represents a collection of release dates related to an amiibo item."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"navigatorTitle":[{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"kind":"symbol","topicSections":[{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/america","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/australia","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/europe","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/japan"],"title":"Instance Properties","anchor":"Instance-Properties","generated":true}],"abstract":[{"type":"text","text":"A model that represents a collection of release dates related to an amiibo item."}],"seeAlsoSections":[{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries"],"title":"Models","anchor":"Models","generated":true}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct"]}],"metadata":{"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"modules":[{"name":"AmiiboService"}],"navigatorTitle":[{"text":"Release","kind":"identifier"}],"title":"Amiibo.Release","role":"symbol","roleHeading":"Structure","extendedModule":"AmiiboService","externalID":"s:13AmiiboService0A0V7ReleaseV","symbolKind":"struct"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"},"schemaVersion":{"minor":3,"major":0,"patch":0},"relationshipsSections":[{"kind":"relationships","identifiers":["doc:\/\/AmiiboService\/s8SendableP","doc:\/\/AmiiboService\/s16SendableMetatypeP"],"title":"Conforms To","type":"conformsTo"}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"platforms":["macOS"],"languages":["swift"]}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/europe":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"europe","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV"},{"text":"?","kind":"text"}],"type":"topic","abstract":[{"type":"text","text":"A release date for Europe, if any."}],"title":"europe","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/europe","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/europe"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/s8SendableP":{"identifier":"doc:\/\/AmiiboService\/s8SendableP","type":"unresolvable","title":"Swift.Sendable"},"doc://AmiiboService/documentation/AmiiboService/GameSeries":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"GameSeries","kind":"identifier"}],"type":"topic","abstract":[{"text":"A model that represents a game series.","type":"text"}],"navigatorTitle":[{"text":"GameSeries","kind":"identifier"}],"title":"GameSeries","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries","url":"\/documentation\/amiiboservice\/gameseries"},"doc://AmiiboService/documentation/AmiiboService/AmiiboType":{"title":"AmiiboType","url":"\/documentation\/amiiboservice\/amiibotype","kind":"symbol","role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboType","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents an amiibo type."}],"navigatorTitle":[{"text":"AmiiboType","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/japan":{"identifier":"doc:\/\/AmiiboService\/documenLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/america"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/america"]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"america","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","preciseIdentifier":"s:10Foundation4DateV","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"kind":"symbol","metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V7ReleaseV7america10Foundation4DateVSgvp","modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"america","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","preciseIdentifier":"s:10Foundation4DateV","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"symbolKind":"property","title":"america"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"schemaVersion":{"patch":0,"major":0,"minor":3},"abstract":[{"type":"text","text":"A release date for North America, if any."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/america":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"america","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV"},{"text":"?","kind":"text"}],"type":"topic","abstract":[{"type":"text","text":"A release date for North America, if any."}],"title":"america","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/america","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/america"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"type":"topic","title":"Amiibo.Release","abstract":[{"type":"text","text":"A model that represents a collection of release dates related to an amiibo item."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"navigatorTitle":[{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"australia"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}]}],"kind":"declarations"}],"schemaVersion":{"minor":3,"patch":0,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V7ReleaseV9australia10Foundation4DateVSgvp","title":"australia","symbolKind":"property","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"australia"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"abstract":[{"type":"text","text":"A release date for Australia, if any."}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/australia"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/australia"},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/australia":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"australia","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV"},{"text":"?","kind":"text"}],"type":"topic","abstract":[{"type":"text","text":"A release date for Australia, if any."}],"title":"australia","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/australia","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/australia"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"type":"topic","title":"Amiibo.Release","abstract":[{"type":"text","text":"A model that represents a collection of release dates related to an amiibo item."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"navigatorTitle":[{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/europe"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/europe"]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"europe"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"platforms":["macOS"],"languages":["swift"]}]}],"kind":"symbol","metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V7ReleaseV6europe10Foundation4DateVSgvp","modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"europe"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"symbolKind":"property","title":"europe"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"schemaVersion":{"patch":0,"major":0,"minor":3},"abstract":[{"type":"text","text":"A release date for Europe, if any."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"type":"topic","title":"Amiibo.Release","abstract":[{"type":"text","text":"A model that represents a collection of release dates related to an amiibo item."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"navigatorTitle":[{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/europe":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"europe","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV"},{"text":"?","kind":"text"}],"type":"topic","abstract":[{"type":"text","text":"A release date for Europe, if any."}],"title":"europe","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/europe","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/europe"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"text":"let","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"japan"},{"text":": ","kind":"text"},{"text":"Date","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV"},{"text":"?","kind":"text"}],"languages":["swift"]}]}],"schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"metadata":{"fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"japan"},{"kind":"text","text":": "},{"text":"Date","preciseIdentifier":"s:10Foundation4DateV","kind":"typeIdentifier"},{"kind":"text","text":"?"}],"roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V7ReleaseV5japan10Foundation4DateVSgvp","role":"symbol","symbolKind":"property","modules":[{"name":"AmiiboService"}],"title":"japan"},"abstract":[{"text":"A release date for Japan, if any.","type":"text"}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/japan"]}],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/japan","interfaceLanguage":"swift"},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/japan":{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/japan","title":"japan","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/japan","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"japan","kind":"identifier"},{"text":": ","kind":"text"},{"text":"Date","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV"},{"text":"?","kind":"text"}],"abstract":[{"type":"text","text":"A release date for Japan, if any."}],"type":"topic","kind":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"type":"topic","title":"Amiibo.Release","abstract":[{"type":"text","text":"A model that represents a collection of release dates related to an amiibo item."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"navigatorTitle":[{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/series","interfaceLanguage":"swift"},"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/series"],"traits":[{"interfaceLanguage":"swift"}]}],"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"series","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}]}],"kind":"declarations"}],"kind":"symbol","metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V6seriesSSvp","title":"series","symbolKind":"property","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"series"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"abstract":[{"text":"An amiibo series.","type":"text"}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/series":{"role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/series","title":"series","type":"topic","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"series","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"}],"kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/series","abstract":[{"type":"text","text":"An amiibo series."}]},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"tail"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"platforms":["macOS"],"languages":["swift"]}]}],"schemaVersion":{"minor":3,"patch":0,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"metadata":{"roleHeading":"Instance Property","title":"tail","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"tail","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"symbolKind":"property","externalID":"s:13AmiiboService0A0V4tailSSvp","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"The last 8 hexadecimal characters of an identifier."}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/tail"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/tail"},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/tail":{"type":"topic","title":"tail","abstract":[{"type":"text","text":"The last 8 hexadecimal characters of an identifier."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/tail","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"tail","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/tail"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"kind":"symbol","variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/type"],"traits":[{"interfaceLanguage":"swift"}]}],"abstract":[{"text":"An amiibo type.","type":"text"}],"schemaVersion":{"major":0,"minor":3,"patch":0},"metadata":{"fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"type","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"modules":[{"name":"AmiiboService"}],"role":"symbol","title":"type","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V4typeSSvp","symbolKind":"property"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/type","interfaceLanguage":"swift"},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"type","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"languages":["swift"]}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/type":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"type","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"type":"topic","abstract":[{"text":"An amiibo type.","type":"text"}],"title":"type","role":"symbol","url":"\/documentation\/amiiboservice\/amiibo\/type","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/type"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"kind":"symbol","topicSections":[{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/explanation","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/isWriteable"],"title":"Instance Properties","anchor":"Instance-Properties","generated":true}],"abstract":[{"text":"A model that represents the usage of an amiibo item within a certain game.","type":"text"}],"seeAlsoSections":[{"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries"],"title":"Models","anchor":"Models","generated":true}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/usage"]}],"metadata":{"navigatorTitle":[{"text":"Usage","kind":"identifier"}],"roleHeading":"Structure","extendedModule":"AmiiboService","externalID":"s:13AmiiboService0A0V5UsageV","modules":[{"name":"AmiiboService"}],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"symbolKind":"struct","title":"Amiibo.Usage"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","interfaceLanguage":"swift"},"schemaVersion":{"patch":0,"major":0,"minor":3},"relationshipsSections":[{"kind":"relationships","identifiers":["doc:\/\/AmiiboService\/s8SendableP","doc:\/\/AmiiboService\/s16SendableMetatypeP"],"title":"Conforms To","type":"conformsTo"}],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"platforms":["macOS"],"languages":["swift"]}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboType":{"title":"AmiiboType","url":"\/documentation\/amiiboservice\/amiibotype","kind":"symbol","role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboType","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents an amiibo type."}],"navigatorTitle":[{"text":"AmiiboType","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage/isWriteable":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"isWriteable","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"type":"topic","abstract":[{"type":"text","text":"A flag that indicates whether an amiibo item can save game data in it."}],"title":"isWriteable","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/isWriteable","url":"\/documentation\/amiiboservice\/amiibo\/usage\/iswriteable"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","navigatorTitle":[{"text":"Game","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Game","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents a game related to an amiibo item."}],"title":"Amiibo.Game"},"doc://AmiiboService/s8SendableP":{"type":"unresolvable","title":"Swift.Sendable","identifier":"doc:\/\/AmiiboService\/s8SendableP"},"doc://AmiiboService/s16SendableMetatypeP":{"identifier":"doc:\/\/AmiiboService\/s16SendableMetatypeP","type":"unresolvable","title":"Swift.SendableMetatype"},"doc://AmiiboService/documentation/AmiiboService/GameCharacter":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter","navigatorTitle":[{"text":"GameCharacter","kind":"identifierLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage"]]},"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/usage\/explanation"]}],"abstract":[{"type":"text","text":"An explanation of how to use an amiibo item."}],"metadata":{"fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"explanation","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"modules":[{"name":"AmiiboService"}],"title":"explanation","role":"symbol","roleHeading":"Instance Property","symbolKind":"property","externalID":"s:13AmiiboService0A0V5UsageV11explanationSSvp"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/explanation"},"schemaVersion":{"minor":3,"major":0,"patch":0},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"explanation","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"platforms":["macOS"],"languages":["swift"]}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage/explanation":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/explanation","url":"\/documentation\/amiiboservice\/amiibo\/usage\/explanation","role":"symbol","kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"explanation","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"abstract":[{"type":"text","text":"An explanation of how to use an amiibo item."}],"title":"explanation"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","navigatorTitle":[{"text":"Usage","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/usage","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents the usage of an amiibo item within a certain game."}],"title":"Amiibo.Usage"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A0V5UsageV11isWriteableSbvp","title":"isWriteable","symbolKind":"property","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"isWriteable"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Property"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/isWriteable","interfaceLanguage":"swift"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/usage\/iswriteable"]}],"kind":"symbol","schemaVersion":{"major":0,"patch":0,"minor":3},"abstract":[{"text":"A flag that indicates whether an amiibo item can save game data in it.","type":"text"}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"isWriteable"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"languages":["swift"]}]}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"kind":"symbol","abstract":[{"type":"text","text":"A model that represents an amiibo item."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Amiibo","kind":"identifier"}],"type":"topic","title":"Amiibo","navigatorTitle":[{"text":"Amiibo","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","url":"\/documentation\/amiiboservice\/amiibo","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage/isWriteable":{"kind":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"isWriteable","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"type":"topic","abstract":[{"type":"text","text":"A flag that indicates whether an amiibo item can save game data in it."}],"title":"isWriteable","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/isWriteable","url":"\/documentation\/amiiboservice\/amiibo\/usage\/iswriteable"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","navigatorTitle":[{"text":"Usage","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibo\/usage","role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"abstract":[{"type":"text","text":"A model that represents the usage of an amiibo item within a certain game."}],"title":"Amiibo.Usage"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"}}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}]}],"kind":"declarations"}],"schemaVersion":{"major":0,"minor":3,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService"]]},"metadata":{"roleHeading":"Protocol","title":"AmiiboClient","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}],"navigatorTitle":[{"text":"AmiiboClient","kind":"identifier"}],"symbolKind":"protocol","externalID":"s:13AmiiboService0A6ClientP","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"A protocol that defines API clients containing all available endpoints to interact with."}],"kind":"symbol","sections":[],"topicSections":[{"anchor":"Instance-Methods","generated":true,"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiiboSeries(by:)","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiiboTypes(by:)","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiibos(by:)","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getGameCharacters(by:)","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getGameSeries(by:)","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getLastUpdated()"],"title":"Instance Methods"}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiiboclient"]}],"relationshipsSections":[{"type":"conformingTypes","kind":"relationships","identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboLiveClient"],"title":"Conforming Types"}],"seeAlsoSections":[{"anchor":"Clients","generated":true,"identifiers":["doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboLiveClient"],"title":"Clients"}],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient","interfaceLanguage":"swift"},"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboClient/getAmiibos(by:)":{"type":"topic","title":"getAmiibos(by:)","abstract":[{"type":"text","text":"Gets a list of amiibo items based on a given filter."}],"required":true,"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiiboclient\/getamiibos(by:)","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getAmiibos","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"AmiiboFilter","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A6FilterV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":"]","kind":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiibos(by:)"},"doc://AmiiboService/documentation/AmiiboService/AmiiboClient":{"title":"AmiiboClient","url":"\/documentation\/amiiboservice\/amiiboclient","kind":"symbol","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}],"abstract":[{"text":"A protocol that defines API clients containing all available endpoints to interact with.","type":"text"}],"navigatorTitle":[{"text":"AmiiboClient","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/AmiiboClient/getGameSeries(by:)":{"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getGameSeries(by:)","url":"\/documentation\/amiiboservice\/amiiboclient\/getgameseries(by:)","role":"symbol","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getGameSeries","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"GameSeriesFilter","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService16GameSeriesFilterV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"text":"GameSeries","kind":"typeIdentifier","preLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"kind":"symbol","hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiiboclient\/getamiibos(by:)"]}],"abstract":[{"text":"Gets a list of amiibo items based on a given filter.","type":"text"}],"schemaVersion":{"major":0,"patch":0,"minor":3},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiibos(by:)","interfaceLanguage":"swift"},"metadata":{"roleHeading":"Instance Method","role":"symbol","modules":[{"name":"AmiiboService"}],"externalID":"s:13AmiiboService0A6ClientP10getAmiibos2bySayAA0A0VGAA0A6FilterV_tYaKF","required":true,"fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getAmiibos","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"AmiiboFilter","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A6FilterV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":"]","kind":"text"}],"symbolKind":"method","title":"getAmiibos(by:)"},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getAmiibos","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"filter","kind":"internalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A6FilterV","text":"AmiiboFilter","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboFilter"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]},{"kind":"parameters","parameters":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"A filter to remove unwanted items from the result."}]}],"name":"filter"}]},{"kind":"content","content":[{"level":2,"text":"Return Value","anchor":"return-value","type":"heading"},{"inlineContent":[{"type":"text","text":"A list of filtered amiibo items."}],"type":"paragraph"}]},{"kind":"content","content":[{"level":2,"text":"Discussion","anchor":"discussion","type":"heading"},{"style":"note","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"An "},{"type":"reference","isActive":true,"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError"},{"type":"text","text":" error in case some issue is encountered while generating the result."}]}],"type":"aside","name":"Throws"}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboClient":{"title":"AmiiboClient","url":"\/documentation\/amiiboservice\/amiiboclient","kind":"symbol","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}],"abstract":[{"text":"A protocol that defines API clients containing all available endpoints to interact with.","type":"text"}],"navigatorTitle":[{"text":"AmiiboClient","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"},"doc://AmiiboService/documentation/AmiiboService/AmiiboFilter":{"title":"AmiiboFilter","abstract":[{"type":"text","text":"A type that contains values to fine-tune a response when requesting amiibo items."}],"role":"symbol","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboFilter","type":"topic","navigatorTitle":[{"text":"AmiiboFilter","kind":"identifier"}],"fragments":[{"kind":"keyword","text":"struct"},{"text":" ","kind":"text"},{"text":"AmiiboFilter","kind":"identifier"}],"url":"\/documentation\/amiiboservice\/amiibofilter"},"doc://AmiiboService/documentation/AmiiboService/AmiiboServiceError":{"type":"topic","title":"AmiiboServiceError","abstract":[{"type":"text","text":"A representation of all the possible errors that the "},{"type":"reference","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboService","isActive":true},{"type":"text","text":" service could throw."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiiboserviceerror","fragments":[{"text":"enum","kind":"keyword"},{"kind":"text","text":" "},{"text":"AmiiboServiceError","kind":"identifier"}],"navigatorTitle":[{"text":"AmiiboServiceError","kind":"identifier"}],"identifier":"doc:\/\/AmiiboSLine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"]]},"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiiboclient\/getamiiboseries(by:)"]}],"abstract":[{"type":"text","text":"Gets a list of amiibo series based on a given filter."}],"metadata":{"fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getAmiiboSeries","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A12SeriesFilterV","text":"AmiiboSeriesFilter","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A6SeriesV","text":"AmiiboSeries","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"required":true,"modules":[{"name":"AmiiboService"}],"title":"getAmiiboSeries(by:)","role":"symbol","roleHeading":"Instance Method","externalID":"s:13AmiiboService0A6ClientP03getA6Series2bySayAA0aE0VGAA0aE6FilterV_tYaKF","symbolKind":"method"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiiboSeries(by:)"},"schemaVersion":{"minor":3,"major":0,"patch":0},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getAmiiboSeries","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"filter","kind":"internalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A12SeriesFilterV","text":"AmiiboSeriesFilter","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeriesFilter"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A6SeriesV","text":"AmiiboSeries","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeries"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]},{"kind":"parameters","parameters":[{"content":[{"type":"paragraph","inlineContent":[{"text":"A filter to remove unwanted items from the result.","type":"text"}]}],"name":"filter"}]},{"kind":"content","content":[{"type":"heading","level":2,"text":"Return Value","anchor":"return-value"},{"inlineContent":[{"type":"text","text":"A list of filtered amiibo series."}],"type":"paragraph"}]},{"kind":"content","content":[{"type":"heading","level":2,"text":"Discussion","anchor":"discussion"},{"style":"note","type":"aside","content":[{"type":"paragraph","inlineContent":[{"text":"An ","type":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError","isActive":true,"type":"reference"},{"text":" error in case some issue is encountered while generating the result.","type":"text"}]}],"name":"Throws"}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboSeriesFilter":{"kind":"symbol","abstract":[{"type":"text","text":"A type that contains values to fine-tune a response when requesting amiibo series."}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboSeriesFilter","kind":"identifier"}],"type":"topic","title":"AmiiboSeriesFilter","navigatorTitle":[{"text":"AmiiboSeriesFilter","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboSeriesFilter","url":"\/documentation\/amiiboservice\/amiiboseriesfilter","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/AmiiboClient":{"title":"AmiiboClient","url":"\/documentation\/amiiboservice\/amiiboclient","kind":"symbol","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}],"abstract":[{"text":"A protocol that defines API clients containing all available endpoints to interact with.","type":"text"}],"navigatorTitle":[{"text":"AmiiboClient","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"},"doc://AmiiboService/documentation/AmiiboService/AmiiboSeries":{"navigatorTitle":[{"text":"ALine truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"kind":"symbol","hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"]]},"abstract":[{"type":"text","text":"Gets a list of amiibo types based on a given filter."}],"metadata":{"roleHeading":"Instance Method","symbolKind":"method","modules":[{"name":"AmiiboService"}],"required":true,"externalID":"s:13AmiiboService0A6ClientP03getA5Types2bySayAA0A4TypeVGAA0aG6FilterV_tYaKF","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getAmiiboTypes","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"AmiiboTypeFilter","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A10TypeFilterV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> ["},{"text":"AmiiboType","preciseIdentifier":"s:13AmiiboService0A4TypeV","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"title":"getAmiiboTypes(by:)","role":"symbol"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getAmiiboTypes(by:)","interfaceLanguage":"swift"},"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"getAmiiboTypes"},{"kind":"text","text":"("},{"text":"by","kind":"externalParam"},{"kind":"text","text":" "},{"kind":"internalParam","text":"filter"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A10TypeFilterV","text":"AmiiboTypeFilter","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboTypeFilter","kind":"typeIdentifier"},{"kind":"text","text":") "},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A4TypeV","text":"AmiiboType","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType","kind":"typeIdentifier"},{"kind":"text","text":"]"}]}],"kind":"declarations"},{"kind":"parameters","parameters":[{"name":"filter","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"A filter to remove unwanted items from the result."}]}]}]},{"kind":"content","content":[{"anchor":"return-value","type":"heading","level":2,"text":"Return Value"},{"inlineContent":[{"text":"A list of filtered amiibo types.","type":"text"}],"type":"paragraph"}]},{"kind":"content","content":[{"text":"Discussion","level":2,"anchor":"discussion","type":"heading"},{"name":"Throws","type":"aside","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"An "},{"isActive":true,"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError","type":"reference"},{"type":"text","text":" error in case some issue is encountered while generating the result."}]}],"style":"note"}]}],"schemaVersion":{"patch":0,"minor":3,"major":0},"variants":[{"paths":["\/documentation\/amiiboservice\/amiiboclient\/getamiibotypes(by:)"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboType":{"type":"topic","title":"AmiiboType","abstract":[{"type":"text","text":"A model that represents an amiibo type."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiibotype","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"AmiiboType"}],"navigatorTitle":[{"kind":"identifier","text":"AmiiboType"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboType"},"doc://AmiiboService/documentation/AmiiboService/AmiiboClient":{"title":"AmiiboClient","url":"\/documentation\/amiiboservice\/amiiboclient","kind":"symbol","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}],"abstract":[{"text":"A protocol that defines API clients containing all available endpoints to interact with.","type":"text"}],"navigatorTitle":[{"text":"AmiiboClient","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService/AmiiboTypeFilter":{"role":"symbol","title":"AmiiboTypeFilter","type":"topic","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text"Line truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getGameCharacters","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"filter","kind":"internalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService19GameCharacterFilterV","text":"GameCharacterFilter","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacterFilter"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService13GameCharacterV","text":"GameCharacter","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameCharacter"},{"text":"]","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]},{"kind":"parameters","parameters":[{"content":[{"type":"paragraph","inlineContent":[{"text":"A filter to remove unwanted items from the result.","type":"text"}]}],"name":"filter"}]},{"kind":"content","content":[{"type":"heading","level":2,"text":"Return Value","anchor":"return-value"},{"inlineContent":[{"type":"text","text":"A list of filtered game characters."}],"type":"paragraph"}]},{"kind":"content","content":[{"type":"heading","level":2,"text":"Discussion","anchor":"discussion"},{"style":"note","type":"aside","content":[{"type":"paragraph","inlineContent":[{"text":"An ","type":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError","isActive":true,"type":"reference"},{"text":" error in case some issue is encountered while generating the result.","type":"text"}]}],"name":"Throws"}]}],"schemaVersion":{"minor":3,"major":0,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"]]},"metadata":{"roleHeading":"Instance Method","title":"getGameCharacters(by:)","required":true,"role":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getGameCharacters","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:13AmiiboService19GameCharacterFilterV","text":"GameCharacterFilter","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService13GameCharacterV","text":"GameCharacter","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"externalID":"s:13AmiiboService0A6ClientP17getGameCharacters2bySayAA0E9CharacterVGAA0eH6FilterV_tYaKF","symbolKind":"method","modules":[{"name":"AmiiboService"}]},"abstract":[{"type":"text","text":"Gets a list of game characters based on a given filter."}],"kind":"symbol","sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiiboclient\/getgamecharacters(by:)"]}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getGameCharacters(by:)"},"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboClient":{"title":"AmiiboClient","url":"\/documentation\/amiiboservice\/amiiboclient","kind":"symbol","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"AmiiboClient","kind":"identifier"}],"abstract":[{"text":"A protocol that defines API clients containing all available endpoints to interact with.","type":"text"}],"navigatorTitle":[{"text":"AmiiboClient","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"},"doc://AmiiboService/documentation/AmiiboService/AmiiboServiceError":{"type":"topic","title":"AmiiboServiceError","abstract":[{"type":"text","text":"A representation of all the possible errors that the "},{"type":"reference","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboService","isActive":true},{"type":"text","text":" service could throw."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiiboserviceerror","fragments":[{"text":"enum","kind":"keyword"},{"kind":"text","text":" "},{"text":"AmiiboServiceError","kind":"identifier"}],"navigatorTitle":[{"text":"AmiiboServiceError","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError"},"doc://AmiiboService/documentation/AmiiboService/GameCharacterFilter":{"url":"\/documentation\/amiiboservice\/gamecharacterfilter","navigatorTitle":[{"text":"GameCharacterFilter","kind":"identifier"}],"role":"symbol","abstract":[{"type":"text","text":"A type that contains values to fine-tune a response when requesting game characters."}],"kind":"symbol","title":"Line truncated
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"sections":[],"metadata":{"role":"symbol","externalID":"s:13AmiiboService0A6ClientP13getGameSeries2bySayAA0eF0VGAA0eF6FilterV_tYaKF","title":"getGameSeries(by:)","symbolKind":"method","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getGameSeries","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"GameSeriesFilter","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService16GameSeriesFilterV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"text":"GameSeries","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService10GameSeriesV"},{"text":"]","kind":"text"}],"modules":[{"name":"AmiiboService"}],"roleHeading":"Instance Method","required":true},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient\/getGameSeries(by:)"},"variants":[{"paths":["\/documentation\/amiiboservice\/amiiboclient\/getgameseries(by:)"],"traits":[{"interfaceLanguage":"swift"}]}],"kind":"symbol","schemaVersion":{"patch":0,"major":0,"minor":3},"abstract":[{"text":"Gets a list of game series based on a given filter.","type":"text"}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboClient"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getGameSeries","kind":"identifier"},{"text":"(","kind":"text"},{"text":"by","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"filter","kind":"internalParam"},{"text":": ","kind":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeriesFilter","preciseIdentifier":"s:13AmiiboService16GameSeriesFilterV","text":"GameSeriesFilter","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> [","kind":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/GameSeries","preciseIdentifier":"s:13AmiiboService10GameSeriesV","text":"GameSeries","kind":"typeIdentifier"},{"text":"]","kind":"text"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"parameters","parameters":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"A filter to remove unwanted items from the result."}]}],"name":"filter"}]},{"kind":"content","content":[{"type":"heading","level":2,"text":"Return Value","anchor":"return-value"},{"inlineContent":[{"type":"text","text":"A list of filtered game series."}],"type":"paragraph"}]},{"kind":"content","content":[{"type":"heading","text":"Discussion","anchor":"discussion","level":2},{"content":[{"type":"paragraph","inlineContent":[{"text":"An ","type":"text"},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError","type":"reference","isActive":true},{"text":" error in case some issue is encountered while generating the result.","type":"text"}]}],"type":"aside","style":"note","name":"Throws"}]}],"references":{"doc://AmiiboService/documentation/AmiiboService/AmiiboServiceError":{"type":"topic","title":"AmiiboServiceError","abstract":[{"type":"text","text":"A representation of all the possible errors that the "},{"type":"reference","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboService","isActive":true},{"type":"text","text":" service could throw."}],"role":"symbol","kind":"symbol","url":"\/documentation\/amiiboservice\/amiiboserviceerror","fragments":[{"text":"enum","kind":"keyword"},{"kind":"text","text":" "},{"text":"AmiiboServiceError","kind":"identifier"}],"navigatorTitle":[{"text":"AmiiboServiceError","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboServiceError"},"doc://AmiiboService/documentation/AmiiboService/AmiiboService":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"text":"AmiiboService","kind":"identifier"}],"type":"topic","abstract":[{"type":"text","text":"A type that implements the service that uses a client to make calls."}],"navigatorTitle":[{"text":"AmiiboService","kind":"identifier"}],"title":"AmiiboService","role":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/AmiiboService","url":"\/documentation\/amiiboservice\/amiiboservice"},"doc://AmiiboService/documentation/AmiiboService":{"title":"AmiiboService","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interacts with the "},{"type":"strong","inlineContent":[{"type":"text","text":"Amiibo API"}]},{"type":"text","text":" backend service."}],"role":"collection","kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","type":"topic","url":"\/documentation\/amiLine truncated
|
|
||||||
Loaded 100 of 327 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user