/// <summary> /// Create a new GetServiceAuthorisation response. /// </summary> /// <param name="Request">The GetServiceAuthorisation request leading to this response.</param> /// <param name="TransactionId">A transaction identification.</param> /// <param name="AuthorisationValue">The result of the authorisation.</param> /// <param name="ServiceSessionId">The GIREVE session id for this service session.</param> /// <param name="IntermediateCDRRequested">Whether the eMSP wishes to receive intermediate charging session records.</param> /// <param name="RequestStatus">The status of the request.</param> /// /// <param name="SalesPartnerOperatorId">The optional sales operator identification.</param> /// <param name="UserContractIdAlias">An optional alias of the contract id between the end-user and the eMSP. This alias may have been anonymised by the eMSP.</param> /// <param name="MeterLimits">An optional meter limits for this authorisation: The eMSP can authorise the charge but for less than x kWh or y minutes, or z euros.</param> /// <param name="Parameter">Optional information from the CPO to the eMSP.</param> /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param> /// <param name="CustomData">Optional additional customer-specific data.</param> public GetServiceAuthorisationResponse(GetServiceAuthorisationRequest Request, Transaction_Id TransactionId, AuthorisationValues AuthorisationValue, ServiceSession_Id ServiceSessionId, Boolean IntermediateCDRRequested, RequestStatus RequestStatus, Provider_Id?SalesPartnerOperatorId = null, Contract_Id?UserContractIdAlias = null, IEnumerable <MeterReport> MeterLimits = null, String Parameter = null, HTTPResponse HTTPResponse = null, IReadOnlyDictionary <String, Object> CustomData = null) : base(Request, TransactionId, RequestStatus, HTTPResponse, CustomData) { this.AuthorisationValue = AuthorisationValue; this.ServiceSessionId = ServiceSessionId; this.IntermediateCDRRequested = IntermediateCDRRequested; this.SalesPartnerOperatorId = SalesPartnerOperatorId; this.UserContractIdAlias = UserContractIdAlias; this.MeterLimits = MeterLimits ?? new MeterReport[0]; this.Parameter = Parameter; }
/// <summary> /// Return a text representation of the given authorisation value. /// </summary> /// <param name="AuthorisationValue">An authorisation value.</param> public static String AsText(this AuthorisationValues AuthorisationValue) { switch (AuthorisationValue) { case AuthorisationValues.OK: return("1"); case AuthorisationValues.KO: return("2"); default: return("undefined"); } }
/// <summary> /// Return a numeric representation of the given authorisation value. /// </summary> /// <param name="AuthorisationValue">An authorisation value.</param> public static Byte AsNumber(this AuthorisationValues AuthorisationValue) { switch (AuthorisationValue) { case AuthorisationValues.OK: return(1); case AuthorisationValues.KO: return(2); default: return(0); } }