[Setup] License #12

Merged
javier merged 3 commits from setup/license into main 2023-04-23 13:57:50 +00:00
36 changed files with 432 additions and 0 deletions
Showing only changes of commit a327fcd493 - Show all commits

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
/// This error definitions represents any error happening while the client makes a request to the remote API and handles the respective response, excluding the decoding of the retrieved data into a particular model. /// This error definitions represents any error happening while the client makes a request to the remote API and handles the respective response, excluding the decoding of the retrieved data into a particular model.
public enum AmiiboClientError: Error { public enum AmiiboClientError: Error {
/// The status code of the response is not the expected one, which is `.ok` (`200`). /// The status code of the response is not the expected one, which is `.ok` (`200`).

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Core import Core
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
extension String { extension String {
enum Host { enum Host {
static let amiiboApi = "www.amiiboapi.com" static let amiiboApi = "www.amiiboapi.com"

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
extension String { extension String {
enum Path { enum Path {
static let amiibo = "/api/amiibo/" static let amiibo = "/api/amiibo/"

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
extension String { extension String {
enum Scheme { enum Scheme {
static let https = "https" static let https = "https"

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibos. /// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibos.
public struct AmiiboFilter { public struct AmiiboFilter {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
/// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibos series (``AmiiboSeriesFilter``), amiibo types (``AmiiboTypeFilter``), characters (``CharacterFilter``), or game series (``GameSeriesFilter``). /// This filter provides all the possible parameters (and combinations) available at the remote API applies when filtering amiibos series (``AmiiboSeriesFilter``), amiibo types (``AmiiboTypeFilter``), characters (``CharacterFilter``), or game series (``GameSeriesFilter``).
public struct KeyNameFilter { public struct KeyNameFilter {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
/// This model struct represents an amiibo that is retrieved from the respective [remote API endpoint](https://www.amiiboapi.com/docs/#amiibo). /// This model struct represents an amiibo that is retrieved from the respective [remote API endpoint](https://www.amiiboapi.com/docs/#amiibo).
public struct Amiibo { public struct Amiibo {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
extension Amiibo { extension Amiibo {
/// This model structs represents a game that is related to an amiibo, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showGames). /// This model structs represents a game that is related to an amiibo, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showGames).
public struct Game { public struct Game {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
extension Amiibo.Game { extension Amiibo.Game {
/// This model struct represents how an amiibo is used with a particular game, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showUsage). /// This model struct represents how an amiibo is used with a particular game, when requested to the respective [remote API endpoint](https://www.amiiboapi.com/docs/#showUsage).
public struct Usage { public struct Usage {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Foundation import Foundation
extension Amiibo { extension Amiibo {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
/// This model is a concrete genetic definition that represents the following models: ``AmiiboSeries``, ``AmiiboType``, ``Character`` and ``GameSeries``. /// This model is a concrete genetic definition that represents the following models: ``AmiiboSeries``, ``AmiiboType``, ``Character`` and ``GameSeries``.
public struct KeyName { public struct KeyName {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Foundation import Foundation
/// This model represents the latest date when the remote API has been updated. /// This model represents the latest date when the remote API has been updated.

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
struct Result<Model: Decodable> { struct Result<Model: Decodable> {
let items: [Model] let items: [Model]
} }

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
protocol Filter { protocol Filter {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Foundation import Foundation
protocol Service { protocol Service {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Foundation import Foundation
/// This service provides the interface to make remote API calls to the [Amiibo API](https://www.amiiboapi.com) and, subsequently, handle its responses. /// This service provides the interface to make remote API calls to the [Amiibo API](https://www.amiiboapi.com) and, subsequently, handle its responses.

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation
import XCTest import XCTest

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Foundation import Foundation
extension Data { extension Data {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
@testable import AmiiboService @testable import AmiiboService
extension GetAmiiboEndpoint { extension GetAmiiboEndpoint {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
@testable import AmiiboService @testable import AmiiboService
extension GetCharacterEndpoint { extension GetCharacterEndpoint {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
@testable import AmiiboService @testable import AmiiboService
extension GetGameSeriesEndpoint { extension GetGameSeriesEndpoint {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
@testable import AmiiboService @testable import AmiiboService
extension GetSeriesEndpoint { extension GetSeriesEndpoint {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
@testable import AmiiboService @testable import AmiiboService
extension GetTypeEndpoint { extension GetTypeEndpoint {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
extension String { extension String {
enum Amiibo { enum Amiibo {
static let withoutGameOrUsage = "{\"amiibo\":[{\"amiiboSeries\":\"Super Smash Bros.\",\"character\":\"Mario\",\"gameSeries\":\"Super Mario\",\"head\":\"00000000\",\"image\":\"https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_00000000-00000002.png\",\"name\":\"Mario\",\"release\":{\"au\":\"2014-11-29\",\"eu\":\"2014-11-28\",\"jp\":\"2014-12-06\",\"na\":\"2014-11-21\"},\"tail\":\"00000002\",\"type\":\"Figure\"},{\"amiiboSeries\":\"Super Mario Bros.\",\"character\":\"Mario\",\"gameSeries\":\"Super Mario\",\"head\":\"00000000\",\"image\":\"https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_00000000-00340102.png\",\"name\":\"Mario\",\"release\":{\"au\":\"2015-03-21\",\"eu\":\"2015-03-20\",\"jp\":\"2015-03-12\",\"na\":\"2015-03-20\"},\"tail\":\"00340102\",\"type\":\"Figure\"}]}" static let withoutGameOrUsage = "{\"amiibo\":[{\"amiiboSeries\":\"Super Smash Bros.\",\"character\":\"Mario\",\"gameSeries\":\"Super Mario\",\"head\":\"00000000\",\"image\":\"https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_00000000-00000002.png\",\"name\":\"Mario\",\"release\":{\"au\":\"2014-11-29\",\"eu\":\"2014-11-28\",\"jp\":\"2014-12-06\",\"na\":\"2014-11-21\"},\"tail\":\"00000002\",\"type\":\"Figure\"},{\"amiiboSeries\":\"Super Mario Bros.\",\"character\":\"Mario\",\"gameSeries\":\"Super Mario\",\"head\":\"00000000\",\"image\":\"https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_00000000-00340102.png\",\"name\":\"Mario\",\"release\":{\"au\":\"2015-03-21\",\"eu\":\"2015-03-20\",\"jp\":\"2015-03-12\",\"na\":\"2015-03-20\"},\"tail\":\"00340102\",\"type\":\"Figure\"}]}"

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Foundation import Foundation
struct TestModel: Decodable { struct TestModel: Decodable {

View File

@ -1,3 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the AmiiboService open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the AmiiboService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AmiiboService project authors
//
//===----------------------------------------------------------------------===//
import Communications import Communications
import Foundation import Foundation
import XCTest import XCTest