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()
|
|
|
|
|
|
|
|
|
2021-12-03 14:12:11 +00:00
|
|
|
class AccountSummarySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String()
|
|
|
|
domains = fields.Embed(schema=DomainSchema, many=True)
|
|
|
|
|
|
|
|
class ApiKeySummarySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
description = fields.String()
|
|
|
|
|
|
|
|
|
2019-03-01 22:49:31 +00:00
|
|
|
class ApiKeySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
role = fields.Embed(schema=RoleSchema)
|
|
|
|
domains = fields.Embed(schema=DomainSchema, many=True)
|
2021-12-03 14:12:11 +00:00
|
|
|
accounts = fields.Embed(schema=AccountSummarySchema, many=True)
|
2019-03-01 22:49:31 +00:00
|
|
|
description = fields.String()
|
|
|
|
key = fields.String()
|
|
|
|
|
|
|
|
|
|
|
|
class ApiPlainKeySchema(Schema):
|
|
|
|
id = fields.Integer()
|
|
|
|
role = fields.Embed(schema=RoleSchema)
|
|
|
|
domains = fields.Embed(schema=DomainSchema, many=True)
|
2021-12-03 14:12:11 +00:00
|
|
|
accounts = fields.Embed(schema=AccountSummarySchema, many=True)
|
2019-03-01 22:49:31 +00:00
|
|
|
description = fields.String()
|
|
|
|
plain_key = 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)
|
2021-10-30 19:28:36 +00:00
|
|
|
accounts = fields.Embed(schema=AccountSummarySchema, many=True)
|
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)
|
2021-12-03 14:12:11 +00:00
|
|
|
apikeys = fields.Embed(schema=ApiKeySummarySchema, many=True)
|