{"hierarchy":{"paths":[[]]},"kind":"symbol","variants":[{"paths":["\/documentation\/amiiboservice"],"traits":[{"interfaceLanguage":"swift"}]}],"primaryContentSections":[{"content":[{"type":"heading","text":"Overview","anchor":"Overview","level":2},{"inlineContent":[{"text":"The ","type":"text"},{"type":"codeVoice","code":"amiibo-service"},{"text":" library is a package that allows the developer to interact with the ","type":"text"},{"type":"reference","identifier":"https:\/\/www.amiiboapi.org","isActive":true},{"text":" backend service seamlessly, by not only providing the ","type":"text"},{"type":"emphasis","inlineContent":[{"text":"service","type":"text"}]},{"text":" type but also any possible ","type":"text"},{"type":"emphasis","inlineContent":[{"text":"models","type":"text"}]},{"text":", ","type":"text"},{"type":"emphasis","inlineContent":[{"text":"filters","type":"text"}]},{"text":", ","type":"text"},{"type":"emphasis","inlineContent":[{"text":"errors","type":"text"}]},{"text":" and ","type":"text"},{"type":"emphasis","inlineContent":[{"type":"text","text":"interfaces"}]},{"type":"text","text":" types that might be needed during implementation."}],"type":"paragraph"},{"level":2,"text":"Design","anchor":"Design","type":"heading"},{"inlineContent":[{"text":"Although it could have been possible to generate a one-to-one RESTful client based on the Open API specification document that describe the available endpoints of the backend service, it was decided to design a ","type":"text"},{"type":"codeVoice","code":"AmiiboService"},{"text":" service type that removes the complexities of the API design imposed by the backend service, and provides the developer with a simple interface, and a seamless experience.","type":"text"}],"type":"paragraph"},{"level":2,"text":"Installation","anchor":"Installation","type":"heading"},{"inlineContent":[{"text":"To use the ","type":"text"},{"type":"codeVoice","code":"AmiiboService"},{"text":" library with your package, then add it as a dependency in the ","type":"text"},{"type":"codeVoice","code":"Package.swift"},{"text":" file:","type":"text"}],"type":"paragraph"},{"syntax":"swift","code":["let package = Package("," \/\/ name, platforms, products, etc."," dependencies: ["," .package(url: \"https:\/\/github.com\/rock-n-code\/amiibo-service\", from: \"1.4.1\"),"," \/\/ other dependencies"," ],"," targets: ["," .target("," name: \"SomeTarget\", "," dependencies: ["," .product(name: \"AmiiboService\", package: \"amiibo-service\"),"," ]"," )"," \/\/ other targets"," ]",")"],"type":"codeListing"},{"inlineContent":[{"type":"text","text":"It is also possible to use the "},{"code":"AmiiboService","type":"codeVoice"},{"type":"text","text":" library with your app in Xcode, then add it as a dependency in your Xcode project."}],"type":"paragraph"},{"name":"Important","content":[{"inlineContent":[{"type":"text","text":"Swift 5.10 or higher is required in order to compile this library."}],"type":"paragraph"}],"style":"important","type":"aside"},{"level":2,"text":"Caching","anchor":"Caching","type":"heading"},{"inlineContent":[{"type":"text","text":"The "},{"type":"reference","overridingTitle":"Amiibo API","overridingTitleInlineContent":[{"type":"text","text":"Amiibo API"}],"identifier":"https:\/\/www.amiiboapi.org","isActive":true},{"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"},{"level":3,"text":"URLCache on the transport layer","anchor":"URLCache-on-the-transport-layer","type":"heading"},{"inlineContent":[{"type":"text","text":"Pass a custom "},{"type":"codeVoice","code":"URLSessionTransport"},{"text":" with a cache-configured ","type":"text"},{"type":"codeVoice","code":"URLSession"},{"type":"text","text":" to "},{"identifier":"doc:\/\/AmiiboService\/documentation\/Am