How to programmatically check optimisation status in JuMP >= 0.19

Which is the equivalent of status=solve(model); if status == :Optimal in JuMP >= 0.19 ?

optimize!(model); if termination_status(model) == ????

got it:

termination_status(model) == MOI.OPTIMAL

a bit more complicated :wink:

Here are the relevant docs: http://www.juliaopt.org/JuMP.jl/v0.19.2/solutions/#Obtaining-solutions-1