internal DataFlowDebugPackage(string sessionId, DataFlowDebugResource dataFlow, IList <DatasetDebugResource> datasets, IList <LinkedServiceDebugResource> linkedServices, DataFlowStagingInfo staging, DataFlowDebugPackageDebugSettings debugSettings, IDictionary <string, object> additionalProperties)
 {
     SessionId            = sessionId;
     DataFlow             = dataFlow;
     Datasets             = datasets;
     LinkedServices       = linkedServices;
     Staging              = staging;
     DebugSettings        = debugSettings;
     AdditionalProperties = additionalProperties;
 }
        internal static DataFlowDebugPackage DeserializeDataFlowDebugPackage(JsonElement element)
        {
            Optional <string> sessionId = default;
            Optional <DataFlowDebugResource>               dataFlow       = default;
            Optional <IList <DatasetDebugResource> >       datasets       = default;
            Optional <IList <LinkedServiceDebugResource> > linkedServices = default;
            Optional <DataFlowStagingInfo> staging = default;
            Optional <DataFlowDebugPackageDebugSettings> debugSettings  = default;
            IDictionary <string, object> additionalProperties           = default;
            Dictionary <string, object>  additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sessionId"))
                {
                    sessionId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dataFlow"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    dataFlow = DataFlowDebugResource.DeserializeDataFlowDebugResource(property.Value);
                    continue;
                }
                if (property.NameEquals("datasets"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DatasetDebugResource> array = new List <DatasetDebugResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DatasetDebugResource.DeserializeDatasetDebugResource(item));
                    }
                    datasets = array;
                    continue;
                }
                if (property.NameEquals("linkedServices"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <LinkedServiceDebugResource> array = new List <LinkedServiceDebugResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LinkedServiceDebugResource.DeserializeLinkedServiceDebugResource(item));
                    }
                    linkedServices = array;
                    continue;
                }
                if (property.NameEquals("staging"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    staging = DataFlowStagingInfo.DeserializeDataFlowStagingInfo(property.Value);
                    continue;
                }
                if (property.NameEquals("debugSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    debugSettings = DataFlowDebugPackageDebugSettings.DeserializeDataFlowDebugPackageDebugSettings(property.Value);
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new DataFlowDebugPackage(sessionId.Value, dataFlow.Value, Optional.ToList(datasets), Optional.ToList(linkedServices), staging.Value, debugSettings.Value, additionalProperties));
        }