1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace job 7 { 8 // clang-format off 9 10 enum class JobState{ 11 New, 12 Starting, 13 Running, 14 Suspended, 15 Interrupted, 16 Pending, 17 Stopping, 18 Completed, 19 Cancelled, 20 Exception, 21 Service, 22 UserIntervention, 23 Continue, 24 Validating, 25 Invalid, 26 }; 27 28 enum class JobType{ 29 Invalid, 30 DocumentBased, 31 UserSpecified, 32 ServiceGenerated, 33 }; 34 35 NLOHMANN_JSON_SERIALIZE_ENUM(JobState, { 36 {JobState::New, "New"}, 37 {JobState::Starting, "Starting"}, 38 {JobState::Running, "Running"}, 39 {JobState::Suspended, "Suspended"}, 40 {JobState::Interrupted, "Interrupted"}, 41 {JobState::Pending, "Pending"}, 42 {JobState::Stopping, "Stopping"}, 43 {JobState::Completed, "Completed"}, 44 {JobState::Cancelled, "Cancelled"}, 45 {JobState::Exception, "Exception"}, 46 {JobState::Service, "Service"}, 47 {JobState::UserIntervention, "UserIntervention"}, 48 {JobState::Continue, "Continue"}, 49 {JobState::Validating, "Validating"}, 50 {JobState::Invalid, "Invalid"}, 51 }); 52 53 NLOHMANN_JSON_SERIALIZE_ENUM(JobType, { 54 {JobType::Invalid, "Invalid"}, 55 {JobType::DocumentBased, "DocumentBased"}, 56 {JobType::UserSpecified, "UserSpecified"}, 57 {JobType::ServiceGenerated, "ServiceGenerated"}, 58 }); 59 60 } 61 // clang-format on 62