internal static LinkedServiceListResponse DeserializeLinkedServiceListResponse(JsonElement element)
        {
            IReadOnlyList <LinkedServiceResource> value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <LinkedServiceResource> array = new List <LinkedServiceResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LinkedServiceResource.DeserializeLinkedServiceResource(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new LinkedServiceListResponse(value, nextLink.Value));
        }
        internal static CreateDataFlowDebugSessionRequest DeserializeCreateDataFlowDebugSessionRequest(JsonElement element)
        {
            Optional <string> dataFlowName       = default;
            Optional <string> existingClusterId  = default;
            Optional <int>    clusterTimeout     = default;
            Optional <string> newClusterName     = default;
            Optional <string> newClusterNodeType = default;
            Optional <LinkedServiceResource> dataBricksLinkedService = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("dataFlowName"))
                {
                    dataFlowName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("existingClusterId"))
                {
                    existingClusterId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("clusterTimeout"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    clusterTimeout = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("newClusterName"))
                {
                    newClusterName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("newClusterNodeType"))
                {
                    newClusterNodeType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dataBricksLinkedService"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    dataBricksLinkedService = LinkedServiceResource.DeserializeLinkedServiceResource(property.Value);
                    continue;
                }
            }
            return(new CreateDataFlowDebugSessionRequest(dataFlowName.Value, existingClusterId.Value, Optional.ToNullable(clusterTimeout), newClusterName.Value, newClusterNodeType.Value, dataBricksLinkedService.Value));
        }
Ejemplo n.º 3
0
        internal static StartDataFlowDebugSessionRequest DeserializeStartDataFlowDebugSessionRequest(JsonElement element)
        {
            Optional <string>                         sessionId      = default;
            Optional <DataFlowResource>               dataFlow       = default;
            Optional <IList <DataFlowResource> >      dataFlows      = default;
            Optional <IList <DatasetResource> >       datasets       = default;
            Optional <IList <LinkedServiceResource> > linkedServices = default;
            Optional <object>                         staging        = default;
            Optional <object>                         debugSettings  = default;
            Optional <bool> incrementalDebug = default;

            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 = DataFlowResource.DeserializeDataFlowResource(property.Value);
                    continue;
                }
                if (property.NameEquals("dataFlows"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DataFlowResource> array = new List <DataFlowResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DataFlowResource.DeserializeDataFlowResource(item));
                    }
                    dataFlows = array;
                    continue;
                }
                if (property.NameEquals("datasets"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DatasetResource> array = new List <DatasetResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DatasetResource.DeserializeDatasetResource(item));
                    }
                    datasets = array;
                    continue;
                }
                if (property.NameEquals("linkedServices"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <LinkedServiceResource> array = new List <LinkedServiceResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LinkedServiceResource.DeserializeLinkedServiceResource(item));
                    }
                    linkedServices = array;
                    continue;
                }
                if (property.NameEquals("staging"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    staging = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("debugSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    debugSettings = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("incrementalDebug"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    incrementalDebug = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new StartDataFlowDebugSessionRequest(sessionId.Value, dataFlow.Value, Optional.ToList(dataFlows), Optional.ToList(datasets), Optional.ToList(linkedServices), staging.Value, debugSettings.Value, Optional.ToNullable(incrementalDebug)));
        }