Files
amiibo-service/docs/data/documentation/amiiboservice.json
T

1 line
19 KiB
JSON
Raw Normal View History

2026-03-22 23:39:48 +00:00
{"kind":"symbol","schemaVersion":{"major":0,"patch":0,"minor":3},"abstract":[{"text":"A library that provides everything the developer needs to interact with the ","type":"text"},{"type":"strong","inlineContent":[{"text":"Amiibo API","type":"text"}]},{"type":"text","text":" backend service."}],"primaryContentSections":[{"content":[{"type":"heading","text":"Overview","level":2,"anchor":"Overview"},{"inlineContent":[{"text":"The ","type":"text"},{"type":"codeVoice","code":"amiibo-service"},{"type":"text","text":" library is a package that allows the developer to interact with the "},{"isActive":true,"identifier":"https:\/\/www.amiiboapi.org","type":"reference"},{"text":" backend service seamlessly, by not only providing the ","type":"text"},{"type":"emphasis","inlineContent":[{"text":"service","type":"text"}]},{"type":"text","text":" type but also any possible "},{"type":"emphasis","inlineContent":[{"type":"text","text":"models"}]},{"type":"text","text":", "},{"type":"emphasis","inlineContent":[{"type":"text","text":"filters"}]},{"type":"text","text":", "},{"type":"emphasis","inlineContent":[{"type":"text","text":"errors"}]},{"type":"text","text":" and "},{"type":"emphasis","inlineContent":[{"type":"text","text":"interfaces"}]},{"type":"text","text":" types that might be needed during implementation."}],"type":"paragraph"},{"anchor":"Design","level":2,"type":"heading","text":"Design"},{"inlineContent":[{"type":"text","text":"Although it could have been possible to generate a one-to-one RESTful client based on the Open API specification document that describe the available endpoints of the backend service, it was decided to design a "},{"type":"codeVoice","code":"AmiiboService"},{"type":"text","text":" service type that removes the complexities of the API design imposed by the backend service, and provides the developer with a simple interface, and a seamless experience."}],"type":"paragraph"},{"anchor":"Installation","level":2,"type":"heading","text":"Installation"},{"inlineContent":[{"type":"text","text":"To use the "},{"type":"codeVoice","code":"AmiiboService"},{"type":"text","text":" library with your package, then add it as a dependency in the "},{"type":"codeVoice","code":"Package.swift"},{"type":"text","text":" file:"}],"type":"paragraph"},{"code":["let package = Package("," \/\/ name, platforms, products, etc."," dependencies: ["," .package(url: \"https:\/\/github.com\/rock-n-code\/amiibo-service\", from: \"1.4.0\"),"," \/\/ other dependencies"," ],"," targets: ["," .target("," name: \"SomeTarget\", "," dependencies: ["," .product(name: \"AmiiboService\", package: \"amiibo-service\"),"," ]"," )"," \/\/ other targets"," ]",")"],"type":"codeListing","syntax":"swift"},{"inlineContent":[{"type":"text","text":"It is also possible to use the "},{"type":"codeVoice","code":"AmiiboService"},{"type":"text","text":" library with your app in Xcode, then add it as a dependency in your Xcode project."}],"type":"paragraph"},{"style":"important","name":"Important","type":"aside","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Swift 5.10 or higher is required in order to compile this library."}]}]},{"anchor":"Caching","level":2,"type":"heading","text":"Caching"},{"inlineContent":[{"type":"text","text":"The "},{"identifier":"https:\/\/www.amiiboapi.org","overridingTitleInlineContent":[{"type":"text","text":"Amiibo API"}],"type":"reference","isActive":true,"overridingTitle":"Amiibo API"},{"type":"text","text":" recommends that consumers who call the API regularly implement caching on their systems. This library does not include a built-in cache, leaving the choice of caching strategy to the consumer. The following examples show two common approaches."}],"type":"paragraph"},{"anchor":"URLCache-on-the-transport-layer","level":3,"type":"heading","text":"URLCache on the transport layer"},{"inlineContent":[{"type":"text","text":"Pass a custom "},{"type":"codeVoice","code":"URLSessionTransport"},{"type":"text","text":" w