A library written entirely with [Swift](https://www.swift.org) that provides everything the developer needs to interact with the [Amiibo API](https://www.amiiboapi.org) backend service.
// Fetch amiibo series, types, game characters, and game series
letseries=tryawaitservice.getAmiiboSeries()
lettypes=tryawaitservice.getAmiiboTypes()
letcharacters=tryawaitservice.getGameCharacters()
letgameSeries=tryawaitservice.getGameSeries()
// Fetch the last updated timestamp
letlastUpdated=tryawaitservice.getLastUpdated()
```
## Caching
The [Amiibo API](https://www.amiiboapi.org) recommends that consumers who call the API regularly implement caching on their systems. Pass a custom `URLSessionTransport` with a cache-configured `URLSession` to `AmiiboLiveClient`:
The `AmiiboClient` protocol enables creating custom mock clients for unit testing without network calls. Conform to `AmiiboClient` and inject it into `AmiiboService` via its `init(client:)` initializer. Since `AmiiboClient` refines `Sendable`, conforming types must be safe to share across concurrency domains:
The unit tests based on a mock client run offline by default. The tests against the live service are skipped unless the `AMIIBO_LIVE_TESTS` environment variable is set to `1`, either in the environment when testing from the command line:
```shell
AMIIBO_LIVE_TESTS=1 swift test
```
or in the `Test` action of the scheme when testing from Xcode.
Please refer to the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/) for further information about this library.