140e9b92eSEd Tanous // SPDX-License-Identifier: Apache-2.0 240e9b92eSEd Tanous // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3853c0dc5SEd Tanous #pragma once 4853c0dc5SEd Tanous #include <nlohmann/json.hpp> 5853c0dc5SEd Tanous 6853c0dc5SEd Tanous namespace job 7853c0dc5SEd Tanous { 8853c0dc5SEd Tanous // clang-format off 9853c0dc5SEd Tanous 10853c0dc5SEd Tanous enum class JobState{ 11853c0dc5SEd Tanous New, 12853c0dc5SEd Tanous Starting, 13853c0dc5SEd Tanous Running, 14853c0dc5SEd Tanous Suspended, 15853c0dc5SEd Tanous Interrupted, 16853c0dc5SEd Tanous Pending, 17853c0dc5SEd Tanous Stopping, 18853c0dc5SEd Tanous Completed, 19853c0dc5SEd Tanous Cancelled, 20853c0dc5SEd Tanous Exception, 21853c0dc5SEd Tanous Service, 22853c0dc5SEd Tanous UserIntervention, 23853c0dc5SEd Tanous Continue, 24*c6d7a45dSGunnar Mills Validating, 25*c6d7a45dSGunnar Mills Invalid, 26*c6d7a45dSGunnar Mills }; 27*c6d7a45dSGunnar Mills 28*c6d7a45dSGunnar Mills enum class JobType{ 29*c6d7a45dSGunnar Mills Invalid, 30*c6d7a45dSGunnar Mills DocumentBased, 31*c6d7a45dSGunnar Mills UserSpecified, 32*c6d7a45dSGunnar Mills ServiceGenerated, 33853c0dc5SEd Tanous }; 34853c0dc5SEd Tanous 35853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(JobState, { 36853c0dc5SEd Tanous {JobState::New, "New"}, 37853c0dc5SEd Tanous {JobState::Starting, "Starting"}, 38853c0dc5SEd Tanous {JobState::Running, "Running"}, 39853c0dc5SEd Tanous {JobState::Suspended, "Suspended"}, 40853c0dc5SEd Tanous {JobState::Interrupted, "Interrupted"}, 41853c0dc5SEd Tanous {JobState::Pending, "Pending"}, 42853c0dc5SEd Tanous {JobState::Stopping, "Stopping"}, 43853c0dc5SEd Tanous {JobState::Completed, "Completed"}, 44853c0dc5SEd Tanous {JobState::Cancelled, "Cancelled"}, 45853c0dc5SEd Tanous {JobState::Exception, "Exception"}, 46853c0dc5SEd Tanous {JobState::Service, "Service"}, 47853c0dc5SEd Tanous {JobState::UserIntervention, "UserIntervention"}, 48853c0dc5SEd Tanous {JobState::Continue, "Continue"}, 49*c6d7a45dSGunnar Mills {JobState::Validating, "Validating"}, 50*c6d7a45dSGunnar Mills {JobState::Invalid, "Invalid"}, 51*c6d7a45dSGunnar Mills }); 52*c6d7a45dSGunnar Mills 53*c6d7a45dSGunnar Mills NLOHMANN_JSON_SERIALIZE_ENUM(JobType, { 54*c6d7a45dSGunnar Mills {JobType::Invalid, "Invalid"}, 55*c6d7a45dSGunnar Mills {JobType::DocumentBased, "DocumentBased"}, 56*c6d7a45dSGunnar Mills {JobType::UserSpecified, "UserSpecified"}, 57*c6d7a45dSGunnar Mills {JobType::ServiceGenerated, "ServiceGenerated"}, 58853c0dc5SEd Tanous }); 59853c0dc5SEd Tanous 60853c0dc5SEd Tanous } 61853c0dc5SEd Tanous // clang-format on 62