import uuid
import datetime as dt
from marshmallow import Schema, fields, post_load, post_dump
from vrpmdvcreatemoncmd import VRPMDV_CreateMonCmd




# class VRPMDV_CreateMonSchema(Schema):
#         cmdid = fields.Integer()
#         id = fields.UUID()
#         samplerate = fields.Integer()
#         sampleperiod = fields.Integer()
#         downtime = fields.Integer()
#         status = fields.String() 
        
#         #monstate = fields.Enum(VRPMDVMonitoringState)

#         # def get_envelope_key(self, many):
#         #     """Helper to get the envelope key."""
#         #     key = self.__envelope__["many"] if many else self.__envelope__["single"]
#         #     assert key is not None, "Envelope key undefined"
#         #     return key
        
#         # @post_dump(pass_many=True)
#         # def wrap_with_envelope(self, data, many, **kwargs):           
#         #     key = self.get_envelope_key(many)
#         #     return {key: data}              

#         @post_load
#         def make_vrpmdv_Monitoring(self, data, **kwargs):
#             mon = VRPMDV_Monitoring(**data)
#             return mon

              

class VRPMDV_CreateMonSchema(Schema):
        cmdid = fields.Integer()
        samplerate = fields.Integer()
        sampleperiod = fields.Integer()
        downtime = fields.Integer()
       
        @post_load
        def make_vrpmdv_CreateMonitoring(self, data, **kwargs):
            mon = VRPMDV_CreateMonCmd(**data)
            return mon




