def METHOD_NAME(self, value):
    if self.cloud_mode:
        # GXCloudStoreBackend expects a json str
        config_schema = value.get_schema_class()()
        return config_schema.dump(value)
    return value.to_yaml_str()