Improve swig'ing of cloud providers to allow casting

[#54814872]