Exemplo n.º 1
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
 }
Exemplo n.º 2
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "CPU"))
     {
         this.M_cpu = Util.GetByPath(r, "CPU") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "CPU"));
     }
     else
     {
         this.M_cpu        = null;
         this.IsIncomplete = true;
     }
     this.N_cpu = false;
     if (Util.ExistsPath(r, "MemoryMB"))
     {
         this.M_memoryMib = Util.GetByPath(r, "MemoryMB") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "MemoryMB"));
     }
     else
     {
         this.M_memoryMib  = null;
         this.IsIncomplete = true;
     }
     this.N_memoryMib = false;
     if (Util.ExistsPath(r, "ServiceClass"))
     {
         this.M_serviceClass = Util.GetByPath(r, "ServiceClass") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ServiceClass");
     }
     else
     {
         this.M_serviceClass = null;
         this.IsIncomplete   = true;
     }
     this.N_serviceClass = false;
 }
Exemplo n.º 3
0
        public void Test()
        {
            string token  = System.Environment.GetEnvironmentVariable("SACLOUD_TOKEN");
            string secret = System.Environment.GetEnvironmentVariable("SACLOUD_SECRET");
            string zone   = System.Environment.GetEnvironmentVariable("SACLOUD_ZONE");

            Client client = new Client(token, secret);

            if (zone != null && zone != "")
            {
                if (zone == "is1x" || zone == "is1y")
                {
                    client.SetApiRoot("https://secure.sakura.ad.jp/cloud-test/");
                }
                client.SetApiRootSuffix("zone/" + zone + "/");
            }
            Assert.IsInstanceOfType(typeof(Client), client);
            object query = new Hash {
                { "Filter", new Hash {
                      { "Tags", new [] {
                                            new [] { "distro-centos", "distro-ver-6.5" },
                                            new [] { "distro-sl" }
                                        } }
                  } }
            };
            object        obj      = client.Request("GET", "/archive", query);
            List <object> archives = (List <object>)Util.GetByPath(obj, "Archives");

            foreach (object archive in archives)
            {
                Console.WriteLine((string)((Hash)archive)["Name"]);
            }
        }
Exemplo n.º 4
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "NetworkAddress"))
     {
         this.M_address = Util.GetByPath(r, "NetworkAddress") == null ? ((string)(null)) : "" + Util.GetByPath(r, "NetworkAddress");
     }
     else
     {
         this.M_address    = null;
         this.IsIncomplete = true;
     }
     this.N_address = false;
     if (Util.ExistsPath(r, "NetworkMaskLen"))
     {
         this.M_maskLen = Util.GetByPath(r, "NetworkMaskLen") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "NetworkMaskLen"));
     }
     else
     {
         this.M_maskLen    = null;
         this.IsIncomplete = true;
     }
     this.N_maskLen = false;
     if (Util.ExistsPath(r, "DefaultRoute"))
     {
         this.M_defaultRoute = Util.GetByPath(r, "DefaultRoute") == null ? ((string)(null)) : "" + Util.GetByPath(r, "DefaultRoute");
     }
     else
     {
         this.M_defaultRoute = null;
         this.IsIncomplete   = true;
     }
     this.N_defaultRoute = false;
     if (Util.ExistsPath(r, "NextHop"))
     {
         this.M_nextHop = Util.GetByPath(r, "NextHop") == null ? ((string)(null)) : "" + Util.GetByPath(r, "NextHop");
     }
     else
     {
         this.M_nextHop    = null;
         this.IsIncomplete = true;
     }
     this.N_nextHop = false;
 }
Exemplo n.º 5
0
        public string Get_pathToCheck()
        {
            if (!Util.ExistsPath(this.RawSettings, "GSLB.HealthCheck.Path"))
            {
                return(null);
            }
            string raw = ((string)(Util.GetByPath(this.RawSettings, "GSLB.HealthCheck.Path")));

            return(raw);
        }
        internal override Resource _CreateResourceImpl(object obj, bool wrapped = false)
        {
            string clazz = ((string)(Util.GetByPath(obj, "CommonServiceItem.Provider.Class")));

            if (clazz == "gslb")
            {
                return(new Gslb(this._Client, obj, wrapped));
            }
            return(new CommonServiceItem(this._Client, obj, wrapped));
        }
Exemplo n.º 7
0
        public long Get_vrid()
        {
            string vrid = Util.GetByPath(this.RawAnnotation, "VRRP.VRID").ToString();

            if (vrid == null)
            {
                throw new SaklientException("invalid_data", "Data of the resource is invalid");
            }
            return((long)System.Convert.ToInt64("" + vrid));
        }
Exemplo n.º 8
0
        public long Get_responseExpected()
        {
            object raw = Util.GetByPath(this.RawSettings, "GSLB.HealthCheck.Status");

            if (raw == null)
            {
                throw new SaklientException("invalid_data", "Data of the resource is invalid");
            }
            return((long)System.Convert.ToInt64("" + raw.ToString()));
        }
Exemplo n.º 9
0
        public long Get_maskLen()
        {
            string maskLen = Util.GetByPath(this.RawAnnotation, "Network.NetworkMaskLen").ToString();

            if (maskLen == null)
            {
                throw new SaklientException("invalid_data", "Data of the resource is invalid");
            }
            return((long)System.Convert.ToInt64("" + maskLen));
        }
Exemplo n.º 10
0
        public string Get_protocol()
        {
            string raw = ((string)(Util.GetByPath(this.RawSettings, "GSLB.HealthCheck.Protocol")));

            if (raw == null)
            {
                throw new SaklientException("invalid_data", "Data of the resource is invalid");
            }
            return(raw);
        }
Exemplo n.º 11
0
        public bool Get_weighted()
        {
            string weighted = Util.GetByPath(this.RawSettings, "GSLB.Weighted").ToString();

            if (weighted == null)
            {
                throw new SaklientException("invalid_data", "Data of the resource is invalid");
            }
            return(weighted.ToLower() == "true");
        }
Exemplo n.º 12
0
        public long Get_delayLoop()
        {
            string delayLoop = Util.GetByPath(this.RawSettings, "GSLB.DelayLoop").ToString();

            if (delayLoop == null)
            {
                throw new SaklientException("invalid_data", "Data of the resource is invalid");
            }
            return((long)System.Convert.ToInt64("" + delayLoop));
        }
Exemplo n.º 13
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "Status"))
     {
         this.M_status = Util.GetByPath(r, "Status") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Status");
     }
     else
     {
         this.M_status     = null;
         this.IsIncomplete = true;
     }
     this.N_status = false;
     if (Util.ExistsPath(r, "BeforeStatus"))
     {
         this.M_beforeStatus = Util.GetByPath(r, "BeforeStatus") == null ? ((string)(null)) : "" + Util.GetByPath(r, "BeforeStatus");
     }
     else
     {
         this.M_beforeStatus = null;
         this.IsIncomplete   = true;
     }
     this.N_beforeStatus = false;
     if (Util.ExistsPath(r, "StatusChangedAt"))
     {
         this.M_statusChangedAt = Util.GetByPath(r, "StatusChangedAt") == null ? ((System.DateTime?)(null)) : Util.Str2date("" + Util.GetByPath(r, "StatusChangedAt"));
     }
     else
     {
         this.M_statusChangedAt = null;
         this.IsIncomplete      = true;
     }
     this.N_statusChangedAt = false;
     if (Util.ExistsPath(r, "CDROM"))
     {
         this.M_isoImage = Util.GetByPath(r, "CDROM") == null ? null : new IsoImage(this._Client, Util.GetByPath(r, "CDROM"));
     }
     else
     {
         this.M_isoImage   = null;
         this.IsIncomplete = true;
     }
     this.N_isoImage = false;
 }
Exemplo n.º 14
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "IPv6Prefix"))
     {
         this.M_prefix = Util.GetByPath(r, "IPv6Prefix") == null ? ((string)(null)) : "" + Util.GetByPath(r, "IPv6Prefix");
     }
     else
     {
         this.M_prefix     = null;
         this.IsIncomplete = true;
     }
     this.N_prefix = false;
     if (Util.ExistsPath(r, "IPv6PrefixLen"))
     {
         this.M_prefixLen = Util.GetByPath(r, "IPv6PrefixLen") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "IPv6PrefixLen"));
     }
     else
     {
         this.M_prefixLen  = null;
         this.IsIncomplete = true;
     }
     this.N_prefixLen = false;
     if (Util.ExistsPath(r, "IPv6PrefixTail"))
     {
         this.M_prefixTail = Util.GetByPath(r, "IPv6PrefixTail") == null ? ((string)(null)) : "" + Util.GetByPath(r, "IPv6PrefixTail");
     }
     else
     {
         this.M_prefixTail = null;
         this.IsIncomplete = true;
     }
     this.N_prefixTail = false;
 }
Exemplo n.º 15
0
        internal override void _OnAfterApiDeserialize(object r, object root)
        {
            this._Normalize();
            this._Servers = new System.Collections.Generic.List <GslbServer> {
            };
            object settings = this.RawSettings;

            if (settings != null)
            {
                object raw = Util.GetByPath(settings, "GSLB.Servers");
                if (raw != null)
                {
                    System.Collections.Generic.List <object> servers = ((System.Collections.Generic.List <object>)(raw));
                    for (int __it1 = 0; __it1 < (servers as System.Collections.IList).Count; __it1++)
                    {
                        var server = servers[__it1];
                        (this._Servers as System.Collections.IList).Add(new GslbServer(server));
                    }
                }
            }
        }
Exemplo n.º 16
0
 public string Get_defaultRoute()
 {
     return((string)(Util.GetByPath(this.RawAnnotation, "Network.DefaultRoute")));
 }
Exemplo n.º 17
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "MACAddress"))
     {
         this.M_macAddress = Util.GetByPath(r, "MACAddress") == null ? ((string)(null)) : "" + Util.GetByPath(r, "MACAddress");
     }
     else
     {
         this.M_macAddress = null;
         this.IsIncomplete = true;
     }
     this.N_macAddress = false;
     if (Util.ExistsPath(r, "IPAddress"))
     {
         this.M_ipAddress = Util.GetByPath(r, "IPAddress") == null ? ((string)(null)) : "" + Util.GetByPath(r, "IPAddress");
     }
     else
     {
         this.M_ipAddress  = null;
         this.IsIncomplete = true;
     }
     this.N_ipAddress = false;
     if (Util.ExistsPath(r, "UserIPAddress"))
     {
         this.M_userIpAddress = Util.GetByPath(r, "UserIPAddress") == null ? ((string)(null)) : "" + Util.GetByPath(r, "UserIPAddress");
     }
     else
     {
         this.M_userIpAddress = null;
         this.IsIncomplete    = true;
     }
     this.N_userIpAddress = false;
     if (Util.ExistsPath(r, "Server.ID"))
     {
         this.M_serverId = Util.GetByPath(r, "Server.ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Server.ID");
     }
     else
     {
         this.M_serverId   = null;
         this.IsIncomplete = true;
     }
     this.N_serverId = false;
     if (Util.ExistsPath(r, "Switch.ID"))
     {
         this.M_swytchId = Util.GetByPath(r, "Switch.ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Switch.ID");
     }
     else
     {
         this.M_swytchId   = null;
         this.IsIncomplete = true;
     }
     this.N_swytchId = false;
 }
Exemplo n.º 18
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "Tags"))
     {
         if (Util.GetByPath(r, "Tags") == null)
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
         }
         else
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
             for (int __it1 = 0; __it1 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags"))) as System.Collections.IList).Count; __it1++)
             {
                 var    t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags")))[__it1];
                 string v1 = null;
                 v1 = t == null ? ((string)(null)) : "" + t;
                 (this.M_tags as System.Collections.IList).Add(v1);
             }
         }
     }
     else
     {
         this.M_tags       = null;
         this.IsIncomplete = true;
     }
     this.N_tags = false;
     if (Util.ExistsPath(r, "Icon"))
     {
         this.M_icon = Util.GetByPath(r, "Icon") == null ? null : new Icon(this._Client, Util.GetByPath(r, "Icon"));
     }
     else
     {
         this.M_icon       = null;
         this.IsIncomplete = true;
     }
     this.N_icon = false;
     if (Util.ExistsPath(r, "ServerPlan"))
     {
         this.M_plan = Util.GetByPath(r, "ServerPlan") == null ? null : new ServerPlan(this._Client, Util.GetByPath(r, "ServerPlan"));
     }
     else
     {
         this.M_plan       = null;
         this.IsIncomplete = true;
     }
     this.N_plan = false;
     if (Util.ExistsPath(r, "Interfaces"))
     {
         if (Util.GetByPath(r, "Interfaces") == null)
         {
             this.M_ifaces = new System.Collections.Generic.List <Iface> {
             };
         }
         else
         {
             this.M_ifaces = new System.Collections.Generic.List <Iface> {
             };
             for (int __it2 = 0; __it2 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Interfaces"))) as System.Collections.IList).Count; __it2++)
             {
                 var   t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Interfaces")))[__it2];
                 Iface v2 = null;
                 v2 = t == null ? null : new Iface(this._Client, t);
                 (this.M_ifaces as System.Collections.IList).Add(v2);
             }
         }
     }
     else
     {
         this.M_ifaces     = null;
         this.IsIncomplete = true;
     }
     this.N_ifaces = false;
     if (Util.ExistsPath(r, "Instance"))
     {
         this.M_instance = Util.GetByPath(r, "Instance") == null ? null : new ServerInstance(this._Client, Util.GetByPath(r, "Instance"));
     }
     else
     {
         this.M_instance   = null;
         this.IsIncomplete = true;
     }
     this.N_instance = false;
     if (Util.ExistsPath(r, "Availability"))
     {
         this.M_availability = Util.GetByPath(r, "Availability") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Availability");
     }
     else
     {
         this.M_availability = null;
         this.IsIncomplete   = true;
     }
     this.N_availability = false;
 }
