mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Version 3.0.290
This commit is contained in:
parent
af3c20ea1c
commit
ad3cdbcadf
231 changed files with 14555 additions and 7798 deletions
|
@ -8,6 +8,9 @@ namespace TINK.Repository.Response
|
|||
{
|
||||
public const string RESPONSE_OK = "OK";
|
||||
|
||||
/// <summary> Holds the description of the action return bike. </summary>
|
||||
public const string RESPONSE_AUTHCOOKIE_EXPRIED = "Failure 1001:";
|
||||
|
||||
/// <summary> Holds the description of the action logout. </summary>
|
||||
public const string BIKES_LOGOUT_ACTIONTEXT = "Abmeldung fehlgeschlagen.";
|
||||
|
||||
|
@ -127,6 +130,34 @@ namespace TINK.Repository.Response
|
|||
return bikeInfoRequestedOccupied;
|
||||
}
|
||||
|
||||
/// <summary> Gets if request is ok.</summary>
|
||||
/// <param name="response">Response to verify.</param>
|
||||
/// <param name="textOfAction">Text describing request which is shown if validation fails.</param>
|
||||
/// <returns>Verified response.</returns>
|
||||
public static BikesReservedOccupiedResponse GetIsResponseOk(this BikesReservedOccupiedResponse response, string textOfAction)
|
||||
{
|
||||
if (response == null || response.response_state == null)
|
||||
{
|
||||
throw new InvalidResponseException<BikesReservedOccupiedResponse>(textOfAction, null);
|
||||
}
|
||||
|
||||
if (AuthcookieNotDefinedException.IsAuthcookieNotDefined(response, textOfAction, out AuthcookieNotDefinedException exception))
|
||||
{
|
||||
throw exception;
|
||||
}
|
||||
|
||||
if (response.response_state.Trim().ToUpper().StartsWith(RESPONSE_AUTHCOOKIE_EXPRIED.ToUpper()))
|
||||
{
|
||||
throw new AuthcookieNotDefinedException(
|
||||
$"{textOfAction}\r\n{AppResources.ExceptionTextSessionExpired}",
|
||||
response);
|
||||
}
|
||||
|
||||
GetIsResponseOk((ResponseBase)response, textOfAction);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary> Gets if request is ok.</summary>
|
||||
/// <param name="response">Response to verify.</param>
|
||||
/// <param name="textOfAction">Text describing request which is shown if validation fails.</param>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue