Example #1
0
        /// <summary>
        /// Return a text representation of this object.
        /// </summary>
        public override String ToString()
        {
            if (AuthToken.HasValue)
            {
                return(AuthToken.ToString());
            }

            if (QRCodeIdentification != null)
            {
                return(QRCodeIdentification.ToString());
            }

            if (PlugAndChargeIdentification.HasValue)
            {
                return(PlugAndChargeIdentification.Value.ToString());
            }

            if (RemoteIdentification.HasValue)
            {
                return(RemoteIdentification.Value.ToString());
            }

            if (PIN.HasValue)
            {
                return(PIN.Value.ToString());
            }

            if (PublicKey != null)
            {
                return(PublicKey.Fingerprint.ToHexString());
            }

            return(String.Empty);
        }
Example #2
0
        public JObject ToJSON()

        => JSONObject.Create(

            AuthToken.HasValue
                       ? new JProperty("authToken", AuthToken.ToString())
                       : null,

            QRCodeIdentification != null
                       ? new JProperty("QRCodeIdentification", QRCodeIdentification.ToString())
                       : null,

            PlugAndChargeIdentification.HasValue
                       ? new JProperty("plugAndChargeIdentification", PlugAndChargeIdentification.ToString())
                       : null,

            RemoteIdentification.HasValue
                       ? new JProperty("remoteIdentification", RemoteIdentification.ToString())
                       : null,

            PIN.HasValue
                       ? new JProperty("PIN", PIN.ToString())
                       : null,

            PublicKey != null
                       ? new JProperty("publicKey", PublicKey.ToString())
                       : null

            );