Exemplo n.º 19
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Class"))
     {
         this.M_clazz = Util.GetByPath(r, "Class") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Class");
     }
     else
     {
         this.M_clazz      = null;
         this.IsIncomplete = true;
     }
     this.N_clazz = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "Tags"))
     {
         if (Util.GetByPath(r, "Tags") == null)
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
         }
         else
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
             for (int __it1 = 0; __it1 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags"))) as System.Collections.IList).Count; __it1++)
             {
                 var    t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags")))[__it1];
                 string v1 = null;
                 v1 = t == null ? ((string)(null)) : "" + t;
                 (this.M_tags as System.Collections.IList).Add(v1);
             }
         }
     }
     else
     {
         this.M_tags       = null;
         this.IsIncomplete = true;
     }
     this.N_tags = false;
     if (Util.ExistsPath(r, "Icon"))
     {
         this.M_icon = Util.GetByPath(r, "Icon") == null ? null : new Icon(this._Client, Util.GetByPath(r, "Icon"));
     }
     else
     {
         this.M_icon       = null;
         this.IsIncomplete = true;
     }
     this.N_icon = false;
     if (Util.ExistsPath(r, "Plan.ID"))
     {
         this.M_planId = Util.GetByPath(r, "Plan.ID") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "Plan.ID"));
     }
     else
     {
         this.M_planId     = null;
         this.IsIncomplete = true;
     }
     this.N_planId = false;
     if (Util.ExistsPath(r, "Interfaces"))
     {
         if (Util.GetByPath(r, "Interfaces") == null)
         {
             this.M_ifaces = new System.Collections.Generic.List <Iface> {
             };
         }
         else
         {
             this.M_ifaces = new System.Collections.Generic.List <Iface> {
             };
             for (int __it2 = 0; __it2 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Interfaces"))) as System.Collections.IList).Count; __it2++)
             {
                 var   t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Interfaces")))[__it2];
                 Iface v2 = null;
                 v2 = t == null ? null : new Iface(this._Client, t);
                 (this.M_ifaces as System.Collections.IList).Add(v2);
             }
         }
     }
     else
     {
         this.M_ifaces     = null;
         this.IsIncomplete = true;
     }
     this.N_ifaces = false;
     if (Util.ExistsPath(r, "Remark"))
     {
         this.M_rawAnnotation = Util.GetByPath(r, "Remark");
     }
     else
     {
         this.M_rawAnnotation = null;
         this.IsIncomplete    = true;
     }
     this.N_rawAnnotation = false;
     if (Util.ExistsPath(r, "Settings"))
     {
         this.M_rawSettings = Util.GetByPath(r, "Settings");
     }
     else
     {
         this.M_rawSettings = null;
         this.IsIncomplete  = true;
     }
     this.N_rawSettings = false;
     if (Util.ExistsPath(r, "SettingsHash"))
     {
         this.M_rawSettingsHash = Util.GetByPath(r, "SettingsHash") == null ? ((string)(null)) : "" + Util.GetByPath(r, "SettingsHash");
     }
     else
     {
         this.M_rawSettingsHash = null;
         this.IsIncomplete      = true;
     }
     this.N_rawSettingsHash = false;
     if (Util.ExistsPath(r, "Instance.Status"))
     {
         this.M_status = Util.GetByPath(r, "Instance.Status") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Instance.Status");
     }
     else
     {
         this.M_status     = null;
         this.IsIncomplete = true;
     }
     this.N_status = false;
     if (Util.ExistsPath(r, "ServiceClass"))
     {
         this.M_serviceClass = Util.GetByPath(r, "ServiceClass") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ServiceClass");
     }
     else
     {
         this.M_serviceClass = null;
         this.IsIncomplete   = true;
     }
     this.N_serviceClass = false;
     if (Util.ExistsPath(r, "Availability"))
     {
         this.M_availability = Util.GetByPath(r, "Availability") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Availability");
     }
     else
     {
         this.M_availability = null;
         this.IsIncomplete   = true;
     }
     this.N_availability = false;
     if (Util.ExistsPath(r, "Switch.ID"))
     {
         this.M_swytchId = Util.GetByPath(r, "Switch.ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Switch.ID");
     }
     else
     {
         this.M_swytchId   = null;
         this.IsIncomplete = true;
     }
     this.N_swytchId = false;
 }
Exemplo n.º 20
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "NetworkMaskLen"))
     {
         this.M_networkMaskLen = Util.GetByPath(r, "NetworkMaskLen") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "NetworkMaskLen"));
     }
     else
     {
         this.M_networkMaskLen = null;
         this.IsIncomplete     = true;
     }
     this.N_networkMaskLen = false;
     if (Util.ExistsPath(r, "BandWidthMbps"))
     {
         this.M_bandWidthMbps = Util.GetByPath(r, "BandWidthMbps") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "BandWidthMbps"));
     }
     else
     {
         this.M_bandWidthMbps = null;
         this.IsIncomplete    = true;
     }
     this.N_bandWidthMbps = false;
     if (Util.ExistsPath(r, "Switch.ID"))
     {
         this.M_swytchId = Util.GetByPath(r, "Switch.ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Switch.ID");
     }
     else
     {
         this.M_swytchId   = null;
         this.IsIncomplete = true;
     }
     this.N_swytchId = false;
 }
