Exemple #1
0
        abort(404, message=u"No such person with entity_id={}".format(id))
    return pe


PersonAffiliation = api.model('PersonAffiliation', {
    'affiliation': fields.Constant(
        ctype='PersonAffiliation',
        description='Affiliation type'),
    'status': fields.Constant(
        ctype='PersonAffStatus',
        description='Affiliation status'),
    'ou': fields.base.Nested(
        models.OU,
        description='Organizational unit'),
    'create_date': fields.DateTime(
        dt_format='iso8601',
        description='Creation date'),
    'last_date': fields.DateTime(
        dt_format='iso8601',
        description='Last seen in source system'),
    'deleted_date': fields.DateTime(
        dt_format='iso8601',
        description='Deletion date'),
    'source_system': fields.Constant(
        ctype='AuthoritativeSystem',
        description='Source system'),
})

PersonName = api.model('PersonName', {
    'source_system': fields.Constant(
        ctype='AuthoritativeSystem',
Exemple #2
0
        return cls._rev_map.keys()


_group_fields = {
    'id':
    base_fields.Integer(description='group id'),
    'name':
    base_fields.String(description='group name'),
    'visibility':
    crb_fields.Constant(ctype='GroupVisibility',
                        transform=GroupVisibility.serialize,
                        description='group visibility'),
    'description':
    base_fields.String(description='group description'),
    'created_at':
    crb_fields.DateTime(dt_format='iso8601', description='creation timestamp'),
    'expire_date':
    crb_fields.DateTime(dt_format='iso8601', description='expire date'),
}

Group = api.model(
    'Group', {
        'href':
        crb_fields.href('.group'),
        'id':
        _group_fields['id'],
        'name':
        _group_fields['name'],
        'visibility':
        _group_fields['visibility'],
        'description':
Exemple #3
0
        fields.base.String(attribute='contact_alias', description='Alias'),
        'preference':
        fields.base.Integer(attribute='contact_pref',
                            description='Preference/priority, 1 = highest'),
        'type':
        fields.Constant(
            ctype='ContactInfo', attribute='contact_type', description='Type'),
        'entity_id':
        fields.base.Integer(description='Entity ID'),
        'description':
        fields.base.String(description='Description'),
        'source_system':
        fields.Constant(ctype='AuthoritativeSystem',
                        description='Source system'),
        'last_modified':
        fields.DateTime(dt_format='iso8601',
                        description='Last modified timestamp'),
    })

EntityContactInfoList = api.model(
    'EntityContactInfoList', {
        'contacts':
        fields.base.List(fields.base.Nested(EntityContactInfo),
                         description='Contact information'),
    })

EntityOwner = api.model(
    'EntityOwner', {
        'id': fields.base.Integer(default=None, description='Entity ID'),
        'type': fields.Constant(ctype='EntityType', description='Entity type'),
        'href': fields.base.String(description='URL to resource'),
        'name': fields.base.String(description='Name'),
Exemple #4
0
            AccountAffiliation),
        description='Account affiliations'),
})

Account = api.model('Account', {
    'href': fields.href('.account'),
    'name': fields.base.String(
        description='Account name'),
    'id': fields.base.Integer(
        default=None,
        description='Entity ID'),
    'owner': fields.base.Nested(
        models.EntityOwner,
        description='Entity owner'),
    'created_at': fields.DateTime(
        dt_format='iso8601',
        description='Account creation timestamp'),
    'expire_date': fields.DateTime(
        dt_format='iso8601',
        description='Expiration date'),
    'contexts': fields.base.List(
        fields.Constant(ctype='Spread'),
        description='Visible in these contexts'),
    'primary_email': fields.base.String(
        description='Primary email address'),
    'active': fields.base.Boolean(
        description='Is this account active, i.e. not deleted or expired?'),
})

PosixAccount = api.model('PosixAccount', {
    'href': fields.href('.posixaccount'),
Exemple #5
0
        abort(404, message=u"No such person with entity_id={}".format(id))
    return pe


PersonAffiliation = api.model(
    'PersonAffiliation', {
        'affiliation':
        fields.Constant(ctype='PersonAffiliation',
                        description='Affiliation type'),
        'status':
        fields.Constant(ctype='PersonAffStatus',
                        description='Affiliation status'),
        'ou':
        fields.base.Nested(models.OU, description='Organizational unit'),
        'create_date':
        fields.DateTime(dt_format='iso8601', description='Creation date'),
        'last_date':
        fields.DateTime(dt_format='iso8601',
                        description='Last seen in source system'),
        'deleted_date':
        fields.DateTime(dt_format='iso8601', description='Deletion date'),
        'source_system':
        fields.Constant(ctype='AuthoritativeSystem',
                        description='Source system'),
    })

PersonName = api.model(
    'PersonName', {
        'source_system':
        fields.Constant(ctype='AuthoritativeSystem',
                        description='Source system'),