Example #1
0
 public Dictionary <string, object> ToDictionary()
 {
     return(new Dictionary <string, object>
     {
         { "ConnectionName", ConnectionName }
         , { "DHCPEnabled", DHCPEnabled.ToString() }
         , { "IPAddresses", IPAddresses.ToDictionary(k => k.Index, v => v.Value) }
     });
 }
Example #2
0
        public override string ToString()
        {
            var  sb      = new StringBuilder("RuyiNetworkSettings(");
            bool __first = true;

            if (Connection != null && __isset.connection)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Connection: ");
                sb.Append(Connection == null ? "<null>" : Connection.ToString());
            }
            if (NetworkType != null && __isset.networkType)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("NetworkType: ");
                sb.Append(NetworkType == null ? "<null>" : NetworkType.ToString());
            }
            if (Quality != null && __isset.quality)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Quality: ");
                sb.Append(Quality == null ? "<null>" : Quality.ToString());
            }
            if (SSID != null && __isset.SSID)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("SSID: ");
                sb.Append(SSID == null ? "<null>" : SSID.ToString());
            }
            if (BSSID != null && __isset.BSSID)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("BSSID: ");
                sb.Append(BSSID == null ? "<null>" : BSSID.ToString());
            }
            if (Authentication != null && __isset.Authentication)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Authentication: ");
                sb.Append(Authentication == null ? "<null>" : Authentication.ToString());
            }
            if (DHCPEnabled != null && __isset.DHCPEnabled)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("DHCPEnabled: ");
                sb.Append(DHCPEnabled == null ? "<null>" : DHCPEnabled.ToString());
            }
            if (IpAddress != null && __isset.IpAddress)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("IpAddress: ");
                sb.Append(IpAddress == null ? "<null>" : IpAddress.ToString());
            }
            if (SubMask != null && __isset.SubMask)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("SubMask: ");
                sb.Append(SubMask == null ? "<null>" : SubMask.ToString());
            }
            if (Gateway != null && __isset.Gateway)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Gateway: ");
                sb.Append(Gateway == null ? "<null>" : Gateway.ToString());
            }
            if (MainDNS != null && __isset.MainDNS)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("MainDNS: ");
                sb.Append(MainDNS == null ? "<null>" : MainDNS.ToString());
            }
            if (SubDNS != null && __isset.SubDNS)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("SubDNS: ");
                sb.Append(SubDNS == null ? "<null>" : SubDNS.ToString());
            }
            if (MacAddress != null && __isset.MacAddress)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("MacAddress: ");
                sb.Append(MacAddress == null ? "<null>" : MacAddress.ToString());
            }
            if (Proxy != null && __isset.Proxy)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Proxy: ");
                sb.Append(Proxy == null ? "<null>" : Proxy.ToString());
            }
            sb.Append(")");
            return(sb.ToString());
        }
Example #3
0
        public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("RuyiNetworkSettings");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                if (Connection != null && __isset.connection)
                {
                    field.Name = "connection";
                    field.Type = TType.Struct;
                    field.ID   = 1;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Connection.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (NetworkType != null && __isset.networkType)
                {
                    field.Name = "networkType";
                    field.Type = TType.Struct;
                    field.ID   = 2;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await NetworkType.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Quality != null && __isset.quality)
                {
                    field.Name = "quality";
                    field.Type = TType.Struct;
                    field.ID   = 3;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Quality.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (SSID != null && __isset.SSID)
                {
                    field.Name = "SSID";
                    field.Type = TType.Struct;
                    field.ID   = 4;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await SSID.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (BSSID != null && __isset.BSSID)
                {
                    field.Name = "BSSID";
                    field.Type = TType.Struct;
                    field.ID   = 5;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await BSSID.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Authentication != null && __isset.Authentication)
                {
                    field.Name = "Authentication";
                    field.Type = TType.Struct;
                    field.ID   = 6;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Authentication.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (DHCPEnabled != null && __isset.DHCPEnabled)
                {
                    field.Name = "DHCPEnabled";
                    field.Type = TType.Struct;
                    field.ID   = 7;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await DHCPEnabled.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (IpAddress != null && __isset.IpAddress)
                {
                    field.Name = "IpAddress";
                    field.Type = TType.Struct;
                    field.ID   = 8;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await IpAddress.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (SubMask != null && __isset.SubMask)
                {
                    field.Name = "SubMask";
                    field.Type = TType.Struct;
                    field.ID   = 9;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await SubMask.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Gateway != null && __isset.Gateway)
                {
                    field.Name = "Gateway";
                    field.Type = TType.Struct;
                    field.ID   = 10;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Gateway.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (MainDNS != null && __isset.MainDNS)
                {
                    field.Name = "MainDNS";
                    field.Type = TType.Struct;
                    field.ID   = 11;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await MainDNS.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (SubDNS != null && __isset.SubDNS)
                {
                    field.Name = "SubDNS";
                    field.Type = TType.Struct;
                    field.ID   = 12;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await SubDNS.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (MacAddress != null && __isset.MacAddress)
                {
                    field.Name = "MacAddress";
                    field.Type = TType.Struct;
                    field.ID   = 13;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await MacAddress.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (Proxy != null && __isset.Proxy)
                {
                    field.Name = "Proxy";
                    field.Type = TType.Struct;
                    field.ID   = 14;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Proxy.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }
Example #4
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("RuyiNetworkSettings");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (Connection != null && __isset.connection)
         {
             field.Name = "connection";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             Connection.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (NetworkType != null && __isset.networkType)
         {
             field.Name = "networkType";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             NetworkType.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Quality != null && __isset.quality)
         {
             field.Name = "quality";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             Quality.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SSID != null && __isset.SSID)
         {
             field.Name = "SSID";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             SSID.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (BSSID != null && __isset.BSSID)
         {
             field.Name = "BSSID";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             BSSID.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Authentication != null && __isset.Authentication)
         {
             field.Name = "Authentication";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             Authentication.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (DHCPEnabled != null && __isset.DHCPEnabled)
         {
             field.Name = "DHCPEnabled";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             DHCPEnabled.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (IpAddress != null && __isset.IpAddress)
         {
             field.Name = "IpAddress";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             IpAddress.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SubMask != null && __isset.SubMask)
         {
             field.Name = "SubMask";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             SubMask.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Gateway != null && __isset.Gateway)
         {
             field.Name = "Gateway";
             field.Type = TType.Struct;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             Gateway.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MainDNS != null && __isset.MainDNS)
         {
             field.Name = "MainDNS";
             field.Type = TType.Struct;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             MainDNS.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SubDNS != null && __isset.SubDNS)
         {
             field.Name = "SubDNS";
             field.Type = TType.Struct;
             field.ID   = 12;
             oprot.WriteFieldBegin(field);
             SubDNS.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MacAddress != null && __isset.MacAddress)
         {
             field.Name = "MacAddress";
             field.Type = TType.Struct;
             field.ID   = 13;
             oprot.WriteFieldBegin(field);
             MacAddress.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Proxy != null && __isset.Proxy)
         {
             field.Name = "Proxy";
             field.Type = TType.Struct;
             field.ID   = 14;
             oprot.WriteFieldBegin(field);
             Proxy.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }