예제 #1
0
        /// <summary>
        /// Create a new remote start result.
        /// </summary>
        /// <param name="AuthorizatorId">An authorizator identification.</param>
        /// <param name="ErrorMessage">An error message.</param>
        private AuthStartResult(Authorizator_Id AuthorizatorId,
                                String ErrorMessage = null)
        {
            #region Initial checks

            if (AuthorizatorId == null)
            {
                throw new ArgumentNullException("AuthorizatorId", "The given parameter must not be null!");
            }

            #endregion

            this._Result               = AuthStartResultType.Error;
            this._AuthorizatorId       = AuthorizatorId;
            this._Description          = ErrorMessage != null ? ErrorMessage         : String.Empty;
            this._ListOfAuthStopTokens = ListOfAuthStopTokens != null ? ListOfAuthStopTokens : new Auth_Token[0];
            this._ListOfAuthStopPINs   = ListOfAuthStopPINs != null ? ListOfAuthStopPINs   : new UInt32[0];
        }
예제 #2
0
        /// <summary>
        /// Create a new authorize start result.
        /// </summary>
        /// <param name="AuthorizatorId">The identification of the authorizing entity.</param>
        /// <param name="Result">The authorize start result type.</param>
        /// <param name="ProviderId">An optional identification of the ev service provider.</param>
        /// <param name="Description">An optional description of the auth start result.</param>
        /// <param name="AdditionalInfo">An optional additional message.</param>
        private AuthStartResult(Authorizator_Id AuthorizatorId,
                                AuthStartResultType Result,
                                EVSP_Id ProviderId    = null,
                                String Description    = null,
                                String AdditionalInfo = null)
        {
            #region Initial checks

            if (AuthorizatorId == null)
            {
                throw new ArgumentNullException("AuthorizatorId", "The given parameter must not be null!");
            }

            #endregion

            this._AuthorizatorId       = AuthorizatorId;
            this._Result               = Result;
            this._ProviderId           = ProviderId;
            this._Description          = Description != null ? Description    : String.Empty;
            this._AdditionalInfo       = AdditionalInfo != null ? AdditionalInfo : String.Empty;
            this._ListOfAuthStopTokens = new Auth_Token[0];
            this._ListOfAuthStopPINs   = new UInt32[0];
        }
예제 #3
0
        /// <summary>
        /// Create a new successful authorize start result.
        /// </summary>
        /// <param name="AuthorizatorId">The identification of the authorizing entity.</param>
        /// <param name="SessionId">The charging session identification for the authorize start operation.</param>
        /// <param name="ProviderId">The unique identification of the ev service provider.</param>
        /// <param name="Description">An optional description of the auth start result.</param>
        /// <param name="AdditionalInfo">An optional additional message.</param>
        /// <param name="ListOfAuthStopTokens">An optional enumeration of authorize stop tokens.</param>
        /// <param name="ListOfAuthStopPINs">An optional enumeration of authorize stop PINs.</param>
        private AuthStartResult(Authorizator_Id AuthorizatorId,
                                ChargingSession_Id SessionId,
                                EVSP_Id ProviderId,
                                String Description    = null,
                                String AdditionalInfo = null,
                                IEnumerable <Auth_Token> ListOfAuthStopTokens = null,
                                IEnumerable <UInt32> ListOfAuthStopPINs       = null)
        {
            #region Initial checks

            if (AuthorizatorId == null)
            {
                throw new ArgumentNullException("AuthorizatorId", "The given parameter must not be null!");
            }

            if (SessionId == null)
            {
                throw new ArgumentNullException(nameof(SessionId), "The given parameter must not be null!");
            }

            if (ProviderId == null)
            {
                throw new ArgumentNullException("ProviderId", "The given parameter must not be null!");
            }

            #endregion

            this._Result               = AuthStartResultType.Authorized;
            this._AuthorizatorId       = AuthorizatorId;
            this._SessionId            = SessionId;
            this._ProviderId           = ProviderId;
            this._Description          = Description != null ? Description          : String.Empty;
            this._AdditionalInfo       = AdditionalInfo != null ? AdditionalInfo       : String.Empty;
            this._ListOfAuthStopTokens = ListOfAuthStopTokens != null ? ListOfAuthStopTokens : new Auth_Token[0];
            this._ListOfAuthStopPINs   = ListOfAuthStopPINs != null ? ListOfAuthStopPINs   : new UInt32[0];
        }