"""Schema for a Resource.""" from marshmallow import fields from marshmallow.validate import OneOf from permissions.constants import constants from permissions.validations import ma class ResourceSchema(ma.Schema): """Schema for a Resource. Properties: - resource_type (str): Type of resource. (e.g: 'Vendor', 'ArtistInfo', Subaccount') - resource_id (int): Identifier for that resource. - name (str): Name of that resource. """ resource_type = fields.Str(validate=OneOf(constants.RESOURCE_TYPES)) resource_id = fields.Int(required=True) name = fields.Str(required=False)