amiibo-service/Sources/Endpoints/GetAmiiboEndpoint.swift
Javier Cicchelli f34ce5289d [Feature] Service (#4)
This PR contains the work done to implement the actual public service interface to the Amiibo API.

To provide further details about this work:
- [x] defined a `Filter` protocol;
- [x] implemented the `AmiiboFilter` and the `KeyNameFilter` filters;
- [x] implemented the `Result` model;
- [x] defined the `Service` protocol;
- [x] implemented the `AmiiboService` concrete service;
- [x] fixed the `path` of the `GetAmiiboEndpoint` endpoint;
- [x] made the `usage` property of the `Game` model optional;
- [x] replaced the `showGames` and the `showUsage` flags of the `AmiiboFilter` filter with an enumeration.

Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Reviewed-on: #4
2023-04-21 18:16:38 +00:00

24 lines
511 B
Swift

import Communications
import Foundation
struct GetAmiiboEndpoint: Endpoint {
// MARK: Properties
let scheme: String = .Scheme.https
let host: String = .Host.amiiboApi
let port: Int? = nil
let path: String = .Path.amiibo
let parameters: Parameters
let method: HTTPRequestMethod = .get
let headers: [String : String] = [:]
let body: Data? = nil
// MARK: Initialisers
init(parameters: Parameters) {
self.parameters = parameters
}
}