/// <summary> /// Creates an auth method based on several options /// </summary> /// <example> /// new AuthMethod( /// "face", /// false, /// false, /// true, /// true, /// null, /// null, /// null /// ) /// </example> /// <param name="method">A string representing the auth method</param> /// <param name="set">Whether the subscriber set up this method. Can be null</param> /// <param name="active">Whether the method can be used</param> /// <param name="allowed">Whether the subscriber has disallowed this method</param> /// <param name="supported">Whether the device supports this method</param> /// <param name="userRequired">Whether the subscriber requires this method. Can be null</param> /// <param name="passed">Whether the method was verified or not. Can be null</param> /// <param name="error">Whether there was an error. Can be null</param> public AuthMethod( AuthMethodType method = AuthMethodType.OTHER, bool?set = null, bool active = false, bool allowed = false, bool supported = false, bool?userRequired = null, bool?passed = null, bool?error = null ) { Method = method; Set = set; Active = active; Allowed = allowed; Supported = supported; UserRequired = userRequired; Passed = passed; Error = error; }
/// <summary> /// The Session object describes the Session and its properties /// where a group of EVSEs that belong together are installed. /// </summary> /// <param name="Id">Uniquely identifies the Session within the CPOs platform (and suboperator platforms).</param> /// <param name="Start">The time when the session became active.</param> /// <param name="End">The time when the session is completed.</param> /// <param name="kWh">How many kWh are charged.</param> /// <param name="AuthId">An id provided by the authentication used so that the eMSP knows to which driver the session belongs.</param> /// <param name="AuthMethod">Method used for authentication.</param> /// <param name="Location">The location where this session took place.</param> /// <param name="EVSE">The EVSE that was used for this session.</param> /// <param name="ConnectorId">Connector ID of the connector used at the EVSE.</param> /// <param name="MeterId">Optional identification of the kWh meter.</param> /// <param name="Currency">ISO 4217 code of the currency used for this session.</param> /// <param name="ChargingPeriods">An optional enumeration of charging periods that can be used to calculate and verify the total cost.</param> /// <param name="TotalCosts">The total cost (excluding VAT) of the session in the specified currency. This is the price that the eMSP will have to pay to the CPO.</param> /// <param name="Status">The status of the session.</param> public Session(Session_Id Id, DateTime Start, DateTime?End, Decimal kWh, Auth_Id AuthId, AuthMethodType AuthMethod, Location Location, EVSE EVSE, Connector_Id ConnectorId, Meter_Id MeterId, Currency Currency, IEnumerable <ChargingPeriod> ChargingPeriods, Decimal TotalCosts, SessionStatusType Status) : base(Id) { #region Initial checks if (AuthId == null) { throw new ArgumentNullException("AuthId", "The given parameter must not be null!"); } if (Location == null) { throw new ArgumentNullException("Location", "The given parameter must not be null!"); } if (EVSE == null) { throw new ArgumentNullException("EVSE", "The given parameter must not be null!"); } if (ConnectorId == null) { throw new ArgumentNullException("ConnectorId", "The given parameter must not be null!"); } if (MeterId == null) { throw new ArgumentNullException("MeterId", "The given parameter must not be null!"); } if (Currency == null) { throw new ArgumentNullException("Currency", "The given parameter must not be null!"); } #endregion #region Init data and properties this._Start = Start; this._End = End; this._kWh = kWh; this._AuthId = AuthId; this._AuthMethod = AuthMethod; this._Location = Location; this._EVSE = EVSE; this._ConnectorId = ConnectorId; this._MeterId = MeterId; this._Currency = Currency; this._ChargingPeriods = ChargingPeriods; this._TotalCosts = TotalCosts; this._Status = Status; #endregion }
/// <summary> /// The CDR object describes the Charging Session and its costs. /// How these costs are build up etc. /// </summary> /// <param name="Id">Uniquely identifies the CDR within the CPOs platform (and suboperator platforms).</param> /// <param name="Start">The time when the CDR became active.</param> /// <param name="End">The time when the CDR is completed.</param> /// <param name="AuthId">An id provided by the authentication used so that the eMSP knows to which driver the CDR belongs.</param> /// <param name="AuthMethod">Method used for authentication.</param> /// <param name="Dimensions">List of relevant values for this charging period.</param> /// <param name="Location">The location where this CDR took place.</param> /// <param name="EVSE">The EVSE that was used for this CDR.</param> /// <param name="ConnectorId">Connector ID of the connector used at the EVSE.</param> /// <param name="MeterId">Optional identification of the kWh meter.</param> /// <param name="Currency">ISO 4217 code of the currency used for this CDR.</param> /// <param name="Tariffs">Enumeration of relevant tariffs.</param> /// <param name="ChargingPeriods">Enumeration of charging periods that make up this charging session. A session consist of 1 or more periodes with, each period has a different relevant Tariff.</param> /// <param name="TotalCosts">The total cost (excluding VAT) of the CDR in the specified currency. This is the price that the eMSP will have to pay to the CPO.</param> /// <param name="Remark">Optional remark, can be used to provide addition human readable information to the CDR, for example: reason why a transaction was stopped.</param> public CDR(CDR_Id Id, DateTime Start, DateTime?End, Auth_Id AuthId, AuthMethodType AuthMethod, IEnumerable <CDRDimension> Dimensions, Location Location, EVSE EVSE, Connector_Id ConnectorId, Meter_Id MeterId, Currency Currency, IEnumerable <Tariff> Tariffs, IEnumerable <ChargingPeriod> ChargingPeriods, Decimal TotalCosts, I18NString Remark) : base(Id) { #region Initial checks if (AuthId == null) { throw new ArgumentNullException("AuthId", "The given parameter must not be null!"); } if (Dimensions == null) { throw new ArgumentNullException("Dimensions", "The given parameter must not be null!"); } if (!Dimensions.Any()) { throw new ArgumentNullException("Dimensions", "The given enumeration must not be empty!"); } if (Location == null) { throw new ArgumentNullException("Location", "The given parameter must not be null!"); } if (EVSE == null) { throw new ArgumentNullException("EVSE", "The given parameter must not be null!"); } if (ConnectorId == null) { throw new ArgumentNullException("ConnectorId", "The given parameter must not be null!"); } if (MeterId == null) { throw new ArgumentNullException("MeterId", "The given parameter must not be null!"); } if (Currency == null) { throw new ArgumentNullException("Currency", "The given parameter must not be null!"); } if (ChargingPeriods == null) { throw new ArgumentNullException("ChargingPeriods", "The given parameter must not be null!"); } if (!ChargingPeriods.Any()) { throw new ArgumentNullException("ChargingPeriods", "The given enumeration must not be empty!"); } #endregion #region Init data and properties this._Start = Start; this._End = End; this._AuthId = AuthId; this._AuthMethod = AuthMethod; this._Dimensions = Dimensions; this._Location = Location; this._EVSE = EVSE; this._ConnectorId = ConnectorId; this._MeterId = MeterId; this._Currency = Currency; this._Tariffs = Tariffs; this._ChargingPeriods = ChargingPeriods; this._TotalCosts = TotalCosts; this._Remark = Remark != null ? Remark : new I18NString(); #endregion }