14 Commits

Author SHA1 Message Date
javier 4623c13c24 Improved the Open API specification document (#19)
This PR contains the work done to improve the `OpenAPI` specification documentation that describes the `Amiibo API` online service as well as updates to the `AmiiboLiveClient` that uses the code generated out of the mentioned document. In addition, some test cases have been updated to reflect the latest data in the service.

Reviewed-on: #19
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-10-14 23:26:42 +00:00
javier 34627840db Some fixes to the latest updates (#18)
This PR contains the work done to:
* update the header files of all the existing source files in the project with the Apache License;
* update the main article of the `DocC` documentation catalog;
* update the `README` file;
* regenerate the Github Pages documentation from the `DocC` documentation catalog.

Reviewed-on: #18
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-10-07 22:32:54 +00:00
javier 40afefed15 Open API specification improvements and License update (#17)
This PR contains the work done to:
* improve the overall `OpenAPI` specification documentation describing the `Amiibo API` service;
* update the `AmiiboFilter` type to include the `head` and `tail` properties;
* update the error handling of the errors coming up from the service;
* update its license to Apache v2.0;
* regenerate the Github Pages documentation.

Reviewed-on: #17
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-10-07 22:07:55 +00:00
javier c303e1f8f3 Some suggested improvements (#16)
This PR contains the work done to make some overall improvements to the library:
* Fixed code duplication from supporting multiple Swift version in the `AmiiboLiveClient` client;
* Improved the error handling from the client's calls in the `AmiiboLiveClient` client;
* Conformed to `AmiiboLiveClient` and the filter types to the `Sendable` protocol;
* Added the "transport" argument to the initializer of the `AmiiboLiveClient` client;
* Updated the `DocC` library documentation.

Reviewed-on: #16
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-10-02 01:51:16 +00:00
javier 463d15975c Amiibo Service live tests refactoring (#15)
This PR contains the work done to refactor the test cases for the `AmiiboService` service type in the test target, to write them as the `Swift Testing` framework intended. In. addition, the documentation tasks in the `Makefile` file and the generated `DocC` documentation for Github Pages have also been updated.

Reviewed-on: #15
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-10-01 23:19:14 +00:00
javier 8760ff6e12 Bumped the Swift version of the Package file (#14)
This PR contains the work done to bump the Swift compiler version in which the library is being built to `v5.10`.

Reviewed-on: #14
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-18 15:03:07 +00:00
javier bc0ae63719 Some package and library documentation updates (#13)
This PR contains the work done to:
* Updated the library *DocC* documentation catalog;
* Updated the library documentation for both *Xcode* and *GitHub Pages*;
* Added the Swift version and compatibility badges to the README file;
* Added the link to the *GitHub Pages* documentation in the *Swift Package Index* configuration.

Reviewed-on: #13
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-12 00:51:06 +00:00
javier 3d923982b1 Improvements on the AmiiboService service type initialization (#12)
This PR addresses the issue #10 as described in the *Possible Solution* section in that issue.

Reviewed-on: #12
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-12 00:13:58 +00:00
javier 19583290be Possible fix for compilation issue in Swift 5 (#11)
This PR contains the work done to amend the issue #9 which, basically, provides a separate functions declaration for the `APIClient` protocol and the `AmiiboService` service type on Swift 5.

Reviewed-on: #11
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-11 22:49:58 +00:00
javier 0af0e3056d Patched (temporarily) the DocC documentation (#8)
This PR contains the work done to:
* Documented the public properties, initializers, and/or functions of those types conforming to the `APIClient`, `KeyNameFilter`, and `KeyNameModel` protocols, to fix the issue that the protocol documentations cannot be inherited;
* Moved the `AmiiboService` DocC documentation catalog inside the library target;
* Amended the folder structure of the library and test targets;
* Fixed further documentation issues encountered while revising the written documentation;
* Added the `lib-test` task in the `Makefile` file;
* Improved the naming for the existing tasks in the `Makefile` file.

Reviewed-on: #8
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-10 19:47:45 +00:00
javier b39fd8533b DocC documentation content fixes. (#6)
This PR contains the work done to:
* Fix some documentation issues encountered in the `README` file;
* Fix some documentation issues encountered in the `Library` article of the DocC documentation catalog;
* Update the DocC documentation of the library for GitHub Pages.

Reviewed-on: #6
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-09 18:58:18 +00:00
javier 410a200661 GitHub Pages documentation support. (#5)
This PR contains the work done to:
* Update the `Library` article in the DocC documentation catalog in the project;
* Generate the DocC documentation of the library for GitHub Pages;
* Written the `README` file in the project.

Reviewed-on: #5
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-09 18:34:29 +00:00
javier 37c0f3e322 DocC documentation support (#4)
This PR contains the work done to:
* Documented all the `private`, `internal`, and `public` interfaces on the existing codebase;
* Set the DocC documentation catalog in the project;
* Written the main `Library` article for the DocC documentation catalog;
* Added the documentation tasks in the `Makefile` file.

Reviewed-on: #4
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-09 17:30:19 +00:00
javier 39c6d6e8d6 Basic update of the existing files in the project (#3)
This PR contains the work done to:
* update the `Package.swift` file;
* update the file headers of the existing file in the project;
* update the cases of the `AmiiboServiceLiveTests` tests.

Reviewed-on: #3
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-09-09 17:20:05 +00:00
339 changed files with 4295 additions and 2945 deletions
+24
View File
@@ -0,0 +1,24 @@
## ===----------------------------------------------------------------------===
##
## This source file is part of the Amiibo Service open source project
##
## Copyright (c) 2025 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
##
## ===----------------------------------------------------------------------===
# --- DOCUMENTATION ---
DOCC_ARCHIVE_OUTPUT=./${SPM_LIBRARY_TARGET}.doccarchive
DOCC_GITHUB_OUTPUT=./docs
DOCC_GITHUB_BASE_PATH=amiibo-service
DOCC_PREVIEW_URL=http://localhost:8080/documentation/amiiboservice
# -- SWIFT PACKAGE MANAGER ---
SPM_LIBRARY_TARGET=AmiiboService
+21 -4
View File
@@ -1,10 +1,21 @@
## ===----------------------------------------------------------------------===
##
## This source file is part of the Amiibo Service open source project
##
## Copyright (c) 2025 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
# Visual Studio Code
.vscode
# Xcode # Xcode
DerivedData/ DerivedData/
@@ -31,4 +42,10 @@ Packages/
# hence it is not needed unless you have added a package configuration file to your project # hence it is not needed unless you have added a package configuration file to your project
.swiftpm .swiftpm
.swiftpm/configuration/registries.json .swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
# Visual Studio Code
.vscode
# DocC documentation
*.doccarchive
+17
View File
@@ -0,0 +1,17 @@
## ===----------------------------------------------------------------------===
##
## This source file is part of the Amiibo Service open source project
##
## Copyright (c) 2025 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
##
## ===----------------------------------------------------------------------===
version: 1
external_links:
documentation: "https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/"
+1 -1
View File
@@ -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
+201 -287
View File
@@ -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.
+77 -25
View File
@@ -1,14 +1,16 @@
# ===----------------------------------------------------------------------=== ## ===----------------------------------------------------------------------===
# ##
# This source file is part of the AmiiboAPI open source project ## This source file is part of the Amiibo Service open source project
# ##
# Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors ## Copyright (c) 2025 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
@@ -17,30 +19,80 @@ environment ?= .env
include $(environment) include $(environment)
export $(shell sed 's/=.*//' $(environment)) export $(shell sed 's/=.*//' $(environment))
# IDE # LIBRARY
open-in-xcode: ## Opens this package with Xcode lib-build: ## Builds the library
@open -a Xcode Package.swift @swift build
open-in-vscode: ## Opens this package with Visual Studio Code lib-release: ## Releases the library
@code . @swift build -c release
lib-test: ## Runs the unit tests for the library
@swift test \
--disable-xctest \
--enable-code-coverage \
--enable-swift-testing \
--parallel
# SWIFT PACKAGE MANAGER # SWIFT PACKAGE MANAGER
package-build: ## Builds the project locally pkg-clean: ## Deletes built SPM artifacts of the package
@swift build
package-clean: ## Deletes built SPM artifacts from the package
@swift package clean @swift package clean
package-outdated: ## Lists the SPM package dependencies that can be updated pkg-reset: ## Resets the complete SPM cache/build folder of the package
@swift package update --dry-run
package-reset: ## Resets the complete SPM cache/build folder from the package
@swift package reset @swift package reset
package-update: ## Updates the SPM package dependencies pkg-pristine: pkg-clean pkg-reset ## Deletes all built artifacts, caches, and documentations of the package
@rm -drf $(DOCC_ARCHIVE_OUTPUT)
@rm -drf $(DOCC_GITHUB_OUTPUT)
pkg-outdated: ## Lists the SPM package dependencies that can be updated
@swift package update --dry-run
pkg-update: ## Updates the SPM package dependencies
@swift package update @swift package update
# DOCUMENTATION
doc-generate: doc-generate-archive doc-generate-github ## Generates the library documentation for both Github and Xcode
doc-generate-archive: ## Generates the library documentation archive for Xcode
@swift package \
--allow-writing-to-directory $(DOCC_ARCHIVE_OUTPUT) \
generate-documentation \
--target $(SPM_LIBRARY_TARGET) \
--include-extended-types \
--enable-inherited-docs \
--output-path $(DOCC_ARCHIVE_OUTPUT)
doc-generate-github: ## Generates the library documentation for Github
@swift package \
--allow-writing-to-directory $(DOCC_GITHUB_OUTPUT) \
generate-documentation \
--target $(SPM_LIBRARY_TARGET) \
--disable-indexing \
--transform-for-static-hosting \
--include-extended-types \
--enable-inherited-docs \
--hosting-base-path $(DOCC_GITHUB_BASE_PATH) \
--output-path $(DOCC_GITHUB_OUTPUT)
doc-preview: ## Previews the library documentation in Safari
@open -a safari $(DOCC_PREVIEW_URL)
@swift package \
--disable-sandbox \
preview-documentation \
--target $(SPM_LIBRARY_TARGET) \
--include-extended-types \
--enable-inherited-docs
# IDE
ide-xcode: ## Opens this package with Xcode
@open -a Xcode Package.swift
ide-vscode: ## Opens this package with Visual Studio Code
@code .
# HELP # HELP
+20
View File
@@ -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 2025 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.
+31 -48
View File
@@ -1,21 +1,23 @@
// swift-tools-version: 5.9 // swift-tools-version: 5.10
//===----------------------------------------------------------------------=== // ===----------------------------------------------------------------------===
// //
// This source file is part of the AmiiboAPI open source project // This source file is part of the Amiibo Service open source project
// //
// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors // Copyright (c) 2025 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
let package = Package( let package = Package(
name: AmiiboAPI.package, name: AmiiboService.package,
platforms: [ platforms: [
.iOS(.v13), .iOS(.v13),
.macOS(.v10_15), .macOS(.v10_15),
@@ -25,61 +27,42 @@ let package = Package(
], ],
products: [ products: [
.library( .library(
name: AmiiboAPI.package, name: AmiiboService.package,
targets: [ targets: [AmiiboService.target]
AmiiboAPI.target
]
) )
], ],
dependencies: [ dependencies: [
.package( .package(url: "https://github.com/apple/swift-openapi-generator.git", from: "1.3.0"),
url: "https://github.com/apple/swift-openapi-generator.git", .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.5.0"),
from: "1.3.0" .package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.2"),
), .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.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"
)
], ],
targets: [ targets: [
.target( .target(
name: AmiiboAPI.target, name: AmiiboService.target,
dependencies: [ dependencies: [
.product( .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
name: "OpenAPIRuntime", .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession")
package: "swift-openapi-runtime"
),
.product(
name: "OpenAPIURLSession",
package: "swift-openapi-urlsession"
)
], ],
path: "Sources", path: "Sources/AmiiboService",
plugins: [ plugins: [
.plugin( .plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator"),
name: "OpenAPIGenerator",
package: "swift-openapi-generator"
),
] ]
), ),
.testTarget( .testTarget(
name: AmiiboAPI.test, name: AmiiboService.test,
dependencies: [ dependencies: [
.byName(name: AmiiboAPI.target) .byName(name: AmiiboService.target)
], ],
path: "Tests" path: "Tests/AmiiboService"
), ),
] ]
) )
// MARK: - Constants // MARK: - Constants
enum AmiiboAPI { enum AmiiboService {
static let package = "amiibo-api" static let package = "amiibo-service"
static let target = "AmiiboAPI" static let target = "AmiiboService"
static let test = "\(AmiiboAPI.target)Tests" static let test = "\(AmiiboService.target)Tests"
} }
+37 -1
View File
@@ -1 +1,37 @@
# Amiibo API [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frock-n-code%2Famiibo-service%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/rock-n-code/amiibo-service)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frock-n-code%2Famiibo-service%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/rock-n-code/amiibo-service)
# Amiibo Service
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.
## Installation
To use this library, then it is mandatory to add it as a dependency in the `Package.swift` file:
```swift
let package = Package(
// name, platforms, products, etc.
dependencies: [
.package(url: "https://github.com/rock-n-code/amiibo-service", from: "1.2.0"),
// other dependencies
],
targets: [
.target(
name: "SomeTarget",
dependencies: [
.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.
> important: Swift 5.10 or higher is required in order to build this library.
## Documentation
Please refer to the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/) for further informations about this library.
@@ -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,83 @@
# ``AmiiboService``
A library that provides everything the developer needs to interact with the **Amiibo API** backend service.
## Overview
The `amiibo-service` library is a package that allows 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 *models*, *filters*, *errors* and *interfaces* types that might be needed during implementation.
## Design
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
To use the `AmiiboService` library with your package, then add it as a dependency in the `Package.swift` file:
```swift
let package = Package(
// name, platforms, products, etc.
dependencies: [
.package(url: "https://github.com/rock-n-code/amiibo-service", from: "1.2.0"),
// other dependencies
],
targets: [
.target(
name: "SomeTarget",
dependencies: [
.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.
> important: Swift 5.10 or higher is required in order to compile this library.
## Tasks
This library offers a set of ready-to-use tasks that simplify the interaction with the library, which the developer can use from any `Terminal` application.
> Tip: To show the available list of tasks, plus display some explanations about each and every one of them; please enter the following command:
```bash
$ make
```
## Topics
### Service
- ``AmiiboService``
### Clients
- ``AmiiboClient``
- ``AmiiboLiveClient``
### Models
- ``Amiibo``
- ``Amiibo/Game``
- ``Amiibo/Platform``
- ``Amiibo/Release``
- ``Amiibo/Usage``
- ``AmiiboSeries``
- ``AmiiboType``
- ``GameCharacter``
- ``GameSeries``
### Filters
- ``AmiiboFilter``
- ``AmiiboSeriesFilter``
- ``AmiiboTypeFilter``
- ``GameCharacterFilter``
- ``GameSeriesFilter``
### Errors
- ``AmiiboServiceError``
@@ -0,0 +1,34 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 DateFormatter {
// MARK: Properties
/// An ISO timestamp formatter.
///
/// 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()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
formatter.timeZone = .init(secondsFromGMT: 0)
return formatter
}
}
@@ -0,0 +1,39 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 defines filters that might contain `key` and/or `name` values.
protocol KeyNameFilter {
// MARK: Properties
/// A key to return, if any.
var key: String? { get }
/// A name to return, if any.
var name: String? { get }
// MARK: Initializers
/// Initializes this filter without key or name values.
init()
/// Initializes this filter with a key value.
/// - Parameter key: A key to return.
init(key: String)
/// Initializes this filter with a name value.
/// - Parameter name: A name to return.
init(name: String)
}
@@ -0,0 +1,32 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 defines decodable models containing the `key` and `name` properties.
protocol KeyNameModel: Sendable {
// MARK: Properties
/// A key.
var key: String { get }
/// A name.
var name: String { get }
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.Tuple)
}
@@ -0,0 +1,42 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 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()
}
}
@@ -0,0 +1,449 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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
import OpenAPIURLSession
/// A type that implements a live client to the online service.
public struct AmiiboLiveClient: Sendable {
// MARK: Properties
/// A client generated by the `OpenAPIRuntime` library.
private let client: Client
// MARK: Initializers
/// Initializes this client.
/// - Parameter transport: A transport that performs HTTP operations.
public init(transport: any ClientTransport = URLSessionTransport()) {
self.client = .init(
// The force unwrapping implemented below assumes that the server definition from the OpenAPI specification is correct.
serverURL: try! Servers.Server1.url(),
configuration: .init(dateTranscoder: ISOTimestampTranscoder()),
transport: transport
)
}
}
// 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 (?).
extension AmiiboLiveClient: AmiiboClient {
// MARK: Functions
#if swift(>=6.0)
/// 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(AmiiboServiceError) -> [Amiibo] {
try await fetchAmiibos(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(
by filter: AmiiboSeriesFilter
) async throws(AmiiboServiceError) -> [AmiiboSeries] {
try await fetchAmiiboSeries(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(
by filter: AmiiboTypeFilter
) async throws(AmiiboServiceError) -> [AmiiboType] {
try await fetchAmiiboTypes(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(
by filter: GameCharacterFilter
) async throws(AmiiboServiceError) -> [GameCharacter] {
try await fetchGameCharacters(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(
by filter: GameSeriesFilter
) async throws(AmiiboServiceError) -> [GameSeries] {
try await fetchGameSeries(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(AmiiboServiceError) -> Date {
try await fetchLastUpdated()
}
#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] {
try await fetchAmiibos(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(
by filter: AmiiboSeriesFilter
) async throws -> [AmiiboSeries] {
try await fetchAmiiboSeries(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(
by filter: AmiiboTypeFilter
) async throws -> [AmiiboType] {
try await fetchAmiiboTypes(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(
by filter: GameCharacterFilter
) async throws -> [GameCharacter] {
try await fetchGameCharacters(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(
by filter: GameSeriesFilter
) async throws -> [GameSeries] {
try await fetchGameSeries(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 fetchLastUpdated()
}
#endif
}
// MARK: - Helpers
private extension AmiiboLiveClient {
// MARK: Functions
/// Fetches 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 fetched amiibo items filtered, if requested.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchAmiibos(
_ filter: AmiiboFilter
) async throws -> [Amiibo] {
let response: Operations.getAmiibos.Output
do {
response = try await client.getAmiibos(.init(query: .init(
id: filter.identifier,
head: filter.head,
tail: filter.tail,
name: filter.name,
_type: filter.type,
amiiboSeries: filter.series,
character: filter.gameCharacter,
gameseries: filter.gameSeries,
showgames: filter.showGames,
showusage: filter.showUsage
)))
} catch {
try handle(error: error)
}
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:
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 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 fetched amiibo series filtered, if requested.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchAmiiboSeries(
_ 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 {
try handle(error: error)
}
switch response {
case let .ok(ok):
switch ok.body {
case let .json(output):
switch output.amiibo {
case let .AmiiboSeries(payload):
return [AmiiboSeries(payload.value1)]
case let .AmiiboSeriesList(list):
return list
.map { AmiiboSeries($0.value1) }
.sorted { $0.key < $1.key }
}
}
case .badRequest:
throw AmiiboServiceError.badRequest
case .internalServerError:
throw AmiiboServiceError.notAvailable
case .notFound:
throw AmiiboServiceError.notFound
case let .undocumented(statusCode, _):
throw AmiiboServiceError.undocumented(statusCode)
}
}
/// Fetches 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 fetched amiibo types filtered, if requested.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchAmiiboTypes(
_ 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 {
try handle(error: error)
}
switch response {
case let .ok(ok):
switch ok.body {
case let .json(output):
switch output.amiibo {
case let .AmiiboType(payload):
return [AmiiboType(payload.value1)]
case let .AmiiboTypeList(list):
return list
.map { AmiiboType($0.value1) }
.sorted { $0.key < $1.key }
}
}
case .badRequest:
throw AmiiboServiceError.badRequest
case .internalServerError:
throw AmiiboServiceError.notAvailable
case .notFound:
throw AmiiboServiceError.notFound
case let .undocumented(statusCode, _):
throw AmiiboServiceError.undocumented(statusCode)
}
}
/// Fetches 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 fetched game characters filtered, if requested.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchGameCharacters(
_ 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 {
try handle(error: error)
}
switch response {
case let .ok(ok):
switch ok.body {
case let .json(output):
switch output.amiibo {
case let .GameCharacter(payload):
return [GameCharacter(payload.value1)]
case let .GameCharacterList(list):
return list
.map { GameCharacter($0.value1) }
.sorted { $0.key < $1.key }
}
}
case .badRequest:
throw AmiiboServiceError.badRequest
case .internalServerError:
throw AmiiboServiceError.notAvailable
case .notFound:
throw AmiiboServiceError.notFound
case let .undocumented(statusCode, _):
throw AmiiboServiceError.undocumented(statusCode)
}
}
/// Fetches 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 fetched game series filtered, if requested.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchGameSeries(
_ 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 {
try handle(error: error)
}
switch response {
case let .ok(ok):
switch ok.body {
case let .json(output):
switch output.amiibo {
case let .GameSeries(payload):
return [GameSeries(payload.value1)]
case let .GameSeriesList(list):
return list
.map { GameSeries($0.value1) }
.sorted { $0.key < $1.key }
}
}
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.
/// - Returns: A fetched last updated date.
/// - Throws: An ``AmiiboServiceError`` error in case some issue is encountered while generating the result.
func fetchLastUpdated() async throws -> Date {
let response: Operations.getLastUpdated.Output
do {
response = try await client.getLastUpdated()
} catch {
try handle(error: error)
}
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)
}
}
/// Maps a given error to a `AmiiboServiceError` error.
/// - Parameter error: An error to map.
/// - Throws: An ``AmiiboServiceError`` error.
func handle(error: any Error) throws -> Never {
switch error {
case is CancellationError:
throw AmiiboServiceError.cancelled
case let clientError as ClientError:
switch clientError.underlyingError {
case is DecodingError:
throw AmiiboServiceError.decoding
case let urlError as URLError:
switch urlError.code {
case .cannotFindHost,
.cannotConnectToHost,
.dnsLookupFailed,
.networkConnectionLost,
.notConnectedToInternet,
.timedOut:
throw AmiiboServiceError.notAvailable
default:
throw AmiiboServiceError.unknown
}
default:
throw AmiiboServiceError.unknown
}
default:
throw AmiiboServiceError.unknown
}
}
}
@@ -0,0 +1,35 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 representation of all the possible errors that the ``AmiiboService`` service could throw.
public enum AmiiboServiceError: Error {
/// A bad request has been given to the client.
case badRequest
/// A call to an endpoint has been cancelled by the user.
case cancelled
/// A response cannot be decoded.
case decoding
/// An online service is not currently available.
case notAvailable
/// A response cannot be found.
case notFound
/// An undocumented/unsupported status code error.
case undocumented(_ statusCode: Int)
/// An unknown error.
case unknown
}
// MARK: - Equatable
extension AmiiboServiceError: Equatable {}
@@ -0,0 +1,88 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 type that contains values to fine-tune a response when requesting amiibo items.
public struct AmiiboFilter: Sendable {
// MARK: Properties
/// A game character to filter the result, if any.
public let gameCharacter: String?
/// A game series to filter the result, if any.
public let gameSeries: String?
/// A first part of an identifier to filter the result, if any.
public let head: String?
/// An amiibo identifier to filter the result, if any.
public let identifier: String?
/// An amiibo name to filter the result, if any.
public let name: String?
/// An amiibo series to filter the result, if any.
public let series: String?
/// A flag indicating whether to include games in the response, if any.
public let showGames: Bool?
/// A flag indicating whether to include amiibo usages in games in the response, if any.
public let showUsage: Bool?
/// A last part of an identifier to filter the result, if any.
public let tail: String?
/// An amiibo type to filter the result, if any.
public let type: String?
// MARK: Initializers
/// Initializes this filter.
/// - Parameters:
/// - head: A first part of an identifier to filter the result, if any.
/// - tail: A last part of an identifier to filter the result, if any.
/// - identifier: An amiibo identifier to filter the result, if any.
/// - name: An amiibo name to filter the result, if any.
/// - type: An amiibo type to filter the result, if any.
/// - series: An amiibo series to filter the result, if any.
/// - gameCharacter: A game character to filter the result, if any.
/// - gameSeries: A game series to filter the result, if any.
/// - showGames: A flag indicating whether to include games in the response, if any.
/// - showUsage: A flag indicating whether to include amiibo usages in games in the response, if any.
public init(
head: String? = nil,
tail: String? = nil,
identifier: String? = nil,
name: String? = nil,
type: String? = nil,
series: String? = nil,
gameCharacter: String? = nil,
gameSeries: String? = nil,
showGames: Bool? = nil,
showUsage: Bool? = nil
) {
self.gameCharacter = gameCharacter
self.gameSeries = gameSeries
self.head = head
self.identifier = identifier
self.name = name
self.series = series
self.showGames = showGames
self.showUsage = showUsage
self.tail = tail
self.type = type
}
}
@@ -0,0 +1,50 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 type that contains values to fine-tune a response when requesting amiibo series.
public struct AmiiboSeriesFilter: 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 (?).
// MARK: Properties
/// A key to return, if any.
public let key: String?
/// A name to return, if any.
public let name: String?
// MARK: Initializers
/// Initializes this filter without key or name values.
public init() {
self.key = nil
self.name = nil
}
/// Initializes this filter with a key value.
/// - Parameter key: A key to return.
public init(key: String) {
self.key = key
self.name = nil
}
/// Initializes this filter with a name value.
/// - Parameter name: A name to return.
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -0,0 +1,50 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 type that contains values to fine-tune a response when requesting amiibo types.
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 (?).
// MARK: Properties
/// A key to return, if any.
public let key: String?
/// A name to return, if any.
public let name: String?
// MARK: Initializers
/// Initializes this filter without key or name values.
public init() {
self.key = nil
self.name = nil
}
/// Initializes this filter with a key value.
/// - Parameter key: A key to return.
public init(key: String) {
self.key = key
self.name = nil
}
/// Initializes this filter with a name value.
/// - Parameter name: A name to return.
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -0,0 +1,50 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 type that contains values to fine-tune a response when requesting game characters.
public struct GameCharacterFilter: 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 (?).
// MARK: Properties
/// A key to return, if any.
public let key: String?
/// A name to return, if any.
public let name: String?
// MARK: Initializers
/// Initializes this filter without key or name values.
public init() {
self.key = nil
self.name = nil
}
/// Initializes this filter with a key value.
/// - Parameter key: A key to return.
public init(key: String) {
self.key = key
self.name = nil
}
/// Initializes this filter with a name value.
/// - Parameter name: A name to return.
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -0,0 +1,50 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 type that contains values to fine-tune a response when requesting game series.
public struct GameSeriesFilter: 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 (?).
// MARK: Properties
/// A key to return, if any.
public let key: String?
/// A name to return, if any.
public let name: String?
// MARK: Initializers
/// Initializes this filter without key or name values.
public init() {
self.key = nil
self.name = nil
}
/// Initializes this filter with a key value.
/// - Parameter key: A key to return.
public init(key: String) {
self.key = key
self.name = nil
}
/// Initializes this filter with a name value.
/// - Parameter name: A name to return.
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -1,34 +1,58 @@
//===----------------------------------------------------------------------=== // ===----------------------------------------------------------------------===
// //
// This source file is part of the AmiiboAPI open source project // This source file is part of the Amiibo Service open source project
// //
// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors // Copyright (c) 2025 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.
public struct Amiibo: Sendable { public struct Amiibo: Sendable {
// MARK: Properties // MARK: Properties
/// A game character.
public let gameCharacter: String public let gameCharacter: String
/// A game series.
public let gameSeries: String public let gameSeries: String
/// The first 8 hexadecimal characters of an identifier.
public let head: String public let head: String
/// An image link.
public let image: String public let image: String
/// An amiibo name.
public let name: String public let name: String
/// A game platform type, if any.
public let platform: Platform? public let platform: Platform?
/// A release date.
public let release: Release public let release: Release
/// An amiibo series.
public let series: String public let series: String
/// The last 8 hexadecimal characters of an identifier.
public let tail: String public let tail: String
/// An amiibo type.
public let type: String public let type: String
// MARK: Initialisers // MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.Amiibo) { init(_ payload: Components.Schemas.Amiibo) {
self.gameCharacter = payload.character self.gameCharacter = payload.character
self.gameSeries = payload.gameSeries self.gameSeries = payload.gameSeries
@@ -48,10 +72,12 @@ public struct Amiibo: Sendable {
// MARK: Computed // MARK: Computed
/// An identifier.
public var identifier: String { public var identifier: String {
head + tail head + tail
} }
/// A URL related to an image link, if any.
public var imageURL: URL? { public var imageURL: URL? {
.init(string: image) .init(string: image)
} }
@@ -0,0 +1,47 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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
//
// ===----------------------------------------------------------------------===
extension Amiibo {
/// A model that represents a game related to an amiibo item.
public struct Game: Sendable {
// MARK: Properties
/// A list of identifiers.
public let identifiers: [String]
/// A name.
public let name: String
/// A list of amiibo usages, if any.
public let usages: [Usage]?
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.AmiiboGame) {
self.identifiers = payload.gameID
self.name = payload.gameName
self.usages = {
guard let usages = payload.amiiboUsage else {
return nil
}
return usages.map { .init($0) }
}()
}
}
}
@@ -1,26 +1,42 @@
//===----------------------------------------------------------------------=== // ===----------------------------------------------------------------------===
// //
// This source file is part of the AmiiboAPI open source project // This source file is part of the Amiibo Service open source project
// //
// Copyright (c) 2024 Röck+Cöde VoF. and the AmiiboAPI project authors // Copyright (c) 2025 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.
public struct Platform: Sendable { public struct Platform: Sendable {
// MARK: Properties // MARK: Properties
/// A list of `Switch` games related to an amiibo item.
public let `switch`: [Game] public let `switch`: [Game]
/// A list of `3DS` games related to an amiibo item.
public let threeDS: [Game] public let threeDS: [Game]
/// A list of `WiiU` games related to an amiibo item.
public let wiiU: [Game] public let wiiU: [Game]
// MARK: Initialisers // MARK: Initialisers
/// Initializes this model.
///
/// > important: In case no data is provided, then an instance of this model is not created.
///
/// - Parameters:
/// - switch: A list of `Switch` games related to an amiibo item, if any.
/// - threeDS: A list of `3DS` games related to an amiibo item, if any.
/// - wiiU: A list of `WiiU` games related to an amiibo item, if any.
init?( init?(
_ `switch`: [Components.Schemas.AmiiboGame]?, _ `switch`: [Components.Schemas.AmiiboGame]?,
_ threeDS: [Components.Schemas.AmiiboGame]?, _ threeDS: [Components.Schemas.AmiiboGame]?,
@@ -0,0 +1,47 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 Amiibo {
/// A model that represents a collection of release dates related to an amiibo item.
public struct Release: Sendable {
// MARK: Properties
/// A release date for North America, if any.
public let america: Date?
/// A release date for Australia, if any.
public let australia: Date?
/// A release date for Europe, if any.
public let europe: Date?
/// A release date for Japan, if any.
public let japan: Date?
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.AmiiboRelease) {
self.america = payload.na
self.australia = payload.au
self.europe = payload.eu
self.japan = payload.jp
}
}
}
@@ -0,0 +1,37 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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
//
// ===----------------------------------------------------------------------===
extension Amiibo {
/// A model that represents the usage of an amiibo item within a certain game.
public struct Usage: Sendable {
// MARK: Properties
/// An explanation of how to use an amiibo item.
public let explanation: String
/// A flag that indicates whether an amiibo item can save game data in it.
public let isWriteable: Bool
// MARK: Initializers
/// Initializes this model from a given payload.
/// - Parameter payload: A payload that contains the values for the model.
init(_ payload: Components.Schemas.AmiiboUsage) {
self.explanation = payload.Usage
self.isWriteable = payload.write
}
}
}
@@ -0,0 +1,35 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 model that represents an amiibo series.
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
/// A key.
public let key: String
/// A name.
public let name: String
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
@@ -0,0 +1,35 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 model that represents an amiibo type.
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
/// A key.
public let key: String
/// A name.
public let name: String
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
@@ -0,0 +1,35 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 model that represents a game character.
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
/// A key.
public let key: String
/// A name.
public let name: String
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
@@ -0,0 +1,35 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 model that represents a game series.
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
/// A key.
public let key: String
/// A name.
public let name: String
// MARK: Initializers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
@@ -0,0 +1,94 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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
/// A protocol that defines API clients containing all available endpoints to interact with.
public protocol AmiiboClient {
// MARK: Functions
#if swift(>=6.0)
/// 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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(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
}
@@ -0,0 +1,151 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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
/// A type that implements the service that uses a client to make calls.
public struct AmiiboService {
// MARK: Properties
/// A client to interact with the endpoints.
private let client: any AmiiboClient
// MARK: Initializers
/// Initializes this service with a specific client type.
/// - Parameter client: A client to use to interact with the endpoints.
public init(client: some AmiiboClient = AmiiboLiveClient()) {
self.client = client
}
// MARK: Functions
#if swift(>=6.0)
/// 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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> [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(AmiiboServiceError) -> Date {
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
}
@@ -0,0 +1,19 @@
## ===----------------------------------------------------------------------===
##
## This source file is part of the Amiibo Service open source project
##
## Copyright (c) 2025 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
##
## ===----------------------------------------------------------------------===
generate:
- types
- client
namingStrategy: defensive
accessModifier: internal
+603
View File
@@ -0,0 +1,603 @@
## ===----------------------------------------------------------------------===
##
## This source file is part of the Amiibo Service open source project
##
## Copyright (c) 2025 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
##
## ===----------------------------------------------------------------------===
openapi: '3.1.1'
info:
title: Amiibo API
summary: A RESTFul API for Amiibo.
description: |
# Information
The [AmiiboAPI](https://www.amiiboapi.com) 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: v1.0.0
termsOfService: https://www.amiiboapi.com/docs/#termscondition
contact:
name: FAQ
url: https://www.amiiboapi.com/faq/
license:
name: MIT license
identifier: MIT
externalDocs:
url: https://www.amiiboapi.com/docs
description: Amiibo API documentation
servers:
- url: https://www.amiiboapi.com/api
description: Live service
tags:
- name: Amiibo
description: Amiibo-related endpoints.
- name: Game
description: Game-related endpoints.
- name: Service
description: Service-related endpoints.
paths:
/amiibo:
get:
summary: Get a list of amiibos.
description: |
Get a list of all the Amiibo items available in the database.
Please refer to [the documentation of the endpoint](https://www.amiiboapi.com/docs/#amiibo) for further information.
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:
'200':
description: Successful response returning an object that contains none, one or more amiibos.
content:
application/json:
schema:
$ref: '#/components/schemas/AmiiboWrapper'
'400':
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Service is not available.
/amiiboseries:
get:
tags:
- Amiibo
summary: Get the amiibo series.
description: |
Get a list of all the Amiibo series available in the database.
Please refer to [the documentation of the endpoint](https://www.amiiboapi.com/docs/#series) for further information.
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 key to include in the response.
responses:
'200':
description: Successful response returning an object that contains one or more amiibo series.
content:
application/json:
schema:
$ref: '#/components/schemas/AmiiboSeriesWrapper'
'400':
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Service is not available.
/character:
get:
tags:
- Game
summary: Get the game characters.
description: |
Get a list of all the game characters available in the database.
Please refer to [the documentation of the endpoint](https://www.amiiboapi.com/docs/#character) for further information.
operationId: getGameCharacters
parameters:
- $ref: '#/components/parameters/Key'
description: A key of a game character key to include in the response.
- $ref: '#/components/parameters/Name'
description: A name of a game character key to include in the response.
responses:
'200':
description: Successful response returning an object that contains one or more game characters.
content:
application/json:
schema:
$ref: '#/components/schemas/GameCharacterWrapper'
'400':
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Service is not available.
/gameseries:
get:
tags:
- Game
summary: Get the game series.
description: |
Gets a list of all the Game series available in the database.
Please refer to [the documentation of the endpoint](https://www.amiiboapi.com/docs/#gameSeries) for further information.
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:
'200':
description: Successful response returning an object that contains one or more game series.
content:
application/json:
schema:
$ref: '#/components/schemas/GameSeriesWrapper'
'400':
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Service is not available.
/type:
get:
tags:
- Amiibo
summary: Get the amiibo types.
description: |
Gets a list of all the amiibo types available in the database.
Please refer to [the documentation of the endpoint](https://www.amiiboapi.com/docs/#type) for further information.
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:
'200':
description: Successful response returning an object that contains one or more amiibo types.
content:
application/json:
schema:
$ref: '#/components/schemas/AmiiboTypeWrapper'
'400':
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Service is not available.
/lastupdated:
get:
tags:
- Service
summary: Get the date of last updated.
description: |
Gets an ISO-formatted date+time when the Amiibo data was last updated.
Please refer to [the documentation of the endpoint](https://www.amiiboapi.com/docs/#lastUpdated) for further information.
operationId: getLastUpdated
responses:
'200':
description: Successful response returning an object that contains a date and time when the database was last updated.
content:
application/json:
schema:
$ref: '#/components/schemas/LastUpdated'
'500':
description: Service is not available.
components:
parameters:
AmiiboSeries:
description: An identifier or name of an amiibo series to include in the response
name: amiiboSeries
in: query
required: false
schema:
type: string
AmiiboType:
description: An identifier or a name of an amiibo type to inclulde in the response.
name: type
in: query
required: false
schema:
type: string
GameCharacter:
description: An identifier or name of a game character to include in the response.
name: character
in: query
required: false
schema:
type: string
GameSeries:
description: An identifier or name of a game series to include in the response.
name: gameseries
in: query
required: false
schema:
type: string
Identifier:
description: An identifier of an amiibo to include in the response.
name: id
in: query
required: false
schema:
type: string
maxLength: 18
IdentifierHead:
description: A first part for an identifier of an amiibo to include the response.
name: head
in: query
required: false
schema:
type: string
maxLength: 10
IdentifierTail:
description: A last part for an identifier of an amiibo to include the response.
name: tail
in: query
required: false
schema:
type: string
maxLength: 10
Key:
description: A key of a type to include in the response.
name: key
in: query
required: false
schema:
type: string
Name:
description: A name of a type to include in the response.
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: One or more incorrect parameters have been sent.
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceError'
NotFound:
description: No resource has been found.
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceError'
schemas:
# Core Entities
Amiibo:
description: A type that represents an amiibo.
type: object
properties:
amiiboSeries:
description: A name of a series an amiibo belongs to.
type: string
character:
description: |
A name of a character of an amiibo.
Multiple character have different amiibo design.
type: string
gameSeries:
description: A name of a game series an amiibo belongs to.
type: string
games3DS:
description: A list of 3DS games an amiibo could be used in, if any.
type: array
items:
$ref: '#/components/schemas/AmiiboGame'
gamesSwitch:
description: A list of Switch games an amiibo could be used in, if any.
type: array
items:
$ref: '#/components/schemas/AmiiboGame'
gamesWiiU:
description: A list of Wii U games an amiibo could be used in, if any.
type: array
items:
$ref: '#/components/schemas/AmiiboGame'
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
maxLength: 8
image:
description: An image URL related to an amiibo.
type: string
format: uri
name:
description: A name of an Amiibo.
type: string
release:
description: A type that contains the release dates of an amiibo, if any.
$ref: '#/components/schemas/AmiiboRelease'
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
maxLength: 8
type:
description: A name for the type an amiibo belongs to.
type: string
required:
- amiiboSeries
- character
- gameSeries
- head
- image
- name
- release
- tail
- type
AmiiboGame:
description: A type that represents a game in which an amiibo is related to.
type: object
properties:
amiiboUsage:
description: A list of available usages an amiibo have in a game, if any.
type: array
items:
$ref: '#/components/schemas/AmiiboUsage'
gameID:
description: A list of identifiers of a game an amiibo is related to.
type: array
items:
type: string
gameName:
description: A name of a game an amiibo is related to.
type: string
required:
- gameID
- gameName
AmiiboRelease:
description: A type that contains the release dates of an amiibo throughout the world.
type: object
properties:
au:
description: A release date for Australia, if any.
type: string
format: date-time
eu:
description: A release date for Europe, if any.
type: string
format: date-time
jp:
description: A release date for Japan, if any.
type: string
format: date-time
na:
description: A release date for North America, if any.
type: string
format: date-time
AmiiboSeries:
description: A type that represents an amiibo series.
allOf:
- $ref: '#/components/schemas/Tuple'
- type: object
properties:
key:
description: A key of an amiibo series.
name:
description: A name of an amiibo series.
AmiiboType:
description: A type that represents an amiibo type.
allOf:
- $ref: '#/components/schemas/Tuple'
- type: object
properties:
key:
description: A key of an amiibo type.
name:
description: A name of an amiibo type.
AmiiboUsage:
description: A type that represents a use of an amiibo in a game.
type: object
properties:
Usage:
description: An explanation of the usage of an amiibo in a game.
type: string
write:
description: A flag that indicates whether the data in an amiibo is writable or not.
type: boolean
required:
- Usage
- write
GameCharacter:
description: A type that represents a game character.
allOf:
- $ref: '#/components/schemas/Tuple'
- type: object
properties:
key:
description: A key of a game character.
name:
description: A name of a game character.
GameSeries:
description: A type that represents a game series.
allOf:
- $ref: '#/components/schemas/Tuple'
- type: object
properties:
key:
description: A key of a game series.
name:
description: A name of a game series.
LastUpdated:
description: A type that informs when the data in the service was last updated.
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
Tuple:
description: |
A type that is conformed only by the `key` and `name` properties.
This type represents either `AmiiboSeries`, `AmiiboType`, `GameCharacter`, and `GameSeries` types.
type: object
properties:
key:
description: A key assigned to a tuple.
type: string
name:
description: A name assigned to a tuple.
type: string
required:
- key
- name
# List Entities
AmiiboList:
description: A type that contains a list of amiibos.
type: array
items:
$ref: '#/components/schemas/Amiibo'
AmiiboSeriesList:
description: A type that represents a list of amiibo series.
type: array
items:
$ref: '#/components/schemas/AmiiboSeries'
AmiiboTypeList:
description: A type that represents a list of amiibo types.
type: array
items:
$ref: '#/components/schemas/AmiiboType'
GameCharacterList:
description: A type that represents a list of game characters.
type: array
items:
$ref: '#/components/schemas/GameCharacter'
GameSeriesList:
description: A type that represents a list of game series.
type: array
items:
$ref: '#/components/schemas/GameSeries'
# Wrapper Entities
AmiiboWrapper:
description: A type that wraps either none, one or a list of amiibos.
type: object
properties:
amiibo:
description: A container that have zero, one or more amiibos.
oneOf:
- $ref: '#/components/schemas/Amiibo'
- $ref: '#/components/schemas/AmiiboList'
AmiiboSeriesWrapper:
description: A type that wraps either one or a list of amiibo series.
type: object
properties:
amiibo:
description: A container that have one or more amiibo series.
oneOf:
- $ref: '#/components/schemas/AmiiboSeries'
- $ref: '#/components/schemas/AmiiboSeriesList'
required:
- amiibo
AmiiboTypeWrapper:
description: A type that wraps either one or a list of amiibo types.
type: object
properties:
amiibo:
description: A container that have one or more amiibo types.
oneOf:
- $ref: '#/components/schemas/AmiiboType'
- $ref: '#/components/schemas/AmiiboTypeList'
required:
- amiibo
GameCharacterWrapper:
description: A type that wraps either one or a list of game characters.
type: object
properties:
amiibo:
description: A container that have one or more game characters.
oneOf:
- $ref: '#/components/schemas/GameCharacter'
- $ref: '#/components/schemas/GameCharacterList'
required:
- amiibo
GameSeriesWrapper:
description: A type that wraps either one or a list of game series.
type: object
properties:
amiibo:
description: A container that have one or more game series.
oneOf:
- $ref: '#/components/schemas/GameSeries'
- $ref: '#/components/schemas/GameSeriesList'
required:
- amiibo
# Error Entities
ServiceError:
description: A type that represents an error provided by the service.
type: object
properties:
code:
description: A number of an error code.
type: integer
error:
description: An explanation of an error.
type: string
required:
- code
- error
@@ -1,29 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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 OpenAPIURLSession
extension Client {
// MARK: Constants
static var live: Client {
get throws {
.init(
serverURL: try Servers.server1(),
configuration: .init(dateTranscoder: ISODateTranscoder()),
transport: URLSessionTransport()
)
}
}
}
@@ -1,26 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
extension DateFormatter {
static var isoDateTime: DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
formatter.timeZone = .init(secondsFromGMT: 0)
return formatter
}
}
@@ -1,26 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
public protocol APIClient {
// MARK: Functions
func getAmiibos(by filter: AmiiboFilter) async throws -> [Amiibo]
func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws -> [AmiiboSeries]
func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws -> [AmiiboType]
func getGameCharacters(by filter: GameCharacterFilter) async throws -> [GameCharacter]
func getGameSeries(by filter: GameSeriesFilter) async throws -> [GameSeries]
func getLastUpdated() async throws -> Date
}
@@ -1,26 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
protocol KeyNameFilter {
// MARK: Properties
var key: String? { get }
var name: String? { get }
// MARK: Initialisers
init()
init(key: String)
init(name: String)
}
@@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
protocol KeyNameModel: Sendable {
// MARK: Properties
var key: String { get }
var name: String { get }
// MARK: Initialisers
init(_ payload: Components.Schemas.Tuple)
}
@@ -1,31 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
struct ISODateTranscoder: DateTranscoder {
// MARK: Properties
private let dateFormatter: DateFormatter = .isoDateTime
// MARK: Functions
func encode(_ date: Date) throws -> String {
dateFormatter.string(from: date)
}
func decode(_ string: String) throws -> Date {
dateFormatter.date(from: string) ?? .init()
}
}
@@ -1,248 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
import OpenAPIURLSession
public struct AmiiboLiveClient {
// MARK: Properties
private let client: Client
// MARK: Initialisers
public init() throws {
self.client = .init(
serverURL: try Servers.server1(),
configuration: .init(dateTranscoder: ISODateTranscoder()),
transport: URLSessionTransport()
)
}
}
// MARK: - APIProtocol
extension AmiiboLiveClient: APIClient {
// MARK: Functions
public func getAmiibos(by filter: AmiiboFilter) async throws -> [Amiibo] {
let response = try await {
do {
return 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 {
guard let _ = error.underlyingError as? DecodingError else {
throw AmiiboServiceError.unknown
}
throw AmiiboServiceError.decoding
} 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)
}
}
public func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws -> [AmiiboSeries] {
let response = 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):
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)
}
}
public func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws -> [AmiiboType] {
let response = try await client.getAmiiboTypes(
.init(query: .init(
key: filter.key,
name: filter.name
))
)
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)
}
}
public func getGameCharacters(by filter: GameCharacterFilter) async throws -> [GameCharacter] {
let response = 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):
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)
}
}
public func getGameSeries(by filter: GameSeriesFilter) async throws -> [GameSeries] {
let response = 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):
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)
}
}
public func getLastUpdated() async throws -> Date {
let response = try await client.getLastUpdated()
switch response {
case let .ok(ok):
switch ok.body {
case let .json(output):
return output.lastUpdated
}
case let .undocumented(statusCode, _):
throw AmiiboServiceError.undocumented(statusCode)
}
}
}
// MARK: - Helpers
private extension AmiiboLiveClient {
// MARK: Functions
func map(_ wrapper: Components.Schemas.AmiiboWrapper) -> [Amiibo] {
switch wrapper.amiibo {
case let .Amiibo(object):
return [.init(object)]
case let .AmiiboList(list):
return list
.map { .init($0) }
.sorted { $0.identifier < $1.identifier }
}
}
func map<Model: KeyNameModel>(
_ wrapper: Components.Schemas.TupleWrapper,
as: Model.Type
) -> [Model] {
switch wrapper.amiibo {
case let .Tuple(payload):
return [.init(payload)]
case let .TupleList(list):
return list
.map { .init($0) }
.sorted { $0.key < $1.key }
}
}
}
@@ -1,130 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
public struct AmiiboMockClient {
// MARK: Properties
private let amiibos: [Amiibo]?
private let amiiboSeries: [AmiiboSeries]?
private let amiiboTypes: [AmiiboType]?
private let error: AmiiboServiceError?
private let gameCharacters: [GameCharacter]?
private let gameSeries: [GameSeries]?
private let lastUpdated: Date?
// MARK: Initialisers
public 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: - APIClient
extension AmiiboMockClient: APIClient {
// MARK: Functions
public func getAmiibos(by filter: AmiiboFilter) async throws -> [Amiibo] {
try throwErrorIfExists()
guard let amiibos else {
throw AmiiboServiceError.notFound
}
return amiibos
}
public func getAmiiboSeries(by filter: AmiiboSeriesFilter) async throws -> [AmiiboSeries] {
try throwErrorIfExists()
guard let amiiboSeries else {
throw AmiiboServiceError.notFound
}
return amiiboSeries
}
public func getAmiiboTypes(by filter: AmiiboTypeFilter) async throws -> [AmiiboType] {
try throwErrorIfExists()
guard let amiiboTypes else {
throw AmiiboServiceError.notFound
}
return amiiboTypes
}
public func getGameCharacters(by filter: GameCharacterFilter) async throws -> [GameCharacter] {
try throwErrorIfExists()
guard let gameCharacters else {
throw AmiiboServiceError.notFound
}
return gameCharacters
}
public func getGameSeries(by filter: GameSeriesFilter) async throws -> [GameSeries] {
try throwErrorIfExists()
guard let gameSeries else {
throw AmiiboServiceError.notFound
}
return gameSeries
}
public func getLastUpdated() async throws -> Date {
try throwErrorIfExists()
guard let lastUpdated else {
throw AmiiboServiceError.notFound
}
return lastUpdated
}
}
// MARK: - Helpers
private extension AmiiboMockClient {
// MARK: Functions
func throwErrorIfExists() throws {
if let error {
throw error
}
}
}
@@ -1,24 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public enum AmiiboServiceError: Error {
case badRequest
case decoding
case notAvailable
case notFound
case undocumented(_ statusCode: Int)
case unknown
}
// MARK: - Equatable
extension AmiiboServiceError: Equatable {}
-48
View File
@@ -1,48 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct AmiiboFilter {
// MARK: Properties
public let gameCharacter: String?
public let gameSeries: String?
public let identifier: String?
public let name: String?
public let series: String?
public let showGames: Bool?
public let showUsage: Bool?
public let type: String?
// MARK: Initialisers
public init(
identifier: String? = nil,
name: String? = nil,
type: String? = nil,
series: String? = nil,
gameCharacter: String? = nil,
gameSeries: String? = nil,
showGames: Bool? = nil,
showUsage: Bool? = nil
) {
self.gameCharacter = gameCharacter
self.gameSeries = gameSeries
self.identifier = identifier
self.name = name
self.series = series
self.showGames = showGames
self.showUsage = showUsage
self.type = type
}
}
@@ -1,37 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct AmiiboSeriesFilter: KeyNameFilter {
// MARK: Properties
public let key: String?
public let name: String?
// MARK: Initialisers
public init() {
self.key = nil
self.name = nil
}
public init(key: String) {
self.key = key
self.name = nil
}
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -1,37 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct AmiiboTypeFilter: KeyNameFilter {
// MARK: Properties
public let key: String?
public let name: String?
// MARK: Initialisers
public init() {
self.key = nil
self.name = nil
}
public init(key: String) {
self.key = key
self.name = nil
}
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -1,37 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct GameCharacterFilter: KeyNameFilter {
// MARK: Properties
public let key: String?
public let name: String?
// MARK: Initialisers
public init() {
self.key = nil
self.name = nil
}
public init(key: String) {
self.key = key
self.name = nil
}
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -1,37 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct GameSeriesFilter: KeyNameFilter {
// MARK: Properties
public let key: String?
public let name: String?
// MARK: Initialisers
public init() {
self.key = nil
self.name = nil
}
public init(key: String) {
self.key = key
self.name = nil
}
public init(name: String) {
self.key = nil
self.name = name
}
}
@@ -1,37 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
extension Amiibo {
public struct Game: Sendable {
// MARK: Properties
public let identifiers: [String]
public let name: String
public let usages: [Usage]?
// MARK: Initialisers
init(_ payload: Components.Schemas.AmiiboGame) {
self.identifiers = payload.gameID
self.name = payload.gameName
self.usages = {
guard let usages = payload.amiiboUsage else {
return nil
}
return usages.map { .init($0) }
}()
}
}
}
@@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
extension Amiibo {
public struct Release: Sendable {
// MARK: Properties
public let america: Date?
public let australia: Date?
public let europe: Date?
public let japan: Date?
// MARK: Initialisers
init(_ payload: Components.Schemas.AmiiboRelease) {
self.america = payload.na
self.australia = payload.au
self.europe = payload.eu
self.japan = payload.jp
}
}
}
@@ -1,29 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
extension Amiibo {
public struct Usage: Sendable {
// MARK: Properties
public let explanation: String
public let isWriteable: Bool
// MARK: Initialisers
init(_ payload: Components.Schemas.AmiiboUsage) {
self.explanation = payload.Usage
self.isWriteable = payload.write
}
}
}
-27
View File
@@ -1,27 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct AmiiboSeries: KeyNameModel {
// MARK: Properties
public let key: String
public let name: String
// MARK: Initialisers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
-27
View File
@@ -1,27 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct AmiiboType: KeyNameModel {
// MARK: Properties
public let key: String
public let name: String
// MARK: Initialisers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
-27
View File
@@ -1,27 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct GameCharacter: KeyNameModel {
// MARK: Properties
public let key: String
public let name: String
// MARK: Initialisers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
-27
View File
@@ -1,27 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
//
//===----------------------------------------------------------------------===
public struct GameSeries: KeyNameModel {
// MARK: Properties
public let key: String
public let name: String
// MARK: Initialisers
init(_ payload: Components.Schemas.Tuple) {
self.key = payload.key
self.name = payload.name
}
}
@@ -1,63 +0,0 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the AmiiboAPI open source project
//
// Copyright (c) 2024 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
public struct AmiiboService {
// MARK: Properties
private let client: any APIClient
// MARK: Initialisers
public init(_ client: any APIClient) {
self.client = client
}
// MARK: Functions
public func getAmiibos(
_ filter: AmiiboFilter = .init()
) async throws -> [Amiibo] {
try await client.getAmiibos(by: filter)
}
public func getAmiiboSeries(
_ filter: AmiiboSeriesFilter = .init()
) async throws -> [AmiiboSeries] {
try await client.getAmiiboSeries(by: filter)
}
public func getAmiiboTypes(
_ filter: AmiiboTypeFilter = .init()
) async throws -> [AmiiboType] {
try await client.getAmiiboTypes(by: filter)
}
public func getGameCharacters(
_ filter: GameCharacterFilter = .init()
) async throws -> [GameCharacter] {
try await client.getGameCharacters(by: filter)
}
public func getGameSeries(
_ filter: GameSeriesFilter = .init()
) async throws -> [GameSeries] {
try await client.getGameSeries(by: filter)
}
public func getLastUpdated() async throws -> Date {
try await client.getLastUpdated()
}
}
-16
View File
@@ -1,16 +0,0 @@
# ===----------------------------------------------------------------------===
#
# This source file is part of the AmiiboAPI open source project
#
# Copyright (c) 2024 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
#
# ===----------------------------------------------------------------------===
generate:
- types
- client
accessModifier: internal
-376
View File
@@ -1,376 +0,0 @@
# ===----------------------------------------------------------------------===
#
# This source file is part of the AmiiboAPI open source project
#
# Copyright (c) 2024 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
#
# ===----------------------------------------------------------------------===
openapi: '3.1.0'
info:
title: Amiibo API service
description: The Amiibo API RESTful service.
version: 1.0.0
servers:
- url: https://www.amiiboapi.com/api
description: Amiibo API service (live)
paths:
/amiibo:
get:
description: Get a list of all the Amiibo items available in the database.
operationId: getAmiibos
responses:
'200':
description: Successful response returning the object that contains a list of Amiibo items.
content:
application/json:
schema:
$ref: '#/components/schemas/AmiiboWrapper'
'400':
description: Bad Amiibo request.
parameters:
- name: amiiboSeries
in: query
description: The Amiibo series identifier or name to filter the response.
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:
get:
description: Get a list of all the Amiibo series available in the database.
operationId: getAmiiboSeries
responses:
'200':
description: Successful response returning the object that contains a list of Amiibo series.
content:
application/json:
schema:
$ref: '#/components/schemas/TupleWrapper'
'400':
description: Bad Amiibo series request.
'404':
description: Amiibo series not found.
'500':
description: Service currently not available.
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:
get:
description: Get a list of all the game characters available in the database.
operationId: getGameCharacters
responses:
'200':
description: Successful response returning the object that contains a list of game characters.
content:
application/json:
schema:
$ref: '#/components/schemas/TupleWrapper'
'400':
description: Bad game character request.
'404':
description: Game character not found.
'500':
description: Service currently not available.
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:
get:
description: Gets a list of all the game series available in the database.
operationId: getGameSeries
responses:
'200':
description: Successful response returning the object that contains a list of game series.
content:
application/json:
schema:
$ref: '#/components/schemas/TupleWrapper'
'400':
description: Bad game series request.
'404':
description: Game series not found.
'500':
description: Service currently not available.
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:
get:
description: Gets a list of all the Amiibo types available in the database.
operationId: getAmiiboTypes
responses:
'200':
description: Successful response returning the object that contains a list of Amiibo types.
content:
application/json:
schema:
$ref: '#/components/schemas/TupleWrapper'
'400':
description: Bad Amiibo type request.
'404':
description: Amiibo type not found.
'500':
description: Service currently not available.
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:
get:
description: Gets a timestamp when the Amiibo data was last updated.
operationId: getLastUpdated
responses:
'200':
description: Successful response returning the object that contains the date and time when the database was last updated.
content:
application/json:
schema:
$ref: '#/components/schemas/LastUpdated'
components:
schemas:
Amiibo:
type: object
properties:
amiiboSeries:
type: string
character:
type: string
gameSeries:
type: string
games3DS:
type: array
items:
$ref: '#/components/schemas/AmiiboGame'
gamesSwitch:
type: array
items:
$ref: '#/components/schemas/AmiiboGame'
gamesWiiU:
type: array
items:
$ref: '#/components/schemas/AmiiboGame'
head:
type: string
image:
type: string
name:
type: string
release:
type: object
$ref: '#/components/schemas/AmiiboRelease'
tail:
type: string
type:
type: string
required:
- amiiboSeries
- character
- gameSeries
- head
- image
- name
- release
- tail
- type
AmiiboGame:
type: object
properties:
amiiboUsage:
type: array
items:
$ref: '#/components/schemas/AmiiboUsage'
gameID:
type: array
items:
type: string
gameName:
type: string
required:
- gameID
- gameName
AmiiboList:
type: array
items:
$ref: '#/components/schemas/Amiibo'
AmiiboRelease:
type: object
properties:
au:
type: string
format: date-time
eu:
type: string
format: date-time
jp:
type: string
format: date-time
na:
type: string
format: date-time
AmiiboUsage:
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
properties:
key:
type: string
name:
type: string
required:
- key
- name
TupleList:
type: array
items:
$ref: '#/components/schemas/Tuple'
TupleWrapper:
type: object
properties:
amiibo:
oneOf:
- $ref: '#/components/schemas/Tuple'
- $ref: '#/components/schemas/TupleList'
required:
- amiibo
@@ -0,0 +1,701 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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", .tags(.live))
struct AmiiboServiceLiveTests {
// MARK: Properties
private let service: AmiiboService
// MARK: Initializers
init() {
self.service = .init()
}
// MARK: Functions tests
#if swift(>=6.2)
@Test(arguments: zip(
Input.amiibos,
Output.amiibos
))
func `get amiibos`(
filter: AmiiboFilter,
expects numberOfItems: Int
) async throws {
try await assertAmiibos(
with: filter,
expects: numberOfItems
)
}
@Test(arguments: zip(
Input.amiibosThrows,
Output.amiibosThrows
))
func `get amiibos throws`(
filter: AmiiboFilter,
expects error: AmiiboServiceError
) async throws {
try await assertsAmiibosThrows(
error: error,
when: filter
)
}
@Test(arguments: zip(
Input.amiiboSeries,
Output.amiiboSeries
))
func `get amiibo series`(
filter: AmiiboSeriesFilter,
expects numberOfItems: Int
) async throws {
try await assertAmiiboSeries(
with: filter,
expects: numberOfItems
)
}
@Test(arguments: zip(
Input.amiiboSeriesThrows,
Output.amiiboSeriesThrows
))
func `get amiibo series throws`(
filter: AmiiboSeriesFilter,
expects error: AmiiboServiceError
) async throws {
try await assertsAmiiboSeriesThrows(
error: error,
when: filter
)
}
@Test(arguments: zip(
Input.amiiboTypes,
Output.amiiboTypes
))
func `get amiibo types`(
filter: AmiiboTypeFilter,
expects numberOfItems: Int
) async throws {
try await assertAmiiboTypes(
with: filter,
expects: numberOfItems
)
}
@Test(arguments: zip(
Input.amiiboTypesThrows,
Output.amiiboTypesThrows
))
func `get amiibo types throws`(
filter: AmiiboTypeFilter,
expects error: AmiiboServiceError
) async throws {
try await assertsAmiiboTypesThrows(
error: error,
when: filter
)
}
@Test(arguments: zip(
Input.gameCharacters,
Output.gameCharacters
))
func `get game characters`(
filter: GameCharacterFilter,
expects numberOfItems: Int
) async throws {
try await assertGameCharacters(
with: filter,
expects: numberOfItems
)
}
@Test(arguments: zip(
Input.gameCharactersThrows,
Output.gameCharactersThrows
))
func `get game characters throws`(
filter: GameCharacterFilter,
expects error: AmiiboServiceError
) async throws {
try await assertsGameCharactersThrows(
error: error,
when: filter
)
}
@Test(arguments: zip(
Input.gameSeries,
Output.gameSeries
))
func `get game series`(
filter: GameSeriesFilter,
expects numberOfItems: Int
) async throws {
try await assertGameSeries(
with: filter,
expects: numberOfItems
)
}
@Test(arguments: zip(
Input.gameSeriesThrows,
Output.gameSeriesThrows
))
func `get game series throws`(
filter: GameSeriesFilter,
expects error: AmiiboServiceError
) async throws {
try await assertsGameSeriesThrows(
error: error,
when: filter
)
}
@Test
func `get the last updated timestamp`() async throws {
try await assertLastUpdated(
day: 21,
month: 9,
year: 2025
)
}
#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: 10,
month: 10,
year: 2025
)
}
#endif
}
// MARK: - Assertions
private extension AmiiboServiceLiveTests {
// MARK: Functions
/// Asserts the number of items returned by the `amiibos` endpoint that matched a given filter.
/// - Parameters:
/// - filter: An amiibo filter type.
/// - numberOfItems: An expected number of items returned.
func assertAmiibos(
with filter: AmiiboFilter,
expects numberOfItems: Int
) async throws {
// GIVEN
// WHEN
let amiibos = try await service.getAmiibos(filter)
// THEN
#expect(amiibos.count == numberOfItems)
guard
!amiibos.isEmpty,
(filter.showGames == true || filter.showUsage == true)
else { return }
let firstAmiiboPlatform = try #require(amiibos.first?.platform)
#expect(amiibos.last?.platform != nil)
if filter.showUsage == true {
#expect(firstAmiiboPlatform.switch.first?.usages?.isEmpty == false)
#expect(firstAmiiboPlatform.threeDS.first?.usages?.isEmpty == false)
#expect(firstAmiiboPlatform.wiiU.first?.usages?.isEmpty == false)
}
}
/// Asserts the error thrown by the `amiibos` endpoint.
/// - Parameters:
/// - error: An expected error.
/// - filter: An amiibo filter type.
func assertsAmiibosThrows(
error: AmiiboServiceError,
when filter: AmiiboFilter
) async throws {
// GIVEN
// WHEN
// THEN
await #expect(throws: error) {
try await service.getAmiibos(filter)
}
}
/// Asserts the number of items returned by the `amiiboSeries` endpoint that matched a given filter.
/// - Parameters:
/// - filter: An amiibo series filter type.
/// - numberOfItems: An expected number of items returned.
func assertAmiiboSeries(
with filter: AmiiboSeriesFilter,
expects numberOfItems: Int
) async throws {
// GIVEN
// WHEN
let amiiboSeries = try await service.getAmiiboSeries(filter)
// THEN
#expect(amiiboSeries.count == numberOfItems)
}
/// Asserts the error thrown by the `amiiboSeries` endpoint.
/// - Parameters:
/// - error: An expected error.
/// - filter: An amiibo series filter type.
func assertsAmiiboSeriesThrows(
error: AmiiboServiceError,
when filter: AmiiboSeriesFilter
) async throws {
// GIVEN
// WHEN
// THEN
await #expect(throws: error) {
try await service.getAmiiboSeries(filter)
}
}
/// Asserts the number of items returned by the `amiiboTypes` endpoint that matched a given filter.
/// - Parameters:
/// - filter: An amiibo type filter type.
/// - numberOfItems: An expected number of items returned.
func assertAmiiboTypes(
with filter: AmiiboTypeFilter,
expects numberOfItems: Int
) async throws {
// GIVEN
// WHEN
let amiiboTypes = try await service.getAmiiboTypes(filter)
// THEN
#expect(amiiboTypes.count == numberOfItems)
}
/// Asserts the error thrown by the `amiiboTypes` endpoint.
/// - Parameters:
/// - error: An expected error.
/// - filter: An amiibo type filter type.
func assertsAmiiboTypesThrows(
error: AmiiboServiceError,
when filter: AmiiboTypeFilter
) async throws {
// GIVEN
// WHEN
// THEN
await #expect(throws: error) {
try await service.getAmiiboTypes(filter)
}
}
/// Asserts the number of items returned by the `gameCharacters` endpoint that matched a given filter.
/// - Parameters:
/// - filter: A game character filter type.
/// - numberOfItems: An expected number of items returned.
func assertGameCharacters(
with filter: GameCharacterFilter,
expects numberOfItems: Int
) async throws {
// GIVEN
// WHEN
let gameCharacters = try await service.getGameCharacters(filter)
// THEN
#expect(gameCharacters.count == numberOfItems)
}
/// Asserts the error thrown by the `gameCharacters` endpoint.
/// - Parameters:
/// - error: An expected error.
/// - filter: A game character filter type.
func assertsGameCharactersThrows(
error: AmiiboServiceError,
when filter: GameCharacterFilter
) async throws {
// GIVEN
// WHEN
// THEN
await #expect(throws: error) {
try await service.getGameCharacters(filter)
}
}
/// Asserts the number of items returned by the `gameSeries` endpoint that matched a given filter.
/// - Parameters:
/// - filter: A game series filter type.
/// - numberOfItems: An expected number of items returned.
func assertGameSeries(
with filter: GameSeriesFilter,
expects numberOfItems: Int
) async throws {
// GIVEN
// WHEN
let gameSeries = try await service.getGameSeries(filter)
// THEN
#expect(gameSeries.count == numberOfItems)
}
/// Asserts the error thrown by the `gameSeries` endpoint.
/// - Parameters:
/// - error: An expected error.
/// - filter: A game series filter type.
func assertsGameSeriesThrows(
error: AmiiboServiceError,
when filter: GameSeriesFilter
) async throws {
// GIVEN
// WHEN
// THEN
await #expect(throws: error) {
try await service.getGameSeries(filter)
}
}
/// Asserts the date returned by the `lastUpdated` endpoint.
/// - Parameters:
/// - day: A number of day of the last updated date.
/// - month: A number of month of the last updated date.
/// - year: A number of year of the last updated date.
func assertLastUpdated(
day: Int,
month: Int,
year: Int
) async throws {
// GIVEN
// WHEN
let dateLastUpdated = try await service.getLastUpdated()
// THEN
let dateComponents = Calendar.current.dateComponents(
[.year, .month, .day],
from: dateLastUpdated
)
#expect(dateComponents.year == year)
#expect(dateComponents.month == month)
#expect(dateComponents.day == day)
}
}
// MARK: - Arguments
enum Input {
/// A list of amiibo filters to input to the `assertAmiibos` assertion.
static let amiibos: [AmiiboFilter] = [
.init(),
.init(head: "00000000"),
.init(head: "0000"),
.init(tail: "00000002"),
.init(tail: "0002"),
.init(identifier: "0000000000000002"),
.init(identifier: "0000000000000000"),
.init(identifier: "0000000"),
.init(name: "zelda"),
.init(name: "Something"),
.init(name: "zel"),
.init(name: .empty),
.init(type: "0x00"),
.init(type: "Figure"),
.init(type: "0x0f"),
.init(type: "something"),
.init(type: "fig"),
.init(type: .empty),
.init(series: "0x00"),
.init(series: "Legend of Zelda"),
.init(series: "0xf9"),
.init(series: "something"),
.init(series: "fig"),
.init(series: .empty),
.init(gameCharacter: "0x00"),
.init(gameCharacter: "Zelda"),
.init(gameCharacter: "0xf9"),
.init(gameCharacter: "something"),
.init(gameCharacter: "fig"),
.init(gameCharacter: .empty),
.init(gameSeries: "0x00"),
.init(gameSeries: "Legend of Zelda"),
.init(gameSeries: "0xf9"),
.init(gameSeries: "something"),
.init(gameSeries: "Super"),
.init(gameSeries: .empty),
.init(showGames: true),
.init(showUsage: true)
]
/// A list of amiibo series filters to input to the `assertAmiibosThrows` assertion.
static let amiibosThrows: [AmiiboFilter] = [
.init(head: .empty),
.init(tail: .empty),
.init(identifier: .empty),
.init(type: "0x"),
.init(series: "0x"),
.init(gameCharacter: "0x"),
.init(gameSeries: "0x"),
]
/// A list of amiibo series filters to input to the `assertAmiiboSeries` assertion.
static let amiiboSeries: [AmiiboSeriesFilter] = [
.init(),
.init(key: "0x01"),
.init(name: "Legend of Zelda"),
.init(name: "Zelda"),
.init(name: .empty)
]
/// A list of amiibo series filters to input to the `assertAmiiboSeriesThrows` assertion.
static let amiiboSeriesThrows: [AmiiboSeriesFilter] = [
.init(key: "0xf9"),
.init(key: "0x"),
.init(key: .empty),
.init(name: "Something")
]
/// A list of amiibo type filters to input to the `assertAmiiboTypes` assertion.
static let amiiboTypes: [AmiiboTypeFilter] = [
.init(),
.init(key: "0x01"),
.init(name: "Card"),
.init(name: "Ca"),
.init(name: .empty)
]
/// A list of amiibo type filters to input to the `assertAmiiboTypesThrows` assertion.
static let amiiboTypesThrows: [AmiiboTypeFilter] = [
.init(key: "0x09"),
.init(key: "0x"),
.init(key: .empty),
.init(name: "Something")
]
/// A list of game character filters to input to the `assertGameCharacters` assertion.
static let gameCharacters: [GameCharacterFilter] = [
.init(),
.init(key: "0x0001"),
.init(name: "Zelda"),
.init(name: "Zeld"),
.init(name: .empty)
]
/// A list of game character filters to input to the `assertGameCharactersThrows` assertion.
static let gameCharactersThrows: [GameCharacterFilter] = [
.init(key: "0xffff"),
.init(key: "0x"),
.init(key: .empty),
.init(name: "Something")
]
/// A list of game series filters to input to the `assertGameSeries` assertion.
static let gameSeries: [GameSeriesFilter] = [
.init(),
.init(key: "0x001"),
.init(name: "Pikmin"),
.init(name: "Pik"),
.init(name: .empty)
]
/// A list of game series filters to input to the `assertGameSeriesThrows` assertion.
static let gameSeriesThrows: [GameSeriesFilter] = [
.init(key: "0xffff"),
.init(key: "0x"),
.init(key: .empty),
.init(name: "Something")
]
}
enum Output {
/// A list of number of items that are expected from the `assertAmiibos` assertion.
static let amiibos: [Int] = [.totalAmiibos, 7, 7, 1, 1, 1, .zero, .zero, 5, .zero, 7, .totalAmiibos, 235, 235, .zero, .zero, .zero, .zero, 96, 26, .zero, .zero, 63, .totalAmiibos, 12, 6, .zero, .zero, .zero, .totalAmiibos, 49, 32, .zero, .zero, 147, .totalAmiibos, .totalAmiibos, .totalAmiibos]
/// A list of errors are expected to be thrown from the `assertAmiibosThrows` assertion.
static let amiibosThrows: [AmiiboServiceError] = [.badRequest, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest, .badRequest]
/// A list of number of items that are expected from the `assertAmiiboSeries` assertion.
static let amiiboSeries: [Int] = [.totalAmiiboSeries, 1, 1, 1, .totalAmiiboSeries]
/// A list of errors are expected to be thrown from the `assertAmiiboSeriesThrows` assertion.
static let amiiboSeriesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
/// A list of number of items that are expected from the `assertAmiiboTypes` assertion.
static let amiiboTypes: [Int] = [.totalAmiiboTypes, 1, 1, 1, .totalAmiiboTypes]
/// A list of errors are expected to be thrown from the `assertAmiiboTypesThrows` assertion.
static let amiiboTypesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
/// A list of number of items that are expected from the `assertGameCharacters` assertion.
static let gameCharacters: [Int] = [.totalGameCharacters, 1, 1, 1, .totalGameCharacters]
/// A list of errors are expected to be thrown from the `assertGameCharactersThrows` assertion.
static let gameCharactersThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
/// A list of number of items that are expected from the `assertGameSeries` assertion.
static let gameSeries: [Int] = [.totalGameSeries, 1, 1, 1, .totalGameSeries]
/// A list of errors are expected to be thrown from the `assertGameSeriesThrows` assertion.
static let gameSeriesThrows: [AmiiboServiceError] = [.notFound, .badRequest, .badRequest, .notFound]
}
// MARK: - Constants
private extension Int {
/// A number that represents the total number of amiibo items currently available at the live service.
static let totalAmiibos = 927
/// A number that represents the total number of amiibo series currently available at the live service.
static let totalAmiiboSeries = 29
/// A number that represents the total number of amiibo types currently available at the live service.
static let totalAmiiboTypes = 5
/// A number that represents the total number of game characters currently available at the live service.
static let totalGameCharacters = 675
/// A number that represents the total number of game series currently available at the live service.
static let totalGameSeries = 117
}
private extension String {
/// An empty string.
static let empty = ""
}
@@ -0,0 +1,245 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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 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 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 {
fetchLastUpdatedIfAny()
}
#else
func getAmiibos(
by filter: AmiiboFilter
) async throws -> [Amiibo] {
try fetchAmiibosIfAny()
}
func getAmiiboSeries(
by filter: AmiiboSeriesFilter
) async throws -> [AmiiboSeries] {
try fetchAmiiboSeriesIfAny()
}
func getAmiiboTypes(
by filter: AmiiboTypeFilter
) async throws -> [AmiiboType] {
try fetchAmiiboTypesIfAny()
}
func getGameCharacters(
by filter: GameCharacterFilter
) async throws -> [GameCharacter] {
try fetchGameCharactersIfAny()
}
func getGameSeries(
by filter: GameSeriesFilter
) async throws -> [GameSeries] {
try fetchGameSeriesIfAny()
}
func getLastUpdated() async throws -> Date {
try fetchLastUpdatedIfAny()
}
#endif
}
// 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 -> [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 -> [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 -> [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 -> [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 -> [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 -> Date {
try throwErrorIfExists()
guard let lastUpdated else {
throw AmiiboServiceError.notFound
}
return lastUpdated
}
/// 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
}
}
}
@@ -0,0 +1,24 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the Amiibo Service open source project
//
// Copyright (c) 2025 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
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/identifiers"},"schemaVersion":{"major":0,"patch":0,"minor":3},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V4GameV11identifiersSaySSGvp","title":"identifiers","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"identifiers"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"},{"kind":"text","text":"]"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"identifiers"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"},{"kind":"text","text":"]"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"text":"A list of identifiers.","type":"text"}],"kind":"symbol","variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/game\/identifiers"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"]]},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"Game"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","abstract":[{"text":"A model that represents a game related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Game","kind":"identifier"}],"title":"Amiibo.Game","url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/identifiers":{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/identifiers","url":"\/documentation\/amiiboservice\/amiibo\/game\/identifiers","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"}],"title":"identifiers","abstract":[{"text":"A list of identifiers.","type":"text"}],"kind":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"}],"modules":[{"name":"AmiiboService"}],"title":"name","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V4GameV4nameSSvp"},"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/name"},"sections":[],"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"name"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"text":"A name.","type":"text"}],"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/game\/name"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"]]},"schemaVersion":{"major":0,"patch":0,"minor":3},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/name":{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/name","url":"\/documentation\/amiiboservice\/amiibo\/game\/name","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"title":"name","abstract":[{"text":"A name.","type":"text"}],"kind":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"Game"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","abstract":[{"text":"A model that represents a game related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Game","kind":"identifier"}],"title":"Amiibo.Game","url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/usages"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game"]]},"schemaVersion":{"major":0,"patch":0,"minor":3},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V4GameV6usagesSayAC5UsageVGSgvp","title":"usages","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"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"usages","kind":"identifier"},{"text":": [","kind":"text"},{"text":"Amiibo","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},{"text":".","kind":"text"},{"text":"Usage","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V5UsageV","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage"},{"text":"]?","kind":"text"}],"languages":["swift"],"platforms":["macOS"]}]}],"abstract":[{"text":"A list of amiibo usages, if any.","type":"text"}],"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/game\/usages"]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"Game"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game","abstract":[{"text":"A model that represents a game related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Game","kind":"identifier"}],"title":"Amiibo.Game","url":"\/documentation\/amiiboservice\/amiibo\/game","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage":{"abstract":[{"type":"text","text":"A model that represents the usage of an amiibo item within a certain game."}],"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/usage","navigatorTitle":[{"text":"Usage","kind":"identifier"}],"role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","title":"Amiibo.Usage"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Game/usages":{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Game\/usages","url":"\/documentation\/amiiboservice\/amiibo\/game\/usages","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"usages","kind":"identifier"},{"text":": [","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo","kind":"typeIdentifier"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V5UsageV","text":"Usage","kind":"typeIdentifier"},{"text":"]?","kind":"text"}],"title":"usages","abstract":[{"text":"A list of amiibo usages, if any.","type":"text"}],"kind":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"}}}
@@ -0,0 +1 @@
{"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V13gameCharacterSSvp","title":"gameCharacter","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"gameCharacter"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"}],"roleHeading":"Instance Property"},"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameCharacter"},"sections":[],"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"gameCharacter"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"text":"A game character.","type":"text"}],"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/gamecharacter"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"major":0,"patch":0,"minor":3},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/gameCharacter":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/gamecharacter","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"gameCharacter","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"kind":"symbol","abstract":[{"type":"text","text":"A game character."}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameCharacter","title":"gameCharacter"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"gameSeries"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","kind":"typeIdentifier","text":"String"}],"modules":[{"name":"AmiiboService"}],"title":"gameSeries","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V10gameSeriesSSvp"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameSeries"},"sections":[],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"gameSeries"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","kind":"typeIdentifier","text":"String"}],"languages":["swift"]}]}],"abstract":[{"text":"A game series.","type":"text"}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/gameseries"]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"patch":0,"minor":3,"major":0},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/gameSeries":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/gameseries","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"gameSeries","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"kind":"symbol","abstract":[{"type":"text","text":"A game series."}],"title":"gameSeries","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/gameSeries"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"}}}
@@ -0,0 +1 @@
{"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/head","interfaceLanguage":"swift"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"major":0,"minor":3,"patch":0},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V4headSSvp","title":"head","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"head"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"head"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"The first 8 hexadecimal characters of an identifier."}],"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/head"]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/head":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/head","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"head","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"kind":"symbol","abstract":[{"type":"text","text":"The first 8 hexadecimal characters of an identifier."}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/head","title":"head"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"metadata":{"fragments":[{"kind":"keyword","text":"var"},{"text":" ","kind":"text"},{"text":"identifier","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","preciseIdentifier":"s:SS","kind":"typeIdentifier"}],"modules":[{"name":"AmiiboService"}],"title":"identifier","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V10identifierSSvp"},"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/identifier"},"sections":[],"primaryContentSections":[{"declarations":[{"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"},{"kind":"text","text":" { "},{"kind":"keyword","text":"get"},{"kind":"text","text":" }"}],"languages":["swift"],"platforms":["macOS"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"An identifier."}],"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/identifier"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"major":0,"patch":0,"minor":3},"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/identifier":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/identifier","role":"symbol","fragments":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"identifier","kind":"identifier"},{"text":": ","kind":"text"},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"kind":"symbol","abstract":[{"text":"An identifier.","type":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/identifier","title":"identifier"}}}
@@ -0,0 +1 @@
{"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/image","interfaceLanguage":"swift"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"major":0,"minor":3,"patch":0},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V5imageSSvp","title":"image","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"image"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"image"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"An image link."}],"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/image"]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/image":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/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"}],"kind":"symbol","abstract":[{"text":"An image link.","type":"text"}],"title":"image","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/image"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/imageURL"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"major":0,"minor":3,"patch":0},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V8imageURL10Foundation0D0VSgvp","title":"imageURL","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"imageURL"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"URL","preciseIdentifier":"s:10Foundation3URLV"},{"kind":"text","text":"?"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"text":"var","kind":"keyword"},{"text":" ","kind":"text"},{"text":"imageURL","kind":"identifier"},{"text":": ","kind":"text"},{"text":"URL","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation3URLV"},{"text":"? { ","kind":"text"},{"text":"get","kind":"keyword"},{"kind":"text","text":" }"}]}]}],"abstract":[{"type":"text","text":"A URL related to an image link, if any."}],"kind":"symbol","variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/imageurl"],"traits":[{"interfaceLanguage":"swift"}]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/imageURL":{"title":"imageURL","type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/imageurl","role":"symbol","kind":"symbol","fragments":[{"text":"var","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"imageURL"},{"text":": ","kind":"text"},{"text":"URL","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation3URLV"},{"text":"?","kind":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/imageURL","abstract":[{"text":"A URL related to an image link, if any.","type":"text"}]}}}
@@ -0,0 +1 @@
{"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/name","interfaceLanguage":"swift"},"sections":[],"schemaVersion":{"minor":3,"major":0,"patch":0},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V4nameSSvp","title":"name","fragments":[{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"kind":"identifier","text":"name"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"name"},{"kind":"text","text":": "},{"text":"String","kind":"typeIdentifier","preciseIdentifier":"s:SS"}],"languages":["swift"]}]}],"abstract":[{"type":"text","text":"An amiibo name."}],"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/name"]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/name":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/name","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"name","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"kind":"symbol","abstract":[{"text":"An amiibo name.","type":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/name","title":"name"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"abstract":[{"type":"text","text":"A game platform type, if any."}],"schemaVersion":{"patch":0,"major":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"sections":[],"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/platform-swift.property"},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"text":"platform","kind":"identifier"},{"kind":"text","text":": "},{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","kind":"typeIdentifier","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V8PlatformV","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","text":"Platform"},{"text":"?","kind":"text"}],"platforms":["macOS"],"languages":["swift"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/platform-swift.property"]}],"metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"platform"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Platform","preciseIdentifier":"s:13AmiiboService0A0V8PlatformV"},{"kind":"text","text":"?"}],"symbolKind":"property","role":"symbol","externalID":"s:13AmiiboService0A0V8platformAC8PlatformVSgvp","title":"platform","roleHeading":"Instance Property","modules":[{"name":"AmiiboService"}]},"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Platform-swift.struct":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Platform","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Platform-swift.struct","abstract":[{"type":"text","text":"A model that represents a collection of "},{"type":"codeVoice","code":"WiiU"},{"type":"text","text":", "},{"code":"3DS","type":"codeVoice"},{"type":"text","text":", and "},{"code":"Switch","type":"codeVoice"},{"type":"text","text":" games related to an amiibo item."}],"type":"topic","navigatorTitle":[{"text":"Platform","kind":"identifier"}],"title":"Amiibo.Platform","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.struct","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/platform-swift.property":{"abstract":[{"type":"text","text":"A game platform type, if any."}],"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/platform-swift.property","role":"symbol","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"},{"preciseIdentifier":"s:13AmiiboService0A0V8PlatformV","text":"Platform","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/platform-swift.property","title":"platform"}}}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/release-swift.property"},"schemaVersion":{"major":0,"patch":0,"minor":3},"abstract":[{"text":"A release date.","type":"text"}],"sections":[],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"text":" ","kind":"text"},{"text":"release","kind":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"},{"text":".","kind":"text"},{"preciseIdentifier":"s:13AmiiboService0A0V7ReleaseV","kind":"typeIdentifier","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","text":"Release"}],"languages":["swift"]}]}],"metadata":{"externalID":"s:13AmiiboService0A0V7releaseAC7ReleaseVvp","roleHeading":"Instance Property","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"release","kind":"identifier"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V","text":"Amiibo"},{"kind":"text","text":"."},{"preciseIdentifier":"s:13AmiiboService0A0V7ReleaseV","kind":"typeIdentifier","text":"Release"}],"role":"symbol","modules":[{"name":"AmiiboService"}],"symbolKind":"property","title":"release"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.property"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"text":"A library that provides everything the developer needs to interact with the ","type":"text"},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"type":"text","text":" backend service."}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/release-swift.property":{"abstract":[{"type":"text","text":"A release date."}],"title":"release","fragments":[{"text":"let","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"release"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Amiibo","preciseIdentifier":"s:13AmiiboService0A0V"},{"text":".","kind":"text"},{"text":"Release","kind":"typeIdentifier","preciseIdentifier":"s:13AmiiboService0A0V7ReleaseV"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/release-swift.property","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.property","kind":"symbol","type":"topic","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","abstract":[{"text":"A model that represents a collection of release dates related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Release","kind":"identifier"}],"title":"Amiibo.Release","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","role":"symbol"}}}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"america"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"modules":[{"name":"AmiiboService"}],"title":"america","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V7ReleaseV7america10Foundation4DateVSgvp"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/america"},"sections":[],"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"america"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"text":"A release date for North America, if any.","type":"text"}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/america"]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"schemaVersion":{"major":0,"minor":3,"patch":0},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/america":{"kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/america","title":"america","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/america","abstract":[{"text":"A release date for North America, if any.","type":"text"}],"role":"symbol","type":"topic","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"}]},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","abstract":[{"text":"A model that represents a collection of release dates related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Release","kind":"identifier"}],"title":"Amiibo.Release","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","role":"symbol"}}}
@@ -0,0 +1 @@
{"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"australia"},{"kind":"text","text":": "},{"preciseIdentifier":"s:10Foundation4DateV","kind":"typeIdentifier","text":"Date"},{"kind":"text","text":"?"}],"modules":[{"name":"AmiiboService"}],"title":"australia","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V7ReleaseV9australia10Foundation4DateVSgvp"},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/australia"},"sections":[],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"australia"},{"kind":"text","text":": "},{"preciseIdentifier":"s:10Foundation4DateV","kind":"typeIdentifier","text":"Date"},{"kind":"text","text":"?"}],"languages":["swift"]}]}],"abstract":[{"text":"A release date for Australia, if any.","type":"text"}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/australia"]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"schemaVersion":{"patch":0,"minor":3,"major":0},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","abstract":[{"text":"A model that represents a collection of release dates related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Release","kind":"identifier"}],"title":"Amiibo.Release","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/australia":{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/australia","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/australia","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"australia","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:10Foundation4DateV","text":"Date","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"title":"australia","abstract":[{"text":"A release date for Australia, if any.","type":"text"}],"kind":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"europe"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV","text":"Date"},{"kind":"text","text":"?"}],"modules":[{"name":"AmiiboService"}],"title":"europe","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V7ReleaseV6europe10Foundation4DateVSgvp"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/europe","interfaceLanguage":"swift"},"sections":[],"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"europe"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV","text":"Date"},{"kind":"text","text":"?"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"A release date for Europe, if any."}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/europe"]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"schemaVersion":{"minor":3,"patch":0,"major":0},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/europe":{"kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/europe","title":"europe","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/europe","abstract":[{"type":"text","text":"A release date for Europe, if any."}],"role":"symbol","type":"topic","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"}]},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","abstract":[{"text":"A model that represents a collection of release dates related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Release","kind":"identifier"}],"title":"Amiibo.Release","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"}}}
@@ -0,0 +1 @@
{"sections":[],"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/japan","interfaceLanguage":"swift"},"schemaVersion":{"major":0,"patch":0,"minor":3},"metadata":{"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"}],"symbolKind":"property","role":"symbol","title":"japan","externalID":"s:13AmiiboService0A0V7ReleaseV5japan10Foundation4DateVSgvp","roleHeading":"Instance Property","modules":[{"name":"AmiiboService"}]},"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"japan"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:10Foundation4DateV","text":"Date"},{"kind":"text","text":"?"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"A release date for Japan, if any."}],"kind":"symbol","variants":[{"paths":["\/documentation\/amiiboservice\/amiibo\/release-swift.struct\/japan"],"traits":[{"interfaceLanguage":"swift"}]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct"]]},"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct":{"kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Release","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct","abstract":[{"text":"A model that represents a collection of release dates related to an amiibo item.","type":"text"}],"type":"topic","navigatorTitle":[{"text":"Release","kind":"identifier"}],"title":"Amiibo.Release","url":"\/documentation\/amiiboservice\/amiibo\/release-swift.struct","role":"symbol"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Release-swift.struct/japan":{"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Release-swift.struct\/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"},{"preciseIdentifier":"s:10Foundation4DateV","text":"Date","kind":"typeIdentifier"},{"text":"?","kind":"text"}],"title":"japan","abstract":[{"text":"A release date for Japan, if any.","type":"text"}],"kind":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"}}}
@@ -0,0 +1 @@
{"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"series"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"}],"modules":[{"name":"AmiiboService"}],"title":"series","role":"symbol","symbolKind":"property","roleHeading":"Instance Property","externalID":"s:13AmiiboService0A0V6seriesSSvp"},"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/series","interfaceLanguage":"swift"},"sections":[],"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"series"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:SS","text":"String"}],"languages":["swift"],"platforms":["macOS"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"An amiibo series."}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/series"]}],"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"patch":0,"major":0,"minor":3},"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/series":{"abstract":[{"text":"An amiibo series.","type":"text"}],"title":"series","url":"\/documentation\/amiiboservice\/amiibo\/series","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/series","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"series","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"kind":"symbol","role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"}}}
@@ -0,0 +1 @@
{"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/tail","interfaceLanguage":"swift"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"schemaVersion":{"major":0,"minor":3,"patch":0},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V4tailSSvp","title":"tail","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"tail"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"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"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"The last 8 hexadecimal characters of an identifier."}],"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/tail"]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/tail":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/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"}],"kind":"symbol","abstract":[{"type":"text","text":"The last 8 hexadecimal characters of an identifier."}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/tail","title":"tail"}}}
@@ -0,0 +1 @@
{"metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"type"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","kind":"typeIdentifier","text":"String"}],"symbolKind":"property","role":"symbol","externalID":"s:13AmiiboService0A0V4typeSSvp","title":"type","roleHeading":"Instance Property","modules":[{"name":"AmiiboService"}]},"schemaVersion":{"patch":0,"minor":3,"major":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo"]]},"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"type"},{"kind":"text","text":": "},{"preciseIdentifier":"s:SS","kind":"typeIdentifier","text":"String"}],"languages":["swift"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/type"]}],"sections":[],"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/type"},"abstract":[{"text":"An amiibo type.","type":"text"}],"references":{"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/type":{"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/type","role":"symbol","fragments":[{"text":"let","kind":"keyword"},{"text":" ","kind":"text"},{"text":"type","kind":"identifier"},{"text":": ","kind":"text"},{"preciseIdentifier":"s:SS","text":"String","kind":"typeIdentifier"}],"kind":"symbol","abstract":[{"text":"An amiibo type.","type":"text"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/type","title":"type"}}}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/explanation","interfaceLanguage":"swift"},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage"]]},"schemaVersion":{"major":0,"minor":3,"patch":0},"metadata":{"modules":[{"name":"AmiiboService"}],"role":"symbol","symbolKind":"property","externalID":"s:13AmiiboService0A0V5UsageV11explanationSSvp","title":"explanation","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"explanation"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"roleHeading":"Instance Property"},"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"explanation"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"abstract":[{"type":"text","text":"An explanation of how to use an amiibo item."}],"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/usage\/explanation"]}],"sections":[],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage/explanation":{"abstract":[{"type":"text","text":"An explanation of how to use an amiibo item."}],"type":"topic","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"},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/explanation","title":"explanation"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage":{"abstract":[{"type":"text","text":"A model that represents the usage of an amiibo item within a certain game."}],"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/usage","navigatorTitle":[{"text":"Usage","kind":"identifier"}],"role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","title":"Amiibo.Usage"}}}
@@ -0,0 +1 @@
{"metadata":{"fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"isWriteable"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"symbolKind":"property","role":"symbol","externalID":"s:13AmiiboService0A0V5UsageV11isWriteableSbvp","title":"isWriteable","roleHeading":"Instance Property","modules":[{"name":"AmiiboService"}]},"schemaVersion":{"major":0,"minor":3,"patch":0},"hierarchy":{"paths":[["doc:\/\/AmiiboService\/documentation\/AmiiboService","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage"]]},"primaryContentSections":[{"declarations":[{"tokens":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"isWriteable"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"platforms":["macOS"],"languages":["swift"]}],"kind":"declarations"}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/amiiboservice\/amiibo\/usage\/iswriteable"]}],"sections":[],"kind":"symbol","identifier":{"url":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/isWriteable","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"A flag that indicates whether an amiibo item can save game data in it."}],"references":{"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage":{"abstract":[{"type":"text","text":"A model that represents the usage of an amiibo item within a certain game."}],"type":"topic","url":"\/documentation\/amiiboservice\/amiibo\/usage","navigatorTitle":[{"text":"Usage","kind":"identifier"}],"role":"symbol","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Usage","kind":"identifier"}],"identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage","title":"Amiibo.Usage"},"doc://AmiiboService/documentation/AmiiboService/Amiibo/Usage/isWriteable":{"url":"\/documentation\/amiiboservice\/amiibo\/usage\/iswriteable","fragments":[{"kind":"keyword","text":"let"},{"kind":"text","text":" "},{"kind":"identifier","text":"isWriteable"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"kind":"symbol","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo\/Usage\/isWriteable","type":"topic","abstract":[{"type":"text","text":"A flag that indicates whether an amiibo item can save game data in it."}],"role":"symbol","title":"isWriteable"},"doc://AmiiboService/documentation/AmiiboService/Amiibo":{"abstract":[{"text":"A model that represents an amiibo item.","type":"text"}],"title":"Amiibo","url":"\/documentation\/amiiboservice\/amiibo","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService\/Amiibo","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Amiibo"}],"kind":"symbol","navigatorTitle":[{"kind":"identifier","text":"Amiibo"}],"role":"symbol","type":"topic"},"doc://AmiiboService/documentation/AmiiboService":{"type":"topic","url":"\/documentation\/amiiboservice","abstract":[{"type":"text","text":"A library that provides everything the developer needs to interact with the "},{"inlineContent":[{"type":"text","text":"Amiibo API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"kind":"symbol","role":"collection","identifier":"doc:\/\/AmiiboService\/documentation\/AmiiboService","title":"AmiiboService"}}}

Some files were not shown because too many files have changed in this diff Show More