Ejemplo n.º 1
0
 internal DiskPlan Get_hdd()
 {
     if (this._Hdd == null)
     {
         this._Hdd = this.GetById("2");
     }
     return(this._Hdd);
 }
Ejemplo n.º 2
0
 internal DiskPlan Get_ssd()
 {
     if (this._Ssd == null)
     {
         this._Ssd = this.GetById("4");
     }
     return(this._Ssd);
 }
Ejemplo n.º 3
0
 private DiskPlan Set_plan(DiskPlan v)
 {
     if (!this.IsNew)
     {
         throw new SaklientException("immutable_field", "Immutable fields cannot be modified after the resource creation: " + "saklient.cloud.resources.Disk#Set_plan");
     }
     this.M_plan = v;
     this.N_plan = true;
     return(this.M_plan);
 }
Ejemplo 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, "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;
 }