/// <summary>
 /// Initializes a new instance of the ContainerGroup class.
 /// </summary>
 /// <param name="containers">The containers within the container
 /// group.</param>
 /// <param name="osType">The operating system type required by the
 /// containers in the container group. Possible values include:
 /// 'Windows', 'Linux'</param>
 /// <param name="id">The resource id.</param>
 /// <param name="name">The resource name.</param>
 /// <param name="type">The resource type.</param>
 /// <param name="location">The resource location.</param>
 /// <param name="tags">The resource tags.</param>
 /// <param name="identity">The identity of the container group, if
 /// configured.</param>
 /// <param name="provisioningState">The provisioning state of the
 /// container group. This only appears in the response.</param>
 /// <param name="imageRegistryCredentials">The image registry
 /// credentials by which the container group is created from.</param>
 /// <param name="restartPolicy">Restart policy for all containers
 /// within the container group.
 /// - `Always` Always restart
 /// - `OnFailure` Restart on failure
 /// - `Never` Never restart
 /// . Possible values include: 'Always', 'OnFailure', 'Never'</param>
 /// <param name="ipAddress">The IP address type of the container
 /// group.</param>
 /// <param name="volumes">The list of volumes that can be mounted by
 /// containers in this container group.</param>
 /// <param name="instanceView">The instance view of the container
 /// group. Only valid in response.</param>
 /// <param name="diagnostics">The diagnostic information for a
 /// container group.</param>
 /// <param name="subnetIds">The subnet resource IDs for a container
 /// group.</param>
 /// <param name="dnsConfig">The DNS config information for a container
 /// group.</param>
 /// <param name="sku">The SKU for a container group. Possible values
 /// include: 'Standard', 'Dedicated'</param>
 /// <param name="encryptionProperties">The encryption properties for a
 /// container group.</param>
 /// <param name="initContainers">The init containers for a container
 /// group.</param>
 public ContainerGroup(IList <Container> containers, string osType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), ContainerGroupIdentity identity = default(ContainerGroupIdentity), string provisioningState = default(string), IList <ImageRegistryCredential> imageRegistryCredentials = default(IList <ImageRegistryCredential>), string restartPolicy = default(string), IpAddress ipAddress = default(IpAddress), IList <Volume> volumes = default(IList <Volume>), ContainerGroupPropertiesInstanceView instanceView = default(ContainerGroupPropertiesInstanceView), ContainerGroupDiagnostics diagnostics = default(ContainerGroupDiagnostics), IList <ContainerGroupSubnetId> subnetIds = default(IList <ContainerGroupSubnetId>), DnsConfiguration dnsConfig = default(DnsConfiguration), string sku = default(string), EncryptionProperties encryptionProperties = default(EncryptionProperties), IList <InitContainerDefinition> initContainers = default(IList <InitContainerDefinition>))
     : base(id, name, type, location, tags)
 {
     Identity                 = identity;
     ProvisioningState        = provisioningState;
     Containers               = containers;
     ImageRegistryCredentials = imageRegistryCredentials;
     RestartPolicy            = restartPolicy;
     IpAddress                = ipAddress;
     OsType               = osType;
     Volumes              = volumes;
     InstanceView         = instanceView;
     Diagnostics          = diagnostics;
     SubnetIds            = subnetIds;
     DnsConfig            = dnsConfig;
     Sku                  = sku;
     EncryptionProperties = encryptionProperties;
     InitContainers       = initContainers;
     CustomInit();
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Containers == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Containers");
     }
     if (OsType == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "OsType");
     }
     if (Containers != null)
     {
         foreach (var element in Containers)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ImageRegistryCredentials != null)
     {
         foreach (var element1 in ImageRegistryCredentials)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (IpAddress != null)
     {
         IpAddress.Validate();
     }
     if (Volumes != null)
     {
         foreach (var element2 in Volumes)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
     if (Diagnostics != null)
     {
         Diagnostics.Validate();
     }
     if (SubnetIds != null)
     {
         foreach (var element3 in SubnetIds)
         {
             if (element3 != null)
             {
                 element3.Validate();
             }
         }
     }
     if (DnsConfig != null)
     {
         DnsConfig.Validate();
     }
     if (EncryptionProperties != null)
     {
         EncryptionProperties.Validate();
     }
     if (InitContainers != null)
     {
         foreach (var element4 in InitContainers)
         {
             if (element4 != null)
             {
                 element4.Validate();
             }
         }
     }
 }