mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 02:26:29 +01:00
39 lines
1.5 KiB
C#
39 lines
1.5 KiB
C#
using System;
|
|
using TINK.Repository;
|
|
|
|
namespace TINK.Model.Connector
|
|
{
|
|
/// <summary>Holds user infromation required for copri related commands/ query operations. </summary>
|
|
public class BaseLoggedIn : Base
|
|
{
|
|
/// <summary>Session cookie used to sign in to copri.</summary>
|
|
public string SessionCookie { get; }
|
|
|
|
/// <summary> Mail address of the user. </summary>
|
|
protected string Mail { get; }
|
|
|
|
/// <summary> Object which provides date time info. </summary>
|
|
protected readonly Func<DateTime> DateTimeProvider;
|
|
|
|
/// <summary>Constructs a copri query object.</summary>
|
|
/// <param name="copriServer">Server which implements communication.</param>
|
|
public BaseLoggedIn(ICopriServerBase copriServer,
|
|
string sessionCookie,
|
|
string mail,
|
|
Func<DateTime> p_oDateTimeProvider) : base(copriServer)
|
|
{
|
|
if (string.IsNullOrEmpty(sessionCookie))
|
|
throw new ArgumentException("Can not instantiate query object- object. Session cookie must never be null or emtpy.");
|
|
|
|
if (string.IsNullOrEmpty(mail))
|
|
throw new ArgumentException("Can not instantiate query object- object. Mail address must never be null or emtpy.");
|
|
|
|
DateTimeProvider = p_oDateTimeProvider
|
|
?? throw new ArgumentException("Can not instantiate connector- object. No date time provider object available.");
|
|
|
|
SessionCookie = sessionCookie;
|
|
|
|
Mail = mail;
|
|
}
|
|
}
|
|
}
|