internal CassandraClusterPublicStatus(string eTag, ManagedCassandraReaperStatus reaperStatus, IReadOnlyList <ConnectionError> connectionErrors, IReadOnlyList <CassandraClusterPublicStatusDataCentersItem> dataCenters)
 {
     ETag             = eTag;
     ReaperStatus     = reaperStatus;
     ConnectionErrors = connectionErrors;
     DataCenters      = dataCenters;
 }
        internal static CassandraClusterPublicStatus DeserializeCassandraClusterPublicStatus(JsonElement element)
        {
            Optional <string> eTag = default;
            Optional <ManagedCassandraReaperStatus>     reaperStatus     = default;
            Optional <IReadOnlyList <ConnectionError> > connectionErrors = default;
            Optional <IReadOnlyList <CassandraClusterPublicStatusDataCentersItem> > dataCenters = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("eTag"))
                {
                    eTag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("reaperStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    reaperStatus = ManagedCassandraReaperStatus.DeserializeManagedCassandraReaperStatus(property.Value);
                    continue;
                }
                if (property.NameEquals("connectionErrors"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ConnectionError> array = new List <ConnectionError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ConnectionError.DeserializeConnectionError(item));
                    }
                    connectionErrors = array;
                    continue;
                }
                if (property.NameEquals("dataCenters"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <CassandraClusterPublicStatusDataCentersItem> array = new List <CassandraClusterPublicStatusDataCentersItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(CassandraClusterPublicStatusDataCentersItem.DeserializeCassandraClusterPublicStatusDataCentersItem(item));
                    }
                    dataCenters = array;
                    continue;
                }
            }
            return(new CassandraClusterPublicStatus(eTag.Value, reaperStatus.Value, Optional.ToList(connectionErrors), Optional.ToList(dataCenters)));
        }