mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-22 15:06:26 +01:00
52 lines
2.5 KiB
C#
52 lines
2.5 KiB
C#
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using ShareeBike.Repository;
|
|
using ShareeBike.Repository.Response;
|
|
using ShareeBike.Repository.Response.Stations;
|
|
|
|
namespace ShareeBike.Model.Services.CopriApi
|
|
{
|
|
/// <summary> Manages cache which holds copri data.</summary>
|
|
public interface ICachedCopriServer : ICopriServerBase
|
|
{
|
|
/// <summary> Get list of stations. </summary>
|
|
/// <returns>List of all stations.</returns>
|
|
Task<Result<StationsAvailableResponse>> GetStations(bool fromCache = false);
|
|
|
|
/// <summary> Gets a list of bikes from Copri. </summary>
|
|
/// <param name="operatorUri">Uri of the operator host to get bikes from or null if bikes have to be gotten form primary host.</param>
|
|
/// <param name="stationId"> Id of station which is used for filtering bikes. Null if no filtering should be applied.</param>
|
|
/// <param name="bikeId"> Id of bike which is used for filtering bikes. Null if no filtering should be applied.</param>
|
|
/// <returns>Response holding list of bikes.</returns>
|
|
Task<Result<BikesAvailableResponse>> GetBikesAvailable(
|
|
bool fromCache = false,
|
|
Uri operatorUri = null,
|
|
string stationId = null,
|
|
string bikeId = null);
|
|
|
|
/// <summary> Gets a list of bikes reserved/ booked by active user from Copri.</summary>
|
|
/// <returns>Response holding list of bikes.</returns>
|
|
Task<Result<BikesReservedOccupiedResponse>> GetBikesOccupied(bool fromCache = false);
|
|
|
|
/// <summary>Adds https--response to cache if response is ok. </summary>
|
|
/// <param name="response">Response to add to cache.</param>
|
|
void AddToCache(Result<StationsAvailableResponse> result);
|
|
|
|
/// <summary>Adds https--response to cache if response is ok. </summary>
|
|
/// <param name="result">Response to add to cache.</param>
|
|
/// <param name="operatorUri">Uri of the operator host to get bikes from or null if bikes have to be gotten form primary host.</param>
|
|
/// <param name="stationId"> Id of station which is used for filtering bikes. Null if no filtering should be applied.</param>
|
|
/// <param name="bikeId"> Id of bike which is used for filtering bikes. Null if no filtering should be applied.</param>
|
|
void AddToCache(
|
|
Result<BikesAvailableResponse> result,
|
|
Uri operatorUri = null,
|
|
string stationId = null,
|
|
string bikeId = null);
|
|
|
|
/// <summary>Adds https--response to cache if response is ok. </summary>
|
|
/// <param name="response">Response to add to cache.</param>
|
|
/// <returns></returns>
|
|
void AddToCache(Result<BikesReservedOccupiedResponse> result);
|
|
}
|
|
}
|