internal LabelingJob(JobType jobType, JobBaseInteractionEndpoints interactionEndpoints, string description, IDictionary <string, string> tags, IDictionary <string, string> properties, IDictionary <string, LabelCategory> labelCategories, LabelingJobInstructions jobInstructions, LabelingDatasetConfiguration datasetConfiguration, MLAssistConfiguration mlAssistConfiguration, LabelingJobMediaProperties labelingJobMediaProperties, Guid?projectId, JobStatus?status, ProgressMetrics progressMetrics, IList <StatusMessage> statusMessages, DateTimeOffset?createdTimeUtc) : base(jobType, interactionEndpoints, description, tags, properties)
 {
     LabelCategories            = labelCategories;
     JobInstructions            = jobInstructions;
     DatasetConfiguration       = datasetConfiguration;
     MlAssistConfiguration      = mlAssistConfiguration;
     LabelingJobMediaProperties = labelingJobMediaProperties;
     ProjectId       = projectId;
     Status          = status;
     ProgressMetrics = progressMetrics;
     StatusMessages  = statusMessages;
     CreatedTimeUtc  = createdTimeUtc;
     JobType         = jobType;
 }
        internal static LabelingJob DeserializeLabelingJob(JsonElement element)
        {
            Optional <IDictionary <string, LabelCategory> > labelCategories    = default;
            Optional <LabelingJobInstructions>      jobInstructions            = default;
            Optional <LabelingDatasetConfiguration> datasetConfiguration       = default;
            Optional <MLAssistConfiguration>        mlAssistConfiguration      = default;
            Optional <LabelingJobMediaProperties>   labelingJobMediaProperties = default;
            Optional <Guid>                   projectId       = default;
            Optional <JobStatus>              status          = default;
            Optional <ProgressMetrics>        progressMetrics = default;
            Optional <IList <StatusMessage> > statusMessages  = default;
            Optional <DateTimeOffset>         createdTimeUtc  = default;
            JobType jobType = default;
            Optional <JobBaseInteractionEndpoints> interactionEndpoints = default;
            Optional <string> description = default;
            Optional <IDictionary <string, string> > tags       = default;
            Optional <IDictionary <string, string> > properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("labelCategories"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, LabelCategory> dictionary = new Dictionary <string, LabelCategory>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, LabelCategory.DeserializeLabelCategory(property0.Value));
                    }
                    labelCategories = dictionary;
                    continue;
                }
                if (property.NameEquals("jobInstructions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    jobInstructions = LabelingJobInstructions.DeserializeLabelingJobInstructions(property.Value);
                    continue;
                }
                if (property.NameEquals("datasetConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    datasetConfiguration = LabelingDatasetConfiguration.DeserializeLabelingDatasetConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("mlAssistConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    mlAssistConfiguration = MLAssistConfiguration.DeserializeMLAssistConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("labelingJobMediaProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    labelingJobMediaProperties = LabelingJobMediaProperties.DeserializeLabelingJobMediaProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("projectId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    projectId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = new JobStatus(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("progressMetrics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    progressMetrics = ProgressMetrics.DeserializeProgressMetrics(property.Value);
                    continue;
                }
                if (property.NameEquals("statusMessages"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <StatusMessage> array = new List <StatusMessage>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(StatusMessage.DeserializeStatusMessage(item));
                    }
                    statusMessages = array;
                    continue;
                }
                if (property.NameEquals("createdTimeUtc"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    createdTimeUtc = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("jobType"))
                {
                    jobType = new JobType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("interactionEndpoints"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    interactionEndpoints = JobBaseInteractionEndpoints.DeserializeJobBaseInteractionEndpoints(property.Value);
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    properties = dictionary;
                    continue;
                }
            }
            return(new LabelingJob(jobType, interactionEndpoints.Value, description.Value, Optional.ToDictionary(tags), Optional.ToDictionary(properties), Optional.ToDictionary(labelCategories), jobInstructions.Value, datasetConfiguration.Value, mlAssistConfiguration.Value, labelingJobMediaProperties.Value, Optional.ToNullable(projectId), Optional.ToNullable(status), progressMetrics.Value, Optional.ToList(statusMessages), Optional.ToNullable(createdTimeUtc)));
        }