I want to get all the spaces in my kibana using python API

I am trying to write a python script to get all the spaces in my Kibana spaces I tried all the different combos but there seems to be no proper way for it.
Here are the few examples that i tired
resp = client.api.spaces()

resp = client.spaces.space()

any help would be appreciated