def _make_types(schema):
    """Make values allowed by schame accessable as a class attributes
    >>> s = {'a': {'allowed': ['yes', 'no'], 'required': True}}
    >>> c = _make_types(s)
    >>> c.a.YES == 'yes'
    >>> True

    Or with result class

    >>> r = SomeResult(dict(success=True, op='updated', step='save'))
    >>> r.types.op.UPDATED == r.op
    >>> True
    """
    if not isinstance(schema, dict):
        raise AttributeError('`schema` should be an instance of dict')

    cls_dict = {}
    for s_key, s_val in schema.items():
        if s_val.get('required', False) is True and 'allowed' in s_val:
            allowed = {str(x).upper(): x for x in s_val['allowed']}
            cls_dict[s_key] = type(s_key, (object, ), allowed)
    return type('ResultTypes', (object, ), cls_dict)