コード例 #1
0
 internal JobStepData(ResourceIdentifier id, string name, ResourceType type, int?stepId, string targetGroup, string credential, JobStepAction action, JobStepOutput output, JobStepExecutionOptions executionOptions) : base(id, name, type)
 {
     StepId           = stepId;
     TargetGroup      = targetGroup;
     Credential       = credential;
     Action           = action;
     Output           = output;
     ExecutionOptions = executionOptions;
 }
コード例 #2
0
        internal static JobStepData DeserializeJobStepData(JsonElement element)
        {
            ResourceIdentifier                 id               = default;
            string                             name             = default;
            ResourceType                       type             = default;
            SystemData                         systemData       = default;
            Optional <int>                     stepId           = default;
            Optional <string>                  targetGroup      = default;
            Optional <string>                  credential       = default;
            Optional <JobStepAction>           action           = default;
            Optional <JobStepOutput>           output           = default;
            Optional <JobStepExecutionOptions> executionOptions = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("stepId"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            stepId = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("targetGroup"))
                        {
                            targetGroup = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("credential"))
                        {
                            credential = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("action"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            action = JobStepAction.DeserializeJobStepAction(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("output"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            output = JobStepOutput.DeserializeJobStepOutput(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("executionOptions"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            executionOptions = JobStepExecutionOptions.DeserializeJobStepExecutionOptions(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new JobStepData(id, name, type, systemData, Optional.ToNullable(stepId), targetGroup.Value, credential.Value, action.Value, output.Value, executionOptions.Value));
        }