예제 #1
0
 internal SparkBatchJobState(DateTimeOffset?notStartedAt, DateTimeOffset?startingAt, DateTimeOffset?runningAt, DateTimeOffset?deadAt, DateTimeOffset?successAt, DateTimeOffset?terminatedAt, DateTimeOffset?recoveringAt, string currentState, SparkRequest jobCreationRequest)
 {
     NotStartedAt       = notStartedAt;
     StartingAt         = startingAt;
     RunningAt          = runningAt;
     DeadAt             = deadAt;
     SuccessAt          = successAt;
     TerminatedAt       = terminatedAt;
     RecoveringAt       = recoveringAt;
     CurrentState       = currentState;
     JobCreationRequest = jobCreationRequest;
 }
예제 #2
0
 internal SparkSessionState(DateTimeOffset?notStartedAt, DateTimeOffset?startingAt, DateTimeOffset?idleAt, DateTimeOffset?deadAt, DateTimeOffset?shuttingDownAt, DateTimeOffset?terminatedAt, DateTimeOffset?recoveringAt, DateTimeOffset?busyAt, DateTimeOffset?errorAt, string currentState, SparkRequest jobCreationRequest)
 {
     NotStartedAt       = notStartedAt;
     StartingAt         = startingAt;
     IdleAt             = idleAt;
     DeadAt             = deadAt;
     ShuttingDownAt     = shuttingDownAt;
     TerminatedAt       = terminatedAt;
     RecoveringAt       = recoveringAt;
     BusyAt             = busyAt;
     ErrorAt            = errorAt;
     CurrentState       = currentState;
     JobCreationRequest = jobCreationRequest;
 }
예제 #3
0
 public static SparkBatchJobState SparkBatchJobState(DateTimeOffset?notStartedAt = null, DateTimeOffset?startingAt = null, DateTimeOffset?runningAt = null, DateTimeOffset?deadAt = null, DateTimeOffset?successAt = null, DateTimeOffset?terminatedAt = null, DateTimeOffset?recoveringAt = null, string currentState = null, SparkRequest jobCreationRequest = null)
 {
     return(new SparkBatchJobState(notStartedAt, startingAt, runningAt, deadAt, successAt, terminatedAt, recoveringAt, currentState, jobCreationRequest));
 }
