def entity_phrase(param: Param): # value = self.param_sampler.sample(param, 1) # value = value[0] if value else "---" name = ParamUtils.human_readable_name(param) # todo : shorten when value is too lengthy # todo : not using = when it is possible (verb, boolean) return "{} being << {} >>".format(name, str(param.name))
def append_parameters(text, resources): for r in resources: if r.resource_type in [ ATTRIBUTE_RESOURCE, COUNT_RESOURCE, SEARCH_RESOURCE, FILE_EXTENSION_RESOURCE, AUTH_RESOURCE, SWAGGER_RESOURCE, FILTER_RESOURCE, ALL_RESOURCE, VERSION_RESOURCE, BASE_VERB_RESOURCE, BASE_NOUN_RESOURCE ]: continue param = r.param if param and param.name: if "<< " + param.name + " >>" in text: continue else: text += " by {} being << {} >>".format( ParamUtils.human_readable_name(param), param.name) return text