Exemplo n.º 21
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "Tags"))
     {
         if (Util.GetByPath(r, "Tags") == null)
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
         }
         else
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
             for (int __it1 = 0; __it1 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags"))) as System.Collections.IList).Count; __it1++)
             {
                 var    t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags")))[__it1];
                 string v1 = null;
                 v1 = t == null ? ((string)(null)) : "" + t;
                 (this.M_tags as System.Collections.IList).Add(v1);
             }
         }
     }
     else
     {
         this.M_tags       = null;
         this.IsIncomplete = true;
     }
     this.N_tags = false;
     if (Util.ExistsPath(r, "Icon"))
     {
         this.M_icon = Util.GetByPath(r, "Icon") == null ? null : new Icon(this._Client, Util.GetByPath(r, "Icon"));
     }
     else
     {
         this.M_icon       = null;
         this.IsIncomplete = true;
     }
     this.N_icon = false;
     if (Util.ExistsPath(r, "UserSubnet.DefaultRoute"))
     {
         this.M_userDefaultRoute = Util.GetByPath(r, "UserSubnet.DefaultRoute") == null ? ((string)(null)) : "" + Util.GetByPath(r, "UserSubnet.DefaultRoute");
     }
     else
     {
         this.M_userDefaultRoute = null;
         this.IsIncomplete       = true;
     }
     this.N_userDefaultRoute = false;
     if (Util.ExistsPath(r, "UserSubnet.NetworkMaskLen"))
     {
         this.M_userMaskLen = Util.GetByPath(r, "UserSubnet.NetworkMaskLen") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "UserSubnet.NetworkMaskLen"));
     }
     else
     {
         this.M_userMaskLen = null;
         this.IsIncomplete  = true;
     }
     this.N_userMaskLen = false;
     if (Util.ExistsPath(r, "Internet"))
     {
         this.M_router = Util.GetByPath(r, "Internet") == null ? null : new Router(this._Client, Util.GetByPath(r, "Internet"));
     }
     else
     {
         this.M_router     = null;
         this.IsIncomplete = true;
     }
     this.N_router = false;
     if (Util.ExistsPath(r, "Bridge"))
     {
         this.M_bridge = Util.GetByPath(r, "Bridge") == null ? null : new Bridge(this._Client, Util.GetByPath(r, "Bridge"));
     }
     else
     {
         this.M_bridge     = null;
         this.IsIncomplete = true;
     }
     this.N_bridge = false;
     if (Util.ExistsPath(r, "Subnets"))
     {
         if (Util.GetByPath(r, "Subnets") == null)
         {
             this.M_ipv4Nets = new System.Collections.Generic.List <Ipv4Net> {
             };
         }
         else
         {
             this.M_ipv4Nets = new System.Collections.Generic.List <Ipv4Net> {
             };
             for (int __it2 = 0; __it2 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Subnets"))) as System.Collections.IList).Count; __it2++)
             {
                 var     t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Subnets")))[__it2];
                 Ipv4Net v2 = null;
                 v2 = t == null ? null : new Ipv4Net(this._Client, t);
                 (this.M_ipv4Nets as System.Collections.IList).Add(v2);
             }
         }
     }
     else
     {
         this.M_ipv4Nets   = null;
         this.IsIncomplete = true;
     }
     this.N_ipv4Nets = false;
     if (Util.ExistsPath(r, "IPv6Nets"))
     {
         if (Util.GetByPath(r, "IPv6Nets") == null)
         {
             this.M_ipv6Nets = new System.Collections.Generic.List <Ipv6Net> {
             };
         }
         else
         {
             this.M_ipv6Nets = new System.Collections.Generic.List <Ipv6Net> {
             };
             for (int __it3 = 0; __it3 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "IPv6Nets"))) as System.Collections.IList).Count; __it3++)
             {
                 var     t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "IPv6Nets")))[__it3];
                 Ipv6Net v3 = null;
                 v3 = t == null ? null : new Ipv6Net(this._Client, t);
                 (this.M_ipv6Nets as System.Collections.IList).Add(v3);
             }
         }
     }
     else
     {
         this.M_ipv6Nets   = null;
         this.IsIncomplete = true;
     }
     this.N_ipv6Nets = false;
 }
