internal static NetworkVirtualAppliance DeserializeNetworkVirtualAppliance(JsonElement element)
        {
            ManagedServiceIdentity        identity = default;
            VirtualApplianceSkuProperties sku      = default;
            string etag     = default;
            string id       = default;
            string name     = default;
            string type     = default;
            string location = default;
            IDictionary <string, string> tags         = default;
            IList <string> bootStrapConfigurationBlob = default;
            SubResource    virtualHub = default;
            IList <string> cloudInitConfigurationBlob = default;
            long?          virtualApplianceAsn        = default;
            IList <VirtualApplianceNicProperties> virtualApplianceNics = default;
            ProvisioningState?provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    sku = VirtualApplianceSkuProperties.DeserializeVirtualApplianceSkuProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("bootStrapConfigurationBlob"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(item.GetString());
                                }
                            }
                            bootStrapConfigurationBlob = array;
                            continue;
                        }
                        if (property0.NameEquals("virtualHub"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            virtualHub = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("cloudInitConfigurationBlob"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(item.GetString());
                                }
                            }
                            cloudInitConfigurationBlob = array;
                            continue;
                        }
                        if (property0.NameEquals("virtualApplianceAsn"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            virtualApplianceAsn = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("virtualApplianceNics"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <VirtualApplianceNicProperties> array = new List <VirtualApplianceNicProperties>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(VirtualApplianceNicProperties.DeserializeVirtualApplianceNicProperties(item));
                                }
                            }
                            virtualApplianceNics = array;
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new NetworkVirtualAppliance(id, name, type, location, tags, identity, sku, etag, bootStrapConfigurationBlob, virtualHub, cloudInitConfigurationBlob, virtualApplianceAsn, virtualApplianceNics, provisioningState));
        }
        internal static ApplicationGateway DeserializeApplicationGateway(JsonElement element)
        {
            Optional <string>                                                etag                                = default;
            Optional <IList <string> >                                       zones                               = default;
            Optional <ManagedServiceIdentity>                                identity                            = default;
            Optional <string>                                                id                                  = default;
            Optional <string>                                                name                                = default;
            Optional <string>                                                type                                = default;
            Optional <string>                                                location                            = default;
            Optional <IDictionary <string, string> >                         tags                                = default;
            Optional <ApplicationGatewaySku>                                 sku                                 = default;
            Optional <ApplicationGatewaySslPolicy>                           sslPolicy                           = default;
            Optional <ApplicationGatewayOperationalState>                    operationalState                    = default;
            Optional <IList <ApplicationGatewayIPConfiguration> >            gatewayIPConfigurations             = default;
            Optional <IList <ApplicationGatewayAuthenticationCertificate> >  authenticationCertificates          = default;
            Optional <IList <ApplicationGatewayTrustedRootCertificate> >     trustedRootCertificates             = default;
            Optional <IList <ApplicationGatewaySslCertificate> >             sslCertificates                     = default;
            Optional <IList <ApplicationGatewayFrontendIPConfiguration> >    frontendIPConfigurations            = default;
            Optional <IList <ApplicationGatewayFrontendPort> >               frontendPorts                       = default;
            Optional <IList <ApplicationGatewayProbe> >                      probes                              = default;
            Optional <IList <ApplicationGatewayBackendAddressPool> >         backendAddressPools                 = default;
            Optional <IList <ApplicationGatewayBackendHttpSettings> >        backendHttpSettingsCollection       = default;
            Optional <IList <ApplicationGatewayHttpListener> >               httpListeners                       = default;
            Optional <IList <ApplicationGatewayUrlPathMap> >                 urlPathMaps                         = default;
            Optional <IList <ApplicationGatewayRequestRoutingRule> >         requestRoutingRules                 = default;
            Optional <IList <ApplicationGatewayRewriteRuleSet> >             rewriteRuleSets                     = default;
            Optional <IList <ApplicationGatewayRedirectConfiguration> >      redirectConfigurations              = default;
            Optional <ApplicationGatewayWebApplicationFirewallConfiguration> webApplicationFirewallConfiguration = default;
            Optional <SubResource>                                           firewallPolicy                      = default;
            Optional <bool> enableHttp2 = default;
            Optional <bool> enableFips  = default;
            Optional <ApplicationGatewayAutoscaleConfiguration> autoscaleConfiguration = default;
            Optional <string>            resourceGuid      = default;
            Optional <ProvisioningState> provisioningState = default;
            Optional <IList <ApplicationGatewayCustomError> > customErrorConfigurations = default;
            Optional <bool> forceFirewallPolicyAssociation = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("zones"))
                {
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    zones = array;
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("sku"))
                        {
                            sku = ApplicationGatewaySku.DeserializeApplicationGatewaySku(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("sslPolicy"))
                        {
                            sslPolicy = ApplicationGatewaySslPolicy.DeserializeApplicationGatewaySslPolicy(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("operationalState"))
                        {
                            operationalState = new ApplicationGatewayOperationalState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("gatewayIPConfigurations"))
                        {
                            List <ApplicationGatewayIPConfiguration> array = new List <ApplicationGatewayIPConfiguration>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayIPConfiguration.DeserializeApplicationGatewayIPConfiguration(item));
                            }
                            gatewayIPConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("authenticationCertificates"))
                        {
                            List <ApplicationGatewayAuthenticationCertificate> array = new List <ApplicationGatewayAuthenticationCertificate>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayAuthenticationCertificate.DeserializeApplicationGatewayAuthenticationCertificate(item));
                            }
                            authenticationCertificates = array;
                            continue;
                        }
                        if (property0.NameEquals("trustedRootCertificates"))
                        {
                            List <ApplicationGatewayTrustedRootCertificate> array = new List <ApplicationGatewayTrustedRootCertificate>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayTrustedRootCertificate.DeserializeApplicationGatewayTrustedRootCertificate(item));
                            }
                            trustedRootCertificates = array;
                            continue;
                        }
                        if (property0.NameEquals("sslCertificates"))
                        {
                            List <ApplicationGatewaySslCertificate> array = new List <ApplicationGatewaySslCertificate>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewaySslCertificate.DeserializeApplicationGatewaySslCertificate(item));
                            }
                            sslCertificates = array;
                            continue;
                        }
                        if (property0.NameEquals("frontendIPConfigurations"))
                        {
                            List <ApplicationGatewayFrontendIPConfiguration> array = new List <ApplicationGatewayFrontendIPConfiguration>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayFrontendIPConfiguration.DeserializeApplicationGatewayFrontendIPConfiguration(item));
                            }
                            frontendIPConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("frontendPorts"))
                        {
                            List <ApplicationGatewayFrontendPort> array = new List <ApplicationGatewayFrontendPort>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayFrontendPort.DeserializeApplicationGatewayFrontendPort(item));
                            }
                            frontendPorts = array;
                            continue;
                        }
                        if (property0.NameEquals("probes"))
                        {
                            List <ApplicationGatewayProbe> array = new List <ApplicationGatewayProbe>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayProbe.DeserializeApplicationGatewayProbe(item));
                            }
                            probes = array;
                            continue;
                        }
                        if (property0.NameEquals("backendAddressPools"))
                        {
                            List <ApplicationGatewayBackendAddressPool> array = new List <ApplicationGatewayBackendAddressPool>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(item));
                            }
                            backendAddressPools = array;
                            continue;
                        }
                        if (property0.NameEquals("backendHttpSettingsCollection"))
                        {
                            List <ApplicationGatewayBackendHttpSettings> array = new List <ApplicationGatewayBackendHttpSettings>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayBackendHttpSettings.DeserializeApplicationGatewayBackendHttpSettings(item));
                            }
                            backendHttpSettingsCollection = array;
                            continue;
                        }
                        if (property0.NameEquals("httpListeners"))
                        {
                            List <ApplicationGatewayHttpListener> array = new List <ApplicationGatewayHttpListener>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayHttpListener.DeserializeApplicationGatewayHttpListener(item));
                            }
                            httpListeners = array;
                            continue;
                        }
                        if (property0.NameEquals("urlPathMaps"))
                        {
                            List <ApplicationGatewayUrlPathMap> array = new List <ApplicationGatewayUrlPathMap>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayUrlPathMap.DeserializeApplicationGatewayUrlPathMap(item));
                            }
                            urlPathMaps = array;
                            continue;
                        }
                        if (property0.NameEquals("requestRoutingRules"))
                        {
                            List <ApplicationGatewayRequestRoutingRule> array = new List <ApplicationGatewayRequestRoutingRule>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayRequestRoutingRule.DeserializeApplicationGatewayRequestRoutingRule(item));
                            }
                            requestRoutingRules = array;
                            continue;
                        }
                        if (property0.NameEquals("rewriteRuleSets"))
                        {
                            List <ApplicationGatewayRewriteRuleSet> array = new List <ApplicationGatewayRewriteRuleSet>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayRewriteRuleSet.DeserializeApplicationGatewayRewriteRuleSet(item));
                            }
                            rewriteRuleSets = array;
                            continue;
                        }
                        if (property0.NameEquals("redirectConfigurations"))
                        {
                            List <ApplicationGatewayRedirectConfiguration> array = new List <ApplicationGatewayRedirectConfiguration>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayRedirectConfiguration.DeserializeApplicationGatewayRedirectConfiguration(item));
                            }
                            redirectConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("webApplicationFirewallConfiguration"))
                        {
                            webApplicationFirewallConfiguration = ApplicationGatewayWebApplicationFirewallConfiguration.DeserializeApplicationGatewayWebApplicationFirewallConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("firewallPolicy"))
                        {
                            firewallPolicy = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("enableHttp2"))
                        {
                            enableHttp2 = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("enableFips"))
                        {
                            enableFips = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("autoscaleConfiguration"))
                        {
                            autoscaleConfiguration = ApplicationGatewayAutoscaleConfiguration.DeserializeApplicationGatewayAutoscaleConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("resourceGuid"))
                        {
                            resourceGuid = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("customErrorConfigurations"))
                        {
                            List <ApplicationGatewayCustomError> array = new List <ApplicationGatewayCustomError>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationGatewayCustomError.DeserializeApplicationGatewayCustomError(item));
                            }
                            customErrorConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("forceFirewallPolicyAssociation"))
                        {
                            forceFirewallPolicyAssociation = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationGateway(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), etag.Value, Optional.ToList(zones), identity.Value, sku.Value, sslPolicy.Value, Optional.ToNullable(operationalState), Optional.ToList(gatewayIPConfigurations), Optional.ToList(authenticationCertificates), Optional.ToList(trustedRootCertificates), Optional.ToList(sslCertificates), Optional.ToList(frontendIPConfigurations), Optional.ToList(frontendPorts), Optional.ToList(probes), Optional.ToList(backendAddressPools), Optional.ToList(backendHttpSettingsCollection), Optional.ToList(httpListeners), Optional.ToList(urlPathMaps), Optional.ToList(requestRoutingRules), Optional.ToList(rewriteRuleSets), Optional.ToList(redirectConfigurations), webApplicationFirewallConfiguration.Value, firewallPolicy.Value, Optional.ToNullable(enableHttp2), Optional.ToNullable(enableFips), autoscaleConfiguration.Value, resourceGuid.Value, Optional.ToNullable(provisioningState), Optional.ToList(customErrorConfigurations), Optional.ToNullable(forceFirewallPolicyAssociation)));
        }
