示例#1
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("jobType");
     writer.WriteStringValue(JobType.ToString());
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Tags))
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(ExperimentName))
     {
         writer.WritePropertyName("experimentName");
         writer.WriteStringValue(ExperimentName);
     }
     writer.WritePropertyName("computeBinding");
     writer.WriteObjectValue(ComputeBinding);
     if (Optional.IsDefined(Output))
     {
         writer.WritePropertyName("output");
         writer.WriteObjectValue(Output);
     }
     writer.WritePropertyName("jobType");
     writer.WriteStringValue(JobType.ToString());
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Tags))
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsCollectionDefined(LabelCategories))
     {
         writer.WritePropertyName("labelCategories");
         writer.WriteStartObject();
         foreach (var item in LabelCategories)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsDefined(JobInstructions))
     {
         writer.WritePropertyName("jobInstructions");
         writer.WriteObjectValue(JobInstructions);
     }
     if (Optional.IsDefined(DatasetConfiguration))
     {
         writer.WritePropertyName("datasetConfiguration");
         writer.WriteObjectValue(DatasetConfiguration);
     }
     if (Optional.IsDefined(MlAssistConfiguration))
     {
         writer.WritePropertyName("mlAssistConfiguration");
         writer.WriteObjectValue(MlAssistConfiguration);
     }
     if (Optional.IsDefined(LabelingJobMediaProperties))
     {
         writer.WritePropertyName("labelingJobMediaProperties");
         writer.WriteObjectValue(LabelingJobMediaProperties);
     }
     if (Optional.IsDefined(ProjectId))
     {
         writer.WritePropertyName("projectId");
         writer.WriteStringValue(ProjectId.Value);
     }
     if (Optional.IsDefined(Status))
     {
         writer.WritePropertyName("status");
         writer.WriteStringValue(Status.Value.ToString());
     }
     if (Optional.IsDefined(ProgressMetrics))
     {
         writer.WritePropertyName("progressMetrics");
         writer.WriteObjectValue(ProgressMetrics);
     }
     if (Optional.IsCollectionDefined(StatusMessages))
     {
         writer.WritePropertyName("statusMessages");
         writer.WriteStartArray();
         foreach (var item in StatusMessages)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(CreatedTimeUtc))
     {
         writer.WritePropertyName("createdTimeUtc");
         writer.WriteStringValue(CreatedTimeUtc.Value, "O");
     }
     writer.WritePropertyName("jobType");
     writer.WriteStringValue(JobType.ToString());
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Tags))
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WriteEndObject();
 }
示例#4
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Status))
     {
         writer.WritePropertyName("status");
         writer.WriteStringValue(Status.Value.ToString());
     }
     writer.WritePropertyName("parameterSamplingConfiguration");
     writer.WriteObjectValue(ParameterSamplingConfiguration);
     if (Optional.IsDefined(TerminationConfiguration))
     {
         writer.WritePropertyName("terminationConfiguration");
         writer.WriteObjectValue(TerminationConfiguration);
     }
     writer.WritePropertyName("evaluationConfiguration");
     writer.WriteObjectValue(EvaluationConfiguration);
     if (Optional.IsDefined(TrialComponent))
     {
         writer.WritePropertyName("trialComponent");
         writer.WriteObjectValue(TrialComponent);
     }
     if (Optional.IsDefined(ExperimentName))
     {
         writer.WritePropertyName("experimentName");
         writer.WriteStringValue(ExperimentName);
     }
     writer.WritePropertyName("computeBinding");
     writer.WriteObjectValue(ComputeBinding);
     if (Optional.IsDefined(Output))
     {
         writer.WritePropertyName("output");
         writer.WriteObjectValue(Output);
     }
     writer.WritePropertyName("jobType");
     writer.WriteStringValue(JobType.ToString());
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Tags))
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Status))
     {
         writer.WritePropertyName("status");
         writer.WriteStringValue(Status.Value.ToString());
     }
     if (Optional.IsDefined(MaxRunDurationSeconds))
     {
         writer.WritePropertyName("maxRunDurationSeconds");
         writer.WriteNumberValue(MaxRunDurationSeconds.Value);
     }
     writer.WritePropertyName("codeConfiguration");
     writer.WriteObjectValue(CodeConfiguration);
     if (Optional.IsDefined(EnvironmentId))
     {
         writer.WritePropertyName("environmentId");
         writer.WriteStringValue(EnvironmentId);
     }
     if (Optional.IsCollectionDefined(DataBindings))
     {
         writer.WritePropertyName("dataBindings");
         writer.WriteStartObject();
         foreach (var item in DataBindings)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsDefined(DistributionConfiguration))
     {
         writer.WritePropertyName("distributionConfiguration");
         writer.WriteObjectValue(DistributionConfiguration);
     }
     if (Optional.IsDefined(ExperimentName))
     {
         writer.WritePropertyName("experimentName");
         writer.WriteStringValue(ExperimentName);
     }
     writer.WritePropertyName("computeBinding");
     writer.WriteObjectValue(ComputeBinding);
     if (Optional.IsDefined(Output))
     {
         writer.WritePropertyName("output");
         writer.WriteObjectValue(Output);
     }
     writer.WritePropertyName("jobType");
     writer.WriteStringValue(JobType.ToString());
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Tags))
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         writer.WritePropertyName("properties");
         writer.WriteStartObject();
         foreach (var item in Properties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WriteEndObject();
 }