Beispiel #1
0
    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()))
Beispiel #2
0
    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}'))
Beispiel #3
0
    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)
        ]
Beispiel #4
0
    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()))