2019-03-01 22:49:31 +00:00
|
|
|
from lima import fields, Schema
|
|
|
|
|
|
|
|
|
|
|
|
class DomainSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String()
|
|
|
|
|
|
|
|
|
|
|
|
class RoleSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String()
|
|
|
|
|
|
|
|
|
|
|
|
class ApiKeySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
role = fields.Embed(schema=RoleSchema)
|
|
|
|
domains = fields.Embed(schema=DomainSchema, many=True)
|
|
|
|
description = fields.String()
|
|
|
|
key = fields.String()
|
|
|
|
|
|
|
|
|
|
|
|
class ApiPlainKeySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
role = fields.Embed(schema=RoleSchema)
|
|
|
|
domains = fields.Embed(schema=DomainSchema, many=True)
|
|
|
|
description = fields.String()
|
|
|
|
plain_key = fields.String()
|
2020-01-27 12:38:38 +00:00
|
|
|
|
|
|
|
|
2021-03-16 18:39:53 +00:00
|
|
|
class AccountSummarySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String()
|
|
|
|
|
|
|
|
|
2020-01-27 12:38:38 +00:00
|
|
|
class UserSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
username = fields.String()
|
|
|
|
firstname = fields.String()
|
|
|
|
lastname = fields.String()
|
|
|
|
email = fields.String()
|
|
|
|
role = fields.Embed(schema=RoleSchema)
|
|
|
|
|
2021-03-16 18:39:53 +00:00
|
|
|
class UserDetailedSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
username = fields.String()
|
|
|
|
firstname = fields.String()
|
|
|
|
lastname = fields.String()
|
|
|
|
email = fields.String()
|
|
|
|
role = fields.Embed(schema=RoleSchema)
|
|
|
|
accounts = fields.Embed(schema=AccountSummarySchema)
|
2020-01-27 12:38:38 +00:00
|
|
|
|
|
|
|
class AccountSchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String()
|
|
|
|
description = fields.String()
|
|
|
|
contact = fields.String()
|
|
|
|
mail = fields.String()
|
|
|
|
domains = fields.Embed(schema=DomainSchema, many=True)
|