예제 #4
0
 public static SparkSessionState SparkSessionState(DateTimeOffset?notStartedAt = null, DateTimeOffset?startingAt = null, DateTimeOffset?idleAt = null, DateTimeOffset?deadAt = null, DateTimeOffset?shuttingDownAt = null, DateTimeOffset?terminatedAt = null, DateTimeOffset?recoveringAt = null, DateTimeOffset?busyAt = null, DateTimeOffset?errorAt = null, string currentState = null, SparkRequest jobCreationRequest = null)
 {
     return(new SparkSessionState(notStartedAt, startingAt, idleAt, deadAt, shuttingDownAt, terminatedAt, recoveringAt, busyAt, errorAt, currentState, jobCreationRequest));
 }
 internal static SparkSessionState DeserializeSparkSessionState(JsonElement element)
 {
     DateTimeOffset? notStartedAt = default;
     DateTimeOffset? startingAt = default;
     DateTimeOffset? idleAt = default;
     DateTimeOffset? deadAt = default;
     DateTimeOffset? shuttingDownAt = default;
     DateTimeOffset? killedAt = default;
     DateTimeOffset? recoveringAt = default;
     DateTimeOffset? busyAt = default;
     DateTimeOffset? errorAt = default;
     string currentState = default;
     SparkRequest jobCreationRequest = default;
     foreach (var property in element.EnumerateObject())
     {
         if (property.NameEquals("notStartedAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             notStartedAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("startingAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             startingAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("idleAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             idleAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("deadAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             deadAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("shuttingDownAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             shuttingDownAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("killedAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             killedAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("recoveringAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             recoveringAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("busyAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             busyAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("errorAt"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             errorAt = property.Value.GetDateTimeOffset("O");
             continue;
         }
         if (property.NameEquals("currentState"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             currentState = property.Value.GetString();
             continue;
         }
         if (property.NameEquals("jobCreationRequest"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 continue;
             }
             jobCreationRequest = SparkRequest.DeserializeSparkRequest(property.Value);
             continue;
         }
     }
     return new SparkSessionState(notStartedAt, startingAt, idleAt, deadAt, shuttingDownAt, killedAt, recoveringAt, busyAt, errorAt, currentState, jobCreationRequest);
 }
        internal static SparkBatchJobState DeserializeSparkBatchJobState(JsonElement element)
        {
            Optional <DateTimeOffset> notStartedAt       = default;
            Optional <DateTimeOffset> startingAt         = default;
            Optional <DateTimeOffset> runningAt          = default;
            Optional <DateTimeOffset> deadAt             = default;
            Optional <DateTimeOffset> successAt          = default;
            Optional <DateTimeOffset> killedAt           = default;
            Optional <DateTimeOffset> recoveringAt       = default;
            Optional <string>         currentState       = default;
            Optional <SparkRequest>   jobCreationRequest = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("notStartedAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    notStartedAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("startingAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    startingAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("runningAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    runningAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("deadAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deadAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("successAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    successAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("killedAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    killedAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("recoveringAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recoveringAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("currentState"))
                {
                    currentState = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("jobCreationRequest"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    jobCreationRequest = SparkRequest.DeserializeSparkRequest(property.Value);
                    continue;
                }
            }
            return(new SparkBatchJobState(Optional.ToNullable(notStartedAt), Optional.ToNullable(startingAt), Optional.ToNullable(runningAt), Optional.ToNullable(deadAt), Optional.ToNullable(successAt), Optional.ToNullable(killedAt), Optional.ToNullable(recoveringAt), currentState.Value, jobCreationRequest.Value));
        }
예제 #7
0
        internal static SparkSessionState DeserializeSparkSessionState(JsonElement element)
        {
            Optional <DateTimeOffset?> notStartedAt       = default;
            Optional <DateTimeOffset?> startingAt         = default;
            Optional <DateTimeOffset?> idleAt             = default;
            Optional <DateTimeOffset?> deadAt             = default;
            Optional <DateTimeOffset?> shuttingDownAt     = default;
            Optional <DateTimeOffset?> killedAt           = default;
            Optional <DateTimeOffset?> recoveringAt       = default;
            Optional <DateTimeOffset?> busyAt             = default;
            Optional <DateTimeOffset?> errorAt            = default;
            Optional <string>          currentState       = default;
            Optional <SparkRequest>    jobCreationRequest = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("notStartedAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        notStartedAt = null;
                        continue;
                    }
                    notStartedAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("startingAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        startingAt = null;
                        continue;
                    }
                    startingAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("idleAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        idleAt = null;
                        continue;
                    }
                    idleAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("deadAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        deadAt = null;
                        continue;
                    }
                    deadAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("shuttingDownAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        shuttingDownAt = null;
                        continue;
                    }
                    shuttingDownAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("killedAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        killedAt = null;
                        continue;
                    }
                    killedAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("recoveringAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        recoveringAt = null;
                        continue;
                    }
                    recoveringAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("busyAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        busyAt = null;
                        continue;
                    }
                    busyAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("errorAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        errorAt = null;
                        continue;
                    }
                    errorAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("currentState"))
                {
                    currentState = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("jobCreationRequest"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    jobCreationRequest = SparkRequest.DeserializeSparkRequest(property.Value);
                    continue;
                }
            }
            return(new SparkSessionState(Optional.ToNullable(notStartedAt), Optional.ToNullable(startingAt), Optional.ToNullable(idleAt), Optional.ToNullable(deadAt), Optional.ToNullable(shuttingDownAt), Optional.ToNullable(killedAt), Optional.ToNullable(recoveringAt), Optional.ToNullable(busyAt), Optional.ToNullable(errorAt), currentState.Value, jobCreationRequest.Value));
        }
        internal static SparkBatchJobState DeserializeSparkBatchJobState(JsonElement element)
        {
            DateTimeOffset?notStartedAt       = default;
            DateTimeOffset?startingAt         = default;
            DateTimeOffset?runningAt          = default;
            DateTimeOffset?deadAt             = default;
            DateTimeOffset?successAt          = default;
            DateTimeOffset?killedAt           = default;
            DateTimeOffset?recoveringAt       = default;
            string         currentState       = default;
            SparkRequest   jobCreationRequest = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("notStartedAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    notStartedAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("startingAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    startingAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("runningAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    runningAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("deadAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    deadAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("successAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    successAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("killedAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    killedAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("recoveringAt"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    recoveringAt = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("currentState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    currentState = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("jobCreationRequest"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    jobCreationRequest = SparkRequest.DeserializeSparkRequest(property.Value);
                    continue;
                }
            }
            return(new SparkBatchJobState(notStartedAt, startingAt, runningAt, deadAt, successAt, killedAt, recoveringAt, currentState, jobCreationRequest));
        }