Exemplo n.º 22
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Scope"))
     {
         this.M_scope = Util.GetByPath(r, "Scope") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Scope");
     }
     else
     {
         this.M_scope      = null;
         this.IsIncomplete = true;
     }
     this.N_scope = false;
     if (Util.ExistsPath(r, "Class"))
     {
         this.M_clazz = Util.GetByPath(r, "Class") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Class");
     }
     else
     {
         this.M_clazz      = null;
         this.IsIncomplete = true;
     }
     this.N_clazz = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "Tags"))
     {
         if (Util.GetByPath(r, "Tags") == null)
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
         }
         else
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
             for (int __it1 = 0; __it1 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags"))) as System.Collections.IList).Count; __it1++)
             {
                 var    t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags")))[__it1];
                 string v1 = null;
                 v1 = t == null ? ((string)(null)) : "" + t;
                 (this.M_tags as System.Collections.IList).Add(v1);
             }
         }
     }
     else
     {
         this.M_tags       = null;
         this.IsIncomplete = true;
     }
     this.N_tags = false;
     if (Util.ExistsPath(r, "Icon"))
     {
         this.M_icon = Util.GetByPath(r, "Icon") == null ? null : new Icon(this._Client, Util.GetByPath(r, "Icon"));
     }
     else
     {
         this.M_icon       = null;
         this.IsIncomplete = true;
     }
     this.N_icon = false;
     if (Util.ExistsPath(r, "Content"))
     {
         this.M_content = Util.GetByPath(r, "Content") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Content");
     }
     else
     {
         this.M_content    = null;
         this.IsIncomplete = true;
     }
     this.N_content = false;
     if (Util.ExistsPath(r, "Remark"))
     {
         this.M_annotation = Util.GetByPath(r, "Remark");
     }
     else
     {
         this.M_annotation = null;
         this.IsIncomplete = true;
     }
     this.N_annotation = false;
 }
