Exemple #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (VmInstanceCount > 2147483647)
     {
         throw new ValidationException(ValidationRules.InclusiveMaximum, "VmInstanceCount", 2147483647);
     }
     if (VmInstanceCount < 1)
     {
         throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 1);
     }
     if (ApplicationPorts != null)
     {
         ApplicationPorts.Validate();
     }
     if (EphemeralPorts != null)
     {
         EphemeralPorts.Validate();
     }
     if (VmSecrets != null)
     {
         foreach (var element in VmSecrets)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (VmExtensions != null)
     {
         foreach (var element1 in VmExtensions)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (ApplicationPorts != null)
     {
         ApplicationPorts.Validate();
     }
     if (EphemeralPorts != null)
     {
         EphemeralPorts.Validate();
     }
     if (VmInstanceCount > 2147483647)
     {
         throw new ValidationException(ValidationRules.InclusiveMaximum, "VmInstanceCount", 2147483647);
     }
     if (VmInstanceCount < 1)
     {
         throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 1);
     }
 }