def edit(self, mr: ModelPackaging) -> ModelPackaging: """ Edit Model Packaging :param mr: Model Packaging :return Message from API server """ return ModelPackaging.from_dict( self.query(MODEL_PACKING_URL, action='PUT', payload=mr.to_dict()))
def get(self, name: str) -> ModelPackaging: """ Get Model Packaging from API server :param name: Model Packaging name :type name: str :return: Model Packaging """ return ModelPackaging.from_dict( self.query(f'{MODEL_PACKING_URL}/{name}'))
def get_all(self) -> List[ModelPackaging]: """ Get all Model Packagings from API server :return: all Model Packagings """ return [ ModelPackaging.from_dict(mr) for mr in self.query(MODEL_PACKING_URL) ]
async def create(self, mr: ModelPackaging) -> ModelPackaging: """ Create Model Packaging :param mr: Model Packaging :return Message from API server """ return ModelPackaging.from_dict(await self.query(MODEL_PACKING_URL, action='POST', payload=mr.to_dict()))