internal EventHubNamespaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, EventHubsSku sku, ManagedServiceIdentity identity, string provisioningState, string status, DateTimeOffset?createdOn, DateTimeOffset?updatedOn, string serviceBusEndpoint, string clusterArmId, string metricId, bool?isAutoInflateEnabled, int?maximumThroughputUnits, bool?kafkaEnabled, bool?zoneRedundant, EventHubEncryption encryption, IList <EventHubsPrivateEndpointConnectionData> privateEndpointConnections, bool?disableLocalAuth, string alternateName) : base(id, name, resourceType, systemData, tags, location)
 {
     Sku                        = sku;
     Identity                   = identity;
     ProvisioningState          = provisioningState;
     Status                     = status;
     CreatedOn                  = createdOn;
     UpdatedOn                  = updatedOn;
     ServiceBusEndpoint         = serviceBusEndpoint;
     ClusterArmId               = clusterArmId;
     MetricId                   = metricId;
     IsAutoInflateEnabled       = isAutoInflateEnabled;
     MaximumThroughputUnits     = maximumThroughputUnits;
     KafkaEnabled               = kafkaEnabled;
     ZoneRedundant              = zoneRedundant;
     Encryption                 = encryption;
     PrivateEndpointConnections = privateEndpointConnections;
     DisableLocalAuth           = disableLocalAuth;
     AlternateName              = alternateName;
 }
        internal static EventHubNamespaceData DeserializeEventHubNamespaceData(JsonElement element)
        {
            Optional <Models.Sku>        sku                     = default;
            Optional <ResourceIdentity>  identity                = default;
            Optional <SystemData>        systemData              = default;
            IDictionary <string, string> tags                    = default;
            Location                      location               = default;
            ResourceIdentifier            id                     = default;
            string                        name                   = default;
            ResourceType                  type                   = default;
            Optional <string>             provisioningState      = default;
            Optional <string>             status                 = default;
            Optional <DateTimeOffset>     createdAt              = default;
            Optional <DateTimeOffset>     updatedAt              = default;
            Optional <string>             serviceBusEndpoint     = default;
            Optional <string>             clusterArmId           = default;
            Optional <string>             metricId               = default;
            Optional <bool>               isAutoInflateEnabled   = default;
            Optional <int>                maximumThroughputUnits = default;
            Optional <bool>               kafkaEnabled           = default;
            Optional <bool>               zoneRedundant          = default;
            Optional <EventHubEncryption> encryption             = default;
            Optional <IList <PrivateEndpointConnectionData> > privateEndpointConnections = default;
            Optional <bool>   disableLocalAuth = default;
            Optional <string> alternateName    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = Models.Sku.DeserializeSku(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = JsonSerializer.Deserialize <ResourceIdentity>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    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("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("status"))
                        {
                            status = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("createdAt"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            createdAt = property0.Value.GetDateTimeOffset("O");
                            continue;
                        }
                        if (property0.NameEquals("updatedAt"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            updatedAt = property0.Value.GetDateTimeOffset("O");
                            continue;
                        }
                        if (property0.NameEquals("serviceBusEndpoint"))
                        {
                            serviceBusEndpoint = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("clusterArmId"))
                        {
                            clusterArmId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("metricId"))
                        {
                            metricId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("isAutoInflateEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            isAutoInflateEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("maximumThroughputUnits"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            maximumThroughputUnits = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("kafkaEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            kafkaEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("zoneRedundant"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            zoneRedundant = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("encryption"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            encryption = EventHubEncryption.DeserializeEventHubEncryption(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("privateEndpointConnections"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <PrivateEndpointConnectionData> array = new List <PrivateEndpointConnectionData>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(PrivateEndpointConnectionData.DeserializePrivateEndpointConnectionData(item));
                            }
                            privateEndpointConnections = array;
                            continue;
                        }
                        if (property0.NameEquals("disableLocalAuth"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            disableLocalAuth = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("alternateName"))
                        {
                            alternateName = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new EventHubNamespaceData(id, name, type, tags, location, sku.Value, identity, systemData, provisioningState.Value, status.Value, Optional.ToNullable(createdAt), Optional.ToNullable(updatedAt), serviceBusEndpoint.Value, clusterArmId.Value, metricId.Value, Optional.ToNullable(isAutoInflateEnabled), Optional.ToNullable(maximumThroughputUnits), Optional.ToNullable(kafkaEnabled), Optional.ToNullable(zoneRedundant), encryption.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(disableLocalAuth), alternateName.Value));
        }