internal static Model_internal DeserializeModel_internal(JsonElement element)
        {
            ModelInfo_internal   modelInfo   = default;
            KeysResult_internal  keys        = default;
            TrainResult_internal trainResult = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("modelInfo"))
                {
                    modelInfo = ModelInfo_internal.DeserializeModelInfo_internal(property.Value);
                    continue;
                }
                if (property.NameEquals("keys"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    keys = KeysResult_internal.DeserializeKeysResult_internal(property.Value);
                    continue;
                }
                if (property.NameEquals("trainResult"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    trainResult = TrainResult_internal.DeserializeTrainResult_internal(property.Value);
                    continue;
                }
            }
            return(new Model_internal(modelInfo, keys, trainResult));
        }
 internal CustomFormModelInfo(ModelInfo_internal modelInfo)
 {
     ModelId      = modelInfo.ModelId.ToString();
     CreatedOn    = modelInfo.CreatedDateTime;
     LastModified = modelInfo.LastUpdatedDateTime;
     Status       = modelInfo.Status;
 }
 internal CustomFormModelInfo(ModelInfo_internal modelInfo)
 {
     ModelId             = modelInfo.ModelId.ToString();
     TrainingStartedOn   = modelInfo.CreatedDateTime;
     TrainingCompletedOn = modelInfo.LastUpdatedDateTime;
     Status = modelInfo.Status;
 }
 internal CustomFormModelInfo(ModelInfo_internal modelInfo)
 {
     ModelId       = modelInfo.ModelId.ToString();
     CreatedOn     = new DateTime(modelInfo.CreatedDateTime.Ticks, DateTimeKind.Utc);
     LastUpdatedOn = new DateTime(modelInfo.LastUpdatedDateTime.Ticks, DateTimeKind.Utc);
     Status        = modelInfo.Status;
 }
Beispiel #5
0
        internal Model_internal(ModelInfo_internal modelInfo)
        {
            if (modelInfo == null)
            {
                throw new ArgumentNullException(nameof(modelInfo));
            }

            ModelInfo = modelInfo;
        }
        internal static Models_internal DeserializeModels_internal(JsonElement element)
        {
            ModelsSummary_internal             summary   = default;
            IReadOnlyList <ModelInfo_internal> modelList = default;
            string nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("summary"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    summary = ModelsSummary_internal.DeserializeModelsSummary_internal(property.Value);
                    continue;
                }
                if (property.NameEquals("modelList"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ModelInfo_internal> array = new List <ModelInfo_internal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ModelInfo_internal.DeserializeModelInfo_internal(item));
                        }
                    }
                    modelList = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new Models_internal(summary, modelList, nextLink));
        }
Beispiel #7
0
 internal Model_internal(ModelInfo_internal modelInfo, KeysResult_internal keys, TrainResult_internal trainResult)
 {
     ModelInfo   = modelInfo;
     Keys        = keys;
     TrainResult = trainResult;
 }