public AppServiceEnvironmentAutoGenerated(VirtualNetworkProfile virtualNetwork)
        {
            if (virtualNetwork == null)
            {
                throw new ArgumentNullException(nameof(virtualNetwork));
            }

            VirtualNetwork          = virtualNetwork;
            ClusterSettings         = new ChangeTrackingList <NameValuePair>();
            UserWhitelistedIPRanges = new ChangeTrackingList <string>();
        }
 internal AppServiceEnvironmentUpdateOptions(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, string kind, ProvisioningState?provisioningState, HostingEnvironmentStatus?status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode?internalLoadBalancingMode, string multiSize, int?multiRoleCount, int?ipsslAddressCount, string dnsSuffix, int?maximumNumberOfMachines, int?frontEndScaleFactor, bool?suspended, IList <NameValuePair> clusterSettings, IList <string> userWhitelistedIpRanges, bool?hasLinuxWorkers, int?dedicatedHostCount, bool?zoneRedundant) : base(id, name, type, systemData, kind)
 {
     ProvisioningState         = provisioningState;
     Status                    = status;
     VirtualNetwork            = virtualNetwork;
     InternalLoadBalancingMode = internalLoadBalancingMode;
     MultiSize                 = multiSize;
     MultiRoleCount            = multiRoleCount;
     IpsslAddressCount         = ipsslAddressCount;
     DnsSuffix                 = dnsSuffix;
     MaximumNumberOfMachines   = maximumNumberOfMachines;
     FrontEndScaleFactor       = frontEndScaleFactor;
     Suspended                 = suspended;
     ClusterSettings           = clusterSettings;
     UserWhitelistedIpRanges   = userWhitelistedIpRanges;
     HasLinuxWorkers           = hasLinuxWorkers;
     DedicatedHostCount        = dedicatedHostCount;
     ZoneRedundant             = zoneRedundant;
 }
 internal AppServiceEnvironmentAutoGenerated(ProvisioningState?provisioningState, HostingEnvironmentStatus?status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode?internalLoadBalancingMode, string multiSize, int?multiRoleCount, int?ipsslAddressCount, string dnsSuffix, int?maximumNumberOfMachines, int?frontEndScaleFactor, bool?suspended, IList <NameValuePair> clusterSettings, IList <string> userWhitelistedIPRanges, bool?hasLinuxWorkers, int?dedicatedHostCount, bool?zoneRedundant)
 {
     ProvisioningState         = provisioningState;
     Status                    = status;
     VirtualNetwork            = virtualNetwork;
     InternalLoadBalancingMode = internalLoadBalancingMode;
     MultiSize                 = multiSize;
     MultiRoleCount            = multiRoleCount;
     IpsslAddressCount         = ipsslAddressCount;
     DnsSuffix                 = dnsSuffix;
     MaximumNumberOfMachines   = maximumNumberOfMachines;
     FrontEndScaleFactor       = frontEndScaleFactor;
     Suspended                 = suspended;
     ClusterSettings           = clusterSettings;
     UserWhitelistedIPRanges   = userWhitelistedIPRanges;
     HasLinuxWorkers           = hasLinuxWorkers;
     DedicatedHostCount        = dedicatedHostCount;
     ZoneRedundant             = zoneRedundant;
 }
Пример #4
0
        internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch(JsonElement element)
        {
            Optional <string>                   kind                      = default;
            ResourceIdentifier                  id                        = default;
            string                              name                      = default;
            ResourceType                        type                      = default;
            SystemData                          systemData                = default;
            Optional <ProvisioningState>        provisioningState         = default;
            Optional <HostingEnvironmentStatus> status                    = default;
            Optional <VirtualNetworkProfile>    virtualNetwork            = default;
            Optional <LoadBalancingMode>        internalLoadBalancingMode = default;
            Optional <string>                   multiSize                 = default;
            Optional <int>                      multiRoleCount            = default;
            Optional <int>                      ipsslAddressCount         = default;
            Optional <string>                   dnsSuffix                 = default;
            Optional <int>                      maximumNumberOfMachines   = default;
            Optional <int>                      frontEndScaleFactor       = default;
            Optional <bool>                     suspended                 = default;
            Optional <IList <NameValuePair> >   clusterSettings           = default;
            Optional <IList <string> >          userWhitelistedIpRanges   = default;
            Optional <bool>                     hasLinuxWorkers           = default;
            Optional <int>                      dedicatedHostCount        = default;
            Optional <bool>                     zoneRedundant             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = property0.Value.GetString().ToProvisioningState();
                            continue;
                        }
                        if (property0.NameEquals("status"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            status = property0.Value.GetString().ToHostingEnvironmentStatus();
                            continue;
                        }
                        if (property0.NameEquals("virtualNetwork"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("internalLoadBalancingMode"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            internalLoadBalancingMode = new LoadBalancingMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("multiSize"))
                        {
                            multiSize = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("multiRoleCount"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            multiRoleCount = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("ipsslAddressCount"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            ipsslAddressCount = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("dnsSuffix"))
                        {
                            dnsSuffix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("maximumNumberOfMachines"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            maximumNumberOfMachines = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("frontEndScaleFactor"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            frontEndScaleFactor = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("suspended"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            suspended = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("clusterSettings"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <NameValuePair> array = new List <NameValuePair>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(NameValuePair.DeserializeNameValuePair(item));
                            }
                            clusterSettings = array;
                            continue;
                        }
                        if (property0.NameEquals("userWhitelistedIpRanges"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(item.GetString());
                            }
                            userWhitelistedIpRanges = array;
                            continue;
                        }
                        if (property0.NameEquals("hasLinuxWorkers"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hasLinuxWorkers = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("dedicatedHostCount"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            dedicatedHostCount = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("zoneRedundant"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            zoneRedundant = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new AppServiceEnvironmentPatch(id, name, type, systemData, kind.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant)));
        }