/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public override void Validate()
 {
     base.Validate();
     if (MasterProfile == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "MasterProfile");
     }
     if (AgentPoolProfiles == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "AgentPoolProfiles");
     }
     if (LinuxProfile == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "LinuxProfile");
     }
     if (OrchestratorProfile != null)
     {
         OrchestratorProfile.Validate();
     }
     if (CustomProfile != null)
     {
         CustomProfile.Validate();
     }
     if (ServicePrincipalProfile != null)
     {
         ServicePrincipalProfile.Validate();
     }
     if (MasterProfile != null)
     {
         MasterProfile.Validate();
     }
     if (AgentPoolProfiles != null)
     {
         foreach (var element in AgentPoolProfiles)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (WindowsProfile != null)
     {
         WindowsProfile.Validate();
     }
     if (LinuxProfile != null)
     {
         LinuxProfile.Validate();
     }
     if (DiagnosticsProfile != null)
     {
         DiagnosticsProfile.Validate();
     }
 }
Example #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public override void Validate()
 {
     base.Validate();
     if (AgentPoolProfiles != null)
     {
         foreach (var element in AgentPoolProfiles)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (LinuxProfile != null)
     {
         LinuxProfile.Validate();
     }
     if (WindowsProfile != null)
     {
         WindowsProfile.Validate();
     }
     if (ServicePrincipalProfile != null)
     {
         ServicePrincipalProfile.Validate();
     }
     if (AddonProfiles != null)
     {
         foreach (var valueElement in AddonProfiles.Values)
         {
             if (valueElement != null)
             {
                 valueElement.Validate();
             }
         }
     }
     if (NetworkProfile != null)
     {
         NetworkProfile.Validate();
     }
     if (AadProfile != null)
     {
         AadProfile.Validate();
     }
 }