2016-05-16 20:09:50 +02:00
|
|
|
"""
|
|
|
|
.. module: lemur.domains.schemas
|
|
|
|
:platform: unix
|
2018-05-29 19:18:16 +02:00
|
|
|
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
|
2016-05-16 20:09:50 +02:00
|
|
|
:license: Apache, see LICENSE for more details.
|
|
|
|
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
|
|
|
|
"""
|
|
|
|
from marshmallow import fields
|
|
|
|
from lemur.common.schema import LemurInputSchema, LemurOutputSchema
|
|
|
|
from lemur.schemas import AssociatedCertificateSchema
|
|
|
|
|
2016-05-23 20:28:25 +02:00
|
|
|
# from lemur.certificates.schemas import CertificateNestedOutputSchema
|
2016-05-16 20:09:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
class DomainInputSchema(LemurInputSchema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String(required=True)
|
2017-05-16 04:07:16 +02:00
|
|
|
sensitive = fields.Boolean(missing=False)
|
2016-05-16 20:09:50 +02:00
|
|
|
certificates = fields.Nested(AssociatedCertificateSchema, many=True, missing=[])
|
|
|
|
|
|
|
|
|
|
|
|
class DomainOutputSchema(LemurOutputSchema):
|
|
|
|
id = fields.Integer()
|
|
|
|
name = fields.String()
|
|
|
|
sensitive = fields.Boolean()
|
2016-05-23 20:28:25 +02:00
|
|
|
# certificates = fields.Nested(CertificateNestedOutputSchema, many=True, missing=[])
|
2016-05-16 20:09:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
class DomainNestedOutputSchema(DomainOutputSchema):
|
|
|
|
__envelope__ = False
|
|
|
|
|
|
|
|
|
|
|
|
domain_input_schema = DomainInputSchema()
|
|
|
|
domain_output_schema = DomainOutputSchema()
|
|
|
|
domains_output_schema = DomainOutputSchema(many=True)
|