sharee.bike-App/TINKLib/Repository/AppContextInfo.cs
2022-01-04 18:54:03 +01:00

36 lines
1 KiB
C#

using System;
namespace TINK.Repository
{
/// <summary>
/// Holds info passed to COPRI.
/// </summary>
public class AppContextInfo
{
public AppContextInfo(string merchantId, string name, Version version)
{
Name = !string.IsNullOrEmpty(name)
? name
: throw new ArgumentNullException(nameof(name));
Version = version;
MerchantId = !string.IsNullOrEmpty(merchantId)
? merchantId
: throw new ArgumentNullException(nameof(merchantId));
}
/// <summary> Name of the app. </summary>
public string Name { get; private set; }
/// <summary> Version of the app.</summary>
public Version Version { get; private set; }
/// <summary> Merchang id of the app. </summary>
public string MerchantId { get; private set; }
/// <summary> Returns http- user agent.</summary>
public string UserAgent { get => $"{Name}/{Version}"; }
}
}