sharee.bike-App/TINKLib/Repository/CopriCallsStatic.cs

29 lines
1 KiB
C#
Raw Normal View History

2021-05-13 20:03:07 +02:00
using TINK.Model.Repository.Response;
using TINK.Repository.Response;
namespace TINK.Model.Repository
{
public static class CopriCallsStatic
{
/// <summary>
/// Deserializes JSON from response string.
/// </summary>
/// <param name="p_strResponse">Response to deserialize.</param>
/// <returns></returns>
public static BikesAvailableResponse DeserializeBikesAvailableResponse(string p_strResponse)
{
return JsonConvert.DeserializeObject<ResponseContainer<BikesAvailableResponse>>(p_strResponse)?.tinkjson;
}
/// <summary>
/// Deserializes JSON from response string.
/// </summary>
/// <param name="p_strResponse">Response to deserialize.</param>
/// <returns></returns>
public static BikesReservedOccupiedResponse DeserializeBikesOccupiedResponse(string p_strResponse)
{
return JsonConvert.DeserializeObject<ResponseContainer<BikesReservedOccupiedResponse>>(p_strResponse)?.tinkjson;
}
}
}