'Parameter definition corresponding to property for hot template.'

@staticmethod
def _hot_param_def_from_prop(schema):

    param_type_map = {schema.INTEGER: hot_param.HOTParamSchema.NUMBER, schema.STRING: hot_param.HOTParamSchema.STRING, schema.NUMBER: hot_param.HOTParamSchema.NUMBER, schema.BOOLEAN: hot_param.HOTParamSchema.BOOLEAN, schema.MAP: hot_param.HOTParamSchema.MAP, schema.LIST: hot_param.HOTParamSchema.LIST}
    def param_items():
        (yield (hot_param.HOTParamSchema.TYPE, param_type_map[schema.type]))
        if (schema.description is not None):
            (yield (hot_param.HOTParamSchema.DESCRIPTION, schema.description))
        if (schema.default is not None):
            (yield (hot_param.HOTParamSchema.DEFAULT, schema.default))
        def constraint_items(constraint):
            def range_min_max(constraint):
                if (constraint.min is not None):
                    (yield (hot_param.MIN, constraint.min))
                if (constraint.max is not None):
                    (yield (hot_param.MAX, constraint.max))
            if isinstance(constraint, constr.Length):
                (yield (hot_param.LENGTH, dict(range_min_max(constraint))))
            elif isinstance(constraint, constr.Range):
                (yield (hot_param.RANGE, dict(range_min_max(constraint))))
            elif isinstance(constraint, constr.AllowedValues):
                (yield (hot_param.ALLOWED_VALUES, list(constraint.allowed)))
            elif isinstance(constraint, constr.AllowedPattern):
                (yield (hot_param.ALLOWED_PATTERN, constraint.pattern))
        if schema.constraints:
            (yield (hot_param.HOTParamSchema.CONSTRAINTS, [dict(constraint_items(constraint)) for constraint in schema.constraints]))
    return dict(param_items())
