This PR contains the work done to setup the library and also, the necessary protocols, model, structs, and error definitions to implement remote service clients. Reviewed-on: #4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
45 lines
881 B
Swift
45 lines
881 B
Swift
//
|
|
// GetReviewsEndpoint.swift
|
|
// ReviewsFeedKit
|
|
//
|
|
// Created by Javier Cicchelli on 17/03/2024.
|
|
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public protocol GetReviewsEndpoint: Endpoint
|
|
where Input == GetReviewsInput,
|
|
Output == GetReviewsOutput {}
|
|
|
|
// MARK: - Input
|
|
public struct GetReviewsInput: EndpointInput {
|
|
|
|
// MARK: Constants
|
|
public let appID: String
|
|
public let countryCode: String
|
|
|
|
// MARK: Initialisers
|
|
public init(
|
|
appID: String,
|
|
countryCode: String
|
|
) {
|
|
self.appID = appID
|
|
self.countryCode = countryCode
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - Output
|
|
public struct GetReviewsOutput: EndpointOutput {
|
|
|
|
// MARK: Constants
|
|
public let reviews: [Review]
|
|
|
|
// MARK: Initialisers
|
|
public init(reviews: [Review]) {
|
|
self.reviews = reviews
|
|
}
|
|
|
|
}
|