requestBuild is a classic case of a named operation, but there's no reason to publish the others as named operations.
They don't change the dataset and they don't take any arguments. Let's publish them as scoped collections and keep our public API cleaner:
recipes
builds
completed_builds
pending_builds
And a link:
last_build
To do this, define fields by these names in the interfaces, and implement them with @property method definitions that invoke the method behind the scenes.
Or, if possible, get rid of getRecipes() altogether, and just implement .recipes for both the internal and external APIs. So 'recipes' would contain the getRecipes() implementation instead of invoking getRecipes().
requestBuild is a classic case of a named operation, but there's no reason to publish the others as named operations.
They don't change the dataset and they don't take any arguments. Let's publish them as scoped collections and keep our public API cleaner:
recipes
builds
completed_builds
pending_builds
And a link:
last_build
To do this, define fields by these names in the interfaces, and implement them with @property method definitions that invoke the method behind the scenes.
@property
def recipes(self):
return self.getRecipes()
Or, if possible, get rid of getRecipes() altogether, and just implement .recipes for both the internal and external APIs. So 'recipes' would contain the getRecipes() implementation instead of invoking getRecipes().