public static PathPaymentResult Decode(XdrDataInputStream stream)
        {
            PathPaymentResult     decodedPathPaymentResult = new PathPaymentResult();
            PathPaymentResultCode discriminant             = PathPaymentResultCode.Decode(stream);

            decodedPathPaymentResult.Discriminant = discriminant;
            switch (decodedPathPaymentResult.Discriminant.InnerValue)
            {
            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_SUCCESS:
                decodedPathPaymentResult.Success = PathPaymentResultSuccess.Decode(stream);
                break;

            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_NO_ISSUER:
                decodedPathPaymentResult.NoIssuer = Asset.Decode(stream);
                break;

            default:
                break;
            }
            return(decodedPathPaymentResult);
        }
 public static void Encode(XdrDataOutputStream stream, PathPaymentResultCode value)
 {
     stream.WriteInt((int)value.InnerValue);
 }