Converts between content body representations.

        Not all representations can be converted to/from other formats. Supported conversions:

        Source Representation |   Destination Representation Supported
        --------------------------------------------------------------
        "storage"               |   "view","export_view","editor"
        "editor"                |   "storage"
        "view"                  |   None
        "export_view"           |   None

        :param content_data (string): The content data to transform.
        :param old_representation (string): The representation to convert from.
        :param new_representation (string): The representation to convert to.
        :param callback: OPTIONAL: The callback to execute on the resulting data, before the method returns.
                         Default: None (no callback, raw data returned).
        :return: The JSON data returned from the contentbody/convert/{to} endpoint,
                 or the results of the callback. Will raise requests.HTTPError on bad input, potentially.

def convert_contentbody_to_new_type(self, content_data, old_representation, new_representation, callback=None):
        """
        Converts between content body representations.

        Not all representations can be converted to/from other formats. Supported conversions:

        Source Representation |   Destination Representation Supported
        --------------------------------------------------------------
        "storage"               |   "view","export_view","editor"
        "editor"                |   "storage"
        "view"                  |   None
        "export_view"           |   None

        :param content_data (string): The content data to transform.
        :param old_representation (string): The representation to convert from.
        :param new_representation (string): The representation to convert to.
        :param callback: OPTIONAL: The callback to execute on the resulting data, before the method returns.
                         Default: None (no callback, raw data returned).
        :return: The JSON data returned from the contentbody/convert/{to} endpoint,
                 or the results of the callback. Will raise requests.HTTPError on bad input, potentially.
        """
        assert {old_representation, new_representation} < {"storage", "editor", "view", "export_view"}
        # TODO: Enforce conversion rules better here.
        request_data = {"value": str(content_data), "representation": old_representation}
        return self._service_post_request("rest/api/contentbody/convert/{to}".format(to=new_representation),
                                          data=json.dumps(request_data),
                                          headers={"Content-Type": "application/json"}, callback=callback)