/// <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();
     }
 }