Beispiel #3
0
        internal static NetworkVirtualAppliance DeserializeNetworkVirtualAppliance(JsonElement element)
        {
            Optional <ManagedServiceIdentity>        identity = default;
            Optional <VirtualApplianceSkuProperties> sku      = default;
            Optional <string> etag     = default;
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            Optional <string> location = default;
            Optional <IDictionary <string, string> > tags         = default;
            Optional <IList <string> > bootStrapConfigurationBlob = default;
            Optional <SubResource>     virtualHub = default;
            Optional <IList <string> > cloudInitConfigurationBlob = default;
            Optional <long>            virtualApplianceAsn        = default;
            Optional <IReadOnlyList <VirtualApplianceNicProperties> > virtualApplianceNics = default;
            Optional <ProvisioningState> provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    sku = VirtualApplianceSkuProperties.DeserializeVirtualApplianceSkuProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("bootStrapConfigurationBlob"))
                        {
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(item.GetString());
                            }
                            bootStrapConfigurationBlob = array;
                            continue;
                        }
                        if (property0.NameEquals("virtualHub"))
                        {
                            virtualHub = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("cloudInitConfigurationBlob"))
                        {
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(item.GetString());
                            }
                            cloudInitConfigurationBlob = array;
                            continue;
                        }
                        if (property0.NameEquals("virtualApplianceAsn"))
                        {
                            virtualApplianceAsn = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("virtualApplianceNics"))
                        {
                            List <VirtualApplianceNicProperties> array = new List <VirtualApplianceNicProperties>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(VirtualApplianceNicProperties.DeserializeVirtualApplianceNicProperties(item));
                            }
                            virtualApplianceNics = array;
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new NetworkVirtualAppliance(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), identity.Value, sku.Value, etag.Value, Optional.ToList(bootStrapConfigurationBlob), virtualHub.Value, Optional.ToList(cloudInitConfigurationBlob), Optional.ToNullable(virtualApplianceAsn), Optional.ToList(virtualApplianceNics), Optional.ToNullable(provisioningState)));
        }
        internal static FirewallPolicy DeserializeFirewallPolicy(JsonElement element)
        {
            Optional <string> etag = default;
            Optional <ManagedServiceIdentity> identity = default;
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            Optional <string> location = default;
            Optional <IDictionary <string, string> > tags              = default;
            Optional <IReadOnlyList <SubResource> >  ruleGroups        = default;
            Optional <ProvisioningState>             provisioningState = default;
            Optional <SubResource> basePolicy = default;
            Optional <IReadOnlyList <SubResource> >       firewalls            = default;
            Optional <IReadOnlyList <SubResource> >       childPolicies        = default;
            Optional <AzureFirewallThreatIntelMode>       threatIntelMode      = default;
            Optional <FirewallPolicyThreatIntelWhitelist> threatIntelWhitelist = default;
            Optional <FirewallPolicyIntrusionSystemMode>  intrusionSystemMode  = default;
            Optional <FirewallPolicyTransportSecurity>    transportSecurity    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("ruleGroups"))
                        {
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(SubResource.DeserializeSubResource(item));
                            }
                            ruleGroups = array;
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("basePolicy"))
                        {
                            basePolicy = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("firewalls"))
                        {
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(SubResource.DeserializeSubResource(item));
                            }
                            firewalls = array;
                            continue;
                        }
                        if (property0.NameEquals("childPolicies"))
                        {
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(SubResource.DeserializeSubResource(item));
                            }
                            childPolicies = array;
                            continue;
                        }
                        if (property0.NameEquals("threatIntelMode"))
                        {
                            threatIntelMode = new AzureFirewallThreatIntelMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("threatIntelWhitelist"))
                        {
                            threatIntelWhitelist = FirewallPolicyThreatIntelWhitelist.DeserializeFirewallPolicyThreatIntelWhitelist(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("intrusionSystemMode"))
                        {
                            intrusionSystemMode = new FirewallPolicyIntrusionSystemMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("transportSecurity"))
                        {
                            transportSecurity = FirewallPolicyTransportSecurity.DeserializeFirewallPolicyTransportSecurity(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new FirewallPolicy(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), etag.Value, identity.Value, Optional.ToList(ruleGroups), Optional.ToNullable(provisioningState), basePolicy.Value, Optional.ToList(firewalls), Optional.ToList(childPolicies), Optional.ToNullable(threatIntelMode), threatIntelWhitelist.Value, Optional.ToNullable(intrusionSystemMode), transportSecurity.Value));
        }
