internal static TimeSeriesTypeOrError DeserializeTimeSeriesTypeOrError(JsonElement element)
        {
            Optional <TimeSeriesType> timeSeriesType = default;
            Optional <TsiErrorBody>   error          = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("timeSeriesType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    timeSeriesType = TimeSeriesType.DeserializeTimeSeriesType(property.Value);
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    error = TsiErrorBody.DeserializeTsiErrorBody(property.Value);
                    continue;
                }
            }
            return(new TimeSeriesTypeOrError(timeSeriesType.Value, error.Value));
        }
 internal TsiErrorBody(string code, string message, string target, TsiErrorBody innerError, IReadOnlyList<TsiErrorDetails> details, IReadOnlyDictionary<string, object> additionalProperties)
 {
     Code = code;
     Message = message;
     Target = target;
     InnerError = innerError;
     Details = details;
     AdditionalProperties = additionalProperties;
 }
        internal static HierarchiesBatchResponse DeserializeHierarchiesBatchResponse(JsonElement element)
        {
            Optional <IReadOnlyList <TimeSeriesHierarchyOrError> > @get = default;
            Optional <IReadOnlyList <TimeSeriesHierarchyOrError> > put  = default;
            Optional <IReadOnlyList <TsiErrorBody> > delete             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("get"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TimeSeriesHierarchyOrError> array = new List <TimeSeriesHierarchyOrError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TimeSeriesHierarchyOrError.DeserializeTimeSeriesHierarchyOrError(item));
                    }
                    @get = array;
                    continue;
                }
                if (property.NameEquals("put"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TimeSeriesHierarchyOrError> array = new List <TimeSeriesHierarchyOrError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TimeSeriesHierarchyOrError.DeserializeTimeSeriesHierarchyOrError(item));
                    }
                    put = array;
                    continue;
                }
                if (property.NameEquals("delete"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TsiErrorBody> array = new List <TsiErrorBody>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TsiErrorBody.DeserializeTsiErrorBody(item));
                    }
                    delete = array;
                    continue;
                }
            }
            return(new HierarchiesBatchResponse(Optional.ToList(@get), Optional.ToList(put), Optional.ToList(delete)));
        }