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;
     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, "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, "Server"))
     {
         this.M_server = Util.GetByPath(r, "Server") == null ? null : new Server(this._Client, Util.GetByPath(r, "Server"));
     }
     else
     {
         this.M_server     = null;
         this.IsIncomplete = true;
     }
     this.N_server = 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.º 2
0
 /// <summary>ディスクをサーバに取り付けます。
 ///
 /// <param name="server" />
 /// <returns>this</returns>
 /// </summary>
 public Disk ConnectTo(Server server)
 {
     this._Client.Request("PUT", "/disk/" + this._Id() + "/to/server/" + server._Id());
     return(this);
 }