Beispiel #5
0
        internal static ExpressRoutePort DeserializeExpressRoutePort(JsonElement element)
        {
            Optional <string> etag = default;
            Optional <ManagedServiceIdentity> identity = default;
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            Optional <string> location = default;
            Optional <IDictionary <string, string> > tags = default;
            Optional <string> peeringLocation             = default;
            Optional <int>    bandwidthInGbps             = default;
            Optional <float>  provisionedBandwidthInGbps  = default;
            Optional <string> mtu = default;
            Optional <ExpressRoutePortsEncapsulation> encapsulation = default;
            Optional <string> etherType      = default;
            Optional <string> allocationDate = default;
            Optional <IList <ExpressRouteLink> >    links             = default;
            Optional <IReadOnlyList <SubResource> > circuits          = default;
            Optional <ProvisioningState>            provisioningState = default;
            Optional <string> resourceGuid = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("peeringLocation"))
                        {
                            peeringLocation = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("bandwidthInGbps"))
                        {
                            bandwidthInGbps = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("provisionedBandwidthInGbps"))
                        {
                            provisionedBandwidthInGbps = property0.Value.GetSingle();
                            continue;
                        }
                        if (property0.NameEquals("mtu"))
                        {
                            mtu = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("encapsulation"))
                        {
                            encapsulation = new ExpressRoutePortsEncapsulation(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("etherType"))
                        {
                            etherType = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("allocationDate"))
                        {
                            allocationDate = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("links"))
                        {
                            List <ExpressRouteLink> array = new List <ExpressRouteLink>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ExpressRouteLink.DeserializeExpressRouteLink(item));
                            }
                            links = array;
                            continue;
                        }
                        if (property0.NameEquals("circuits"))
                        {
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(SubResource.DeserializeSubResource(item));
                            }
                            circuits = array;
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("resourceGuid"))
                        {
                            resourceGuid = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ExpressRoutePort(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), etag.Value, identity.Value, peeringLocation.Value, Optional.ToNullable(bandwidthInGbps), Optional.ToNullable(provisionedBandwidthInGbps), mtu.Value, Optional.ToNullable(encapsulation), etherType.Value, allocationDate.Value, Optional.ToList(links), Optional.ToList(circuits), Optional.ToNullable(provisioningState), resourceGuid.Value));
        }
        internal static FirewallPolicy DeserializeFirewallPolicy(JsonElement element)
        {
            string etag = default;
            ManagedServiceIdentity identity = default;
            string id       = default;
            string name     = default;
            string type     = default;
            string location = default;
            IDictionary <string, string> tags                       = default;
            IList <SubResource>          ruleGroups                 = default;
            ProvisioningState?           provisioningState          = default;
            SubResource                        basePolicy           = default;
            IList <SubResource>                firewalls            = default;
            IList <SubResource>                childPolicies        = default;
            AzureFirewallThreatIntelMode?      threatIntelMode      = default;
            FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default;
            FirewallPolicyIntrusionSystemMode? intrusionSystemMode  = default;
            FirewallPolicyTransportSecurity    transportSecurity    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("ruleGroups"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(SubResource.DeserializeSubResource(item));
                                }
                            }
                            ruleGroups = array;
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("basePolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            basePolicy = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("firewalls"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(SubResource.DeserializeSubResource(item));
                                }
                            }
                            firewalls = array;
                            continue;
                        }
                        if (property0.NameEquals("childPolicies"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(SubResource.DeserializeSubResource(item));
                                }
                            }
                            childPolicies = array;
                            continue;
                        }
                        if (property0.NameEquals("threatIntelMode"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            threatIntelMode = new AzureFirewallThreatIntelMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("threatIntelWhitelist"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            threatIntelWhitelist = FirewallPolicyThreatIntelWhitelist.DeserializeFirewallPolicyThreatIntelWhitelist(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("intrusionSystemMode"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            intrusionSystemMode = new FirewallPolicyIntrusionSystemMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("transportSecurity"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            transportSecurity = FirewallPolicyTransportSecurity.DeserializeFirewallPolicyTransportSecurity(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new FirewallPolicy(id, name, type, location, tags, etag, identity, ruleGroups, provisioningState, basePolicy, firewalls, childPolicies, threatIntelMode, threatIntelWhitelist, intrusionSystemMode, transportSecurity));
        }
Beispiel #7
0
        internal static ApplicationGateway DeserializeApplicationGateway(JsonElement element)
        {
            string                                                etag                                = default;
            IList <string>                                        zones                               = default;
            ManagedServiceIdentity                                identity                            = default;
            string                                                id                                  = default;
            string                                                name                                = default;
            string                                                type                                = default;
            string                                                location                            = default;
            IDictionary <string, string>                          tags                                = default;
            ApplicationGatewaySku                                 sku                                 = default;
            ApplicationGatewaySslPolicy                           sslPolicy                           = default;
            ApplicationGatewayOperationalState?                   operationalState                    = default;
            IList <ApplicationGatewayIPConfiguration>             gatewayIPConfigurations             = default;
            IList <ApplicationGatewayAuthenticationCertificate>   authenticationCertificates          = default;
            IList <ApplicationGatewayTrustedRootCertificate>      trustedRootCertificates             = default;
            IList <ApplicationGatewaySslCertificate>              sslCertificates                     = default;
            IList <ApplicationGatewayFrontendIPConfiguration>     frontendIPConfigurations            = default;
            IList <ApplicationGatewayFrontendPort>                frontendPorts                       = default;
            IList <ApplicationGatewayProbe>                       probes                              = default;
            IList <ApplicationGatewayBackendAddressPool>          backendAddressPools                 = default;
            IList <ApplicationGatewayBackendHttpSettings>         backendHttpSettingsCollection       = default;
            IList <ApplicationGatewayHttpListener>                httpListeners                       = default;
            IList <ApplicationGatewayUrlPathMap>                  urlPathMaps                         = default;
            IList <ApplicationGatewayRequestRoutingRule>          requestRoutingRules                 = default;
            IList <ApplicationGatewayRewriteRuleSet>              rewriteRuleSets                     = default;
            IList <ApplicationGatewayRedirectConfiguration>       redirectConfigurations              = default;
            ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default;
            SubResource                                           firewallPolicy                      = default;
            bool?enableHttp2 = default;
            bool?enableFips  = default;
            ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration = default;
            string            resourceGuid      = default;
            ProvisioningState?provisioningState = default;
            IList <ApplicationGatewayCustomError> customErrorConfigurations = default;
            bool?forceFirewallPolicyAssociation = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("zones"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(item.GetString());
                        }
                    }
                    zones = array;
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("sku"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            sku = ApplicationGatewaySku.DeserializeApplicationGatewaySku(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("sslPolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            sslPolicy = ApplicationGatewaySslPolicy.DeserializeApplicationGatewaySslPolicy(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("operationalState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            operationalState = new ApplicationGatewayOperationalState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("gatewayIPConfigurations"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayIPConfiguration> array = new List <ApplicationGatewayIPConfiguration>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayIPConfiguration.DeserializeApplicationGatewayIPConfiguration(item));
                                }
                            }
                            gatewayIPConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("authenticationCertificates"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayAuthenticationCertificate> array = new List <ApplicationGatewayAuthenticationCertificate>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayAuthenticationCertificate.DeserializeApplicationGatewayAuthenticationCertificate(item));
                                }
                            }
                            authenticationCertificates = array;
                            continue;
                        }
                        if (property0.NameEquals("trustedRootCertificates"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayTrustedRootCertificate> array = new List <ApplicationGatewayTrustedRootCertificate>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayTrustedRootCertificate.DeserializeApplicationGatewayTrustedRootCertificate(item));
                                }
                            }
                            trustedRootCertificates = array;
                            continue;
                        }
                        if (property0.NameEquals("sslCertificates"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewaySslCertificate> array = new List <ApplicationGatewaySslCertificate>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewaySslCertificate.DeserializeApplicationGatewaySslCertificate(item));
                                }
                            }
                            sslCertificates = array;
                            continue;
                        }
                        if (property0.NameEquals("frontendIPConfigurations"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayFrontendIPConfiguration> array = new List <ApplicationGatewayFrontendIPConfiguration>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayFrontendIPConfiguration.DeserializeApplicationGatewayFrontendIPConfiguration(item));
                                }
                            }
                            frontendIPConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("frontendPorts"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayFrontendPort> array = new List <ApplicationGatewayFrontendPort>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayFrontendPort.DeserializeApplicationGatewayFrontendPort(item));
                                }
                            }
                            frontendPorts = array;
                            continue;
                        }
                        if (property0.NameEquals("probes"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayProbe> array = new List <ApplicationGatewayProbe>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayProbe.DeserializeApplicationGatewayProbe(item));
                                }
                            }
                            probes = array;
                            continue;
                        }
                        if (property0.NameEquals("backendAddressPools"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayBackendAddressPool> array = new List <ApplicationGatewayBackendAddressPool>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(item));
                                }
                            }
                            backendAddressPools = array;
                            continue;
                        }
                        if (property0.NameEquals("backendHttpSettingsCollection"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayBackendHttpSettings> array = new List <ApplicationGatewayBackendHttpSettings>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayBackendHttpSettings.DeserializeApplicationGatewayBackendHttpSettings(item));
                                }
                            }
                            backendHttpSettingsCollection = array;
                            continue;
                        }
                        if (property0.NameEquals("httpListeners"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayHttpListener> array = new List <ApplicationGatewayHttpListener>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayHttpListener.DeserializeApplicationGatewayHttpListener(item));
                                }
                            }
                            httpListeners = array;
                            continue;
                        }
                        if (property0.NameEquals("urlPathMaps"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayUrlPathMap> array = new List <ApplicationGatewayUrlPathMap>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayUrlPathMap.DeserializeApplicationGatewayUrlPathMap(item));
                                }
                            }
                            urlPathMaps = array;
                            continue;
                        }
                        if (property0.NameEquals("requestRoutingRules"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayRequestRoutingRule> array = new List <ApplicationGatewayRequestRoutingRule>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayRequestRoutingRule.DeserializeApplicationGatewayRequestRoutingRule(item));
                                }
                            }
                            requestRoutingRules = array;
                            continue;
                        }
                        if (property0.NameEquals("rewriteRuleSets"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayRewriteRuleSet> array = new List <ApplicationGatewayRewriteRuleSet>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayRewriteRuleSet.DeserializeApplicationGatewayRewriteRuleSet(item));
                                }
                            }
                            rewriteRuleSets = array;
                            continue;
                        }
                        if (property0.NameEquals("redirectConfigurations"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayRedirectConfiguration> array = new List <ApplicationGatewayRedirectConfiguration>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayRedirectConfiguration.DeserializeApplicationGatewayRedirectConfiguration(item));
                                }
                            }
                            redirectConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("webApplicationFirewallConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            webApplicationFirewallConfiguration = ApplicationGatewayWebApplicationFirewallConfiguration.DeserializeApplicationGatewayWebApplicationFirewallConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("firewallPolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            firewallPolicy = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("enableHttp2"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            enableHttp2 = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("enableFips"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            enableFips = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("autoscaleConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            autoscaleConfiguration = ApplicationGatewayAutoscaleConfiguration.DeserializeApplicationGatewayAutoscaleConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("resourceGuid"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            resourceGuid = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("customErrorConfigurations"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewayCustomError> array = new List <ApplicationGatewayCustomError>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationGatewayCustomError.DeserializeApplicationGatewayCustomError(item));
                                }
                            }
                            customErrorConfigurations = array;
                            continue;
                        }
                        if (property0.NameEquals("forceFirewallPolicyAssociation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            forceFirewallPolicyAssociation = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationGateway(id, name, type, location, tags, etag, zones, identity, sku, sslPolicy, operationalState, gatewayIPConfigurations, authenticationCertificates, trustedRootCertificates, sslCertificates, frontendIPConfigurations, frontendPorts, probes, backendAddressPools, backendHttpSettingsCollection, httpListeners, urlPathMaps, requestRoutingRules, rewriteRuleSets, redirectConfigurations, webApplicationFirewallConfiguration, firewallPolicy, enableHttp2, enableFips, autoscaleConfiguration, resourceGuid, provisioningState, customErrorConfigurations, forceFirewallPolicyAssociation));
        }
        internal static ExpressRoutePort DeserializeExpressRoutePort(JsonElement element)
        {
            string etag = default;
            ManagedServiceIdentity identity = default;
            string id       = default;
            string name     = default;
            string type     = default;
            string location = default;
            IDictionary <string, string> tags = default;
            string peeringLocation            = default;
            int?   bandwidthInGbps            = default;
            float? provisionedBandwidthInGbps = default;
            string mtu = default;
            ExpressRoutePortsEncapsulation?encapsulation = default;
            string etherType                           = default;
            string allocationDate                      = default;
            IList <ExpressRouteLink> links             = default;
            IList <SubResource>      circuits          = default;
            ProvisioningState?       provisioningState = default;
            string resourceGuid                        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("peeringLocation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            peeringLocation = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("bandwidthInGbps"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            bandwidthInGbps = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("provisionedBandwidthInGbps"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisionedBandwidthInGbps = property0.Value.GetSingle();
                            continue;
                        }
                        if (property0.NameEquals("mtu"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            mtu = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("encapsulation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            encapsulation = new ExpressRoutePortsEncapsulation(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("etherType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            etherType = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("allocationDate"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            allocationDate = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("links"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ExpressRouteLink> array = new List <ExpressRouteLink>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ExpressRouteLink.DeserializeExpressRouteLink(item));
                                }
                            }
                            links = array;
                            continue;
                        }
                        if (property0.NameEquals("circuits"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <SubResource> array = new List <SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(SubResource.DeserializeSubResource(item));
                                }
                            }
                            circuits = array;
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("resourceGuid"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            resourceGuid = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ExpressRoutePort(id, name, type, location, tags, etag, identity, peeringLocation, bandwidthInGbps, provisionedBandwidthInGbps, mtu, encapsulation, etherType, allocationDate, links, circuits, provisioningState, resourceGuid));
        }