Exemplo n.º 23
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Scope"))
     {
         this.M_scope = Util.GetByPath(r, "Scope") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Scope");
     }
     else
     {
         this.M_scope      = null;
         this.IsIncomplete = true;
     }
     this.N_scope = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "Tags"))
     {
         if (Util.GetByPath(r, "Tags") == null)
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
         }
         else
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
             for (int __it1 = 0; __it1 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags"))) as System.Collections.IList).Count; __it1++)
             {
                 var    t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags")))[__it1];
                 string v1 = null;
                 v1 = t == null ? ((string)(null)) : "" + t;
                 (this.M_tags as System.Collections.IList).Add(v1);
             }
         }
     }
     else
     {
         this.M_tags       = null;
         this.IsIncomplete = true;
     }
     this.N_tags = false;
     if (Util.ExistsPath(r, "Icon"))
     {
         this.M_icon = Util.GetByPath(r, "Icon") == null ? null : new Icon(this._Client, Util.GetByPath(r, "Icon"));
     }
     else
     {
         this.M_icon       = null;
         this.IsIncomplete = true;
     }
     this.N_icon = false;
     if (Util.ExistsPath(r, "DisplayOrder"))
     {
         this.M_displayOrder = Util.GetByPath(r, "DisplayOrder") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "DisplayOrder"));
     }
     else
     {
         this.M_displayOrder = null;
         this.IsIncomplete   = true;
     }
     this.N_displayOrder = false;
     if (Util.ExistsPath(r, "SizeMB"))
     {
         this.M_sizeMib = Util.GetByPath(r, "SizeMB") == null?System.Convert.ToInt64(null) : (long)System.Convert.ToInt64("" + "" + Util.GetByPath(r, "SizeMB"));
     }
     else
     {
         this.M_sizeMib    = null;
         this.IsIncomplete = true;
     }
     this.N_sizeMib = false;
     if (Util.ExistsPath(r, "ServiceClass"))
     {
         this.M_serviceClass = Util.GetByPath(r, "ServiceClass") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ServiceClass");
     }
     else
     {
         this.M_serviceClass = null;
         this.IsIncomplete   = true;
     }
     this.N_serviceClass = false;
     if (Util.ExistsPath(r, "Plan"))
     {
         this.M_plan = Util.GetByPath(r, "Plan") == null ? null : new DiskPlan(this._Client, Util.GetByPath(r, "Plan"));
     }
     else
     {
         this.M_plan       = null;
         this.IsIncomplete = true;
     }
     this.N_plan = false;
     if (Util.ExistsPath(r, "Availability"))
     {
         this.M_availability = Util.GetByPath(r, "Availability") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Availability");
     }
     else
     {
         this.M_availability = null;
         this.IsIncomplete   = true;
     }
     this.N_availability = false;
 }
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "ID"))
     {
         this.M_id = Util.GetByPath(r, "ID") == null ? ((string)(null)) : "" + Util.GetByPath(r, "ID");
     }
     else
     {
         this.M_id         = null;
         this.IsIncomplete = true;
     }
     this.N_id = false;
     if (Util.ExistsPath(r, "Name"))
     {
         this.M_name = Util.GetByPath(r, "Name") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Name");
     }
     else
     {
         this.M_name       = null;
         this.IsIncomplete = true;
     }
     this.N_name = false;
     if (Util.ExistsPath(r, "Description"))
     {
         this.M_description = Util.GetByPath(r, "Description") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Description");
     }
     else
     {
         this.M_description = null;
         this.IsIncomplete  = true;
     }
     this.N_description = false;
     if (Util.ExistsPath(r, "Tags"))
     {
         if (Util.GetByPath(r, "Tags") == null)
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
         }
         else
         {
             this.M_tags = new System.Collections.Generic.List <string> {
             };
             for (int __it1 = 0; __it1 < (((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags"))) as System.Collections.IList).Count; __it1++)
             {
                 var    t  = ((System.Collections.Generic.List <object>)(Util.GetByPath(r, "Tags")))[__it1];
                 string v1 = null;
                 v1 = t == null ? ((string)(null)) : "" + t;
                 (this.M_tags as System.Collections.IList).Add(v1);
             }
         }
     }
     else
     {
         this.M_tags       = null;
         this.IsIncomplete = true;
     }
     this.N_tags = false;
     if (Util.ExistsPath(r, "Icon"))
     {
         this.M_icon = Util.GetByPath(r, "Icon") == null ? null : new Icon(this._Client, Util.GetByPath(r, "Icon"));
     }
     else
     {
         this.M_icon       = null;
         this.IsIncomplete = true;
     }
     this.N_icon = false;
     if (Util.ExistsPath(r, "CommonServiceProvider"))
     {
         this.M_provider = Util.GetByPath(r, "CommonServiceProvider") == null ? null : new CommonServiceProvider(this._Client, Util.GetByPath(r, "CommonServiceProvider"));
     }
     else
     {
         this.M_provider   = null;
         this.IsIncomplete = true;
     }
     this.N_provider = false;
     if (Util.ExistsPath(r, "Settings"))
     {
         this.M_rawSettings = Util.GetByPath(r, "Settings");
     }
     else
     {
         this.M_rawSettings = null;
         this.IsIncomplete  = true;
     }
     this.N_rawSettings = false;
     if (Util.ExistsPath(r, "Status"))
     {
         this.M_rawStatus = Util.GetByPath(r, "Status");
     }
     else
     {
         this.M_rawStatus  = null;
         this.IsIncomplete = true;
     }
     this.N_rawStatus = false;
 }