Exemple #1
0
 internal ContainerServiceAgentPoolProfile(string name, int count, ContainerServiceVMSizeTypes vmSize, string dnsPrefix, string fqdn)
 {
     Name      = name;
     Count     = count;
     VmSize    = vmSize;
     DnsPrefix = dnsPrefix;
     Fqdn      = fqdn;
 }
Exemple #2
0
        public ContainerServiceAgentPoolProfile(string name, int count, ContainerServiceVMSizeTypes vmSize, string dnsPrefix)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (dnsPrefix == null)
            {
                throw new ArgumentNullException(nameof(dnsPrefix));
            }

            Name      = name;
            Count     = count;
            VmSize    = vmSize;
            DnsPrefix = dnsPrefix;
        }
        internal static ContainerServiceAgentPoolProfile DeserializeContainerServiceAgentPoolProfile(JsonElement element)
        {
            string name  = default;
            int    count = default;
            ContainerServiceVMSizeTypes vmSize = default;
            string dnsPrefix = default;
            string fqdn      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("count"))
                {
                    count = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("vmSize"))
                {
                    vmSize = new ContainerServiceVMSizeTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("dnsPrefix"))
                {
                    dnsPrefix = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("fqdn"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    fqdn = property.Value.GetString();
                    continue;
                }
            }
            return(new ContainerServiceAgentPoolProfile(name, count, vmSize, dnsPrefix, fqdn));
        }