class BIAggregationPackSchema(Schema): id = ReqString(default="", example="bi_pack1") title = ReqString(default="", example="BI Title") comment = String( description= "An optional comment that may be used to explain the purpose of this object.", allow_none=True, example="Rule comment", ) contact_groups = ReqList(fields.String(), default=[], example=["contactgroup_a", "contactgroup_b"]) public = ReqBoolean(default=False) rules = ReqList(fields.Nested(BIRuleSchema()), default=[]) aggregations = ReqList(fields.Nested(BIAggregationSchema()), default=[]) @pre_dump def pre_dumper(self, obj: BIAggregationPack, many=False) -> Dict: # Convert aggregations and rules to list return { "id": obj.id, "title": obj.title, "comment": obj.comment, "contact_groups": obj.contact_groups, "public": obj.public, "rules": obj.get_rules().values(), "aggregations": obj.get_aggregations().values(), }
class BIPackEndpointSchema(Schema): title = ReqString( dump_default="", example="BI Title", description="The title of the BI pack.", ) contact_groups = ReqList( fields.String(), dump_default=[], example=["contact", "contactgroup_b"], description="A list of contact group identifiers.", ) public = ReqBoolean( dump_default=False, example="false", description="Should the BI pack be public or not.", )
class BIPackEndpointSchema(Schema): title = ReqString( dump_default="", example="BI Title", description="TODO: Hier muß Andreas noch etwas reinschreiben!", ) contact_groups = ReqList( fields.String(), dump_default=[], example=["contact", "contactgroup_b"], description="TODO: Hier muß Andreas noch etwas reinschreiben!", ) public = ReqBoolean( dump_default=False, example="false", description="TODO: Hier muß Andreas noch etwas reinschreiben!", )
class BIAggregationPackSchema(Schema): id = ReqString(default="", example="bi_pack1") title = ReqString(default="", example="BI Title") contact_groups = ReqList(fields.String(), default=[], example=["contactgroup_a", "contactgroup_b"]) public = ReqBoolean(default=False) rules = ReqList(fields.Nested(BIRuleSchema()), default=[]) aggregations = ReqList(fields.Nested(BIAggregationSchema()), default=[]) @pre_dump def pre_dumper(self, obj: BIAggregationPack, many=False) -> Dict: # Convert aggregations and rules to list return { "id": obj.id, "title": obj.title, "contact_groups": obj.contact_groups, "public": obj.public, "rules": obj.get_rules().values(), "aggregations": obj.get_aggregations().values(), }
class BIAggregationVisualizationSchema(Schema): ignore_rule_styles = ReqBoolean(default=False, example=False) layout_id = ReqString(default="builtin_default", example="radial_layout2") line_style = ReqString(default="round", example="round")
class BIRuleComputationOptionsSchema(Schema): disabled = ReqBoolean(dump_default=False, example=False)
class BIPackEndpointSchema(Schema): title = ReqString(default="", example="BI Title") contact_groups = ReqList(fields.String(), default=[], example=["contact", "contactgroup_b"]) public = ReqBoolean(default=False, example="false")