il2_rest/client.py
def add_record_unpacked(self, applicationId, payloadTagId, rec_bytes, rec_type=RecordType.Data) :
        """
        Add a new record with an unpacked payload. 
        Payload inner bytes MUST go in the body, in binary form.
        These inner bytes will be prefixed with the payloadTagId and the lenght, both encoded as ILInt, as required to assemble the record effective payload.

        Args:
            applicationId (:obj:`int`): Application id of the record.
            payloadTagId (:obj:`int`): Payload tag id of the record.
            rec_type (:obj:`il2_rest.enumerations.RecordType`): Type of record.
            rec_bytes (:obj:`bytes`): Payload bytes.
            
        Returns:
            :obj:`il2_rest.models.RecordModel`: Added record information.

        Example: 
            >>> node = RestNode(cert_file='recorder.pfx', cert_pass='password', port=32020)
            >>> chain = node.chain_by_id('VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM')
            >>> record = chain.add_record_unpacked(applicationId=1, payloadTagId=300, rec_bytes=bytes([5, 0, 0, 20, 2, 1, 4]))
            >>> print(record)
            {
                "applicationId": 1,
                "chainId": "VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM",
                "createdAt": "2020-02-13T19:01:37.5175345-03:00",
                "hash": "cY7krS7BSJcBi7Ickq-u4iI6V6lYoKULfQtEZGJ-mC0#SHA256",
                "payloadTagId": 300,
                "serial": 4,
                "type": "Data",
                "version": 2,
                "payloadBytes": "+DQHBQAAFAIBBA=="
            }
        """
        cur_url = f"/records@{self.id}/with?applicationId={applicationId}&payloadTagId={payloadTagId}&type={rec_type.value}"
        return RecordModel.from_json(self.__rest._post_raw(cur_url, rec_bytes, "application/interlockledger"))

        Add a new record with an unpacked payload. 
        Payload inner bytes MUST go in the body, in binary form.
        These inner bytes will be prefixed with the payloadTagId and the lenght, both encoded as ILInt, as required to assemble the record effective payload.

        Args:
            applicationId (:obj:`int`): Application id of the record.
            payloadTagId (:obj:`int`): Payload tag id of the record.
            rec_type (:obj:`il2_rest.enumerations.RecordType`): Type of record.
            rec_bytes (:obj:`bytes`): Payload bytes.
            
        Returns:
            :obj:`il2_rest.models.RecordModel`: Added record information.

        Example: 
            >>> node = RestNode(cert_file='recorder.pfx', cert_pass='password', port=32020)
            >>> chain = node.chain_by_id('VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM')
            >>> record = chain.add_record_unpacked(applicationId=1, payloadTagId=300, rec_bytes=bytes([5, 0, 0, 20, 2, 1, 4]))
            >>> print(record)
            {
                "applicationId": 1,
                "chainId": "VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM",
                "createdAt": "2020-02-13T19:01:37.5175345-03:00",
                "hash": "cY7krS7BSJcBi7Ickq-u4iI6V6lYoKULfQtEZGJ-mC0#SHA256",
                "payloadTagId": 300,
                "serial": 4,
                "type": "Data",
                "version": 2,
                "payloadBytes": "+DQHBQAAFAIBBA=="
            }
        
Add a new record with an unpacked payload.
Payload inner bytes MUST go in the body, in binary form.
These inner bytes will be prefixed with the payloadTagId and the lenght, both encoded as ILInt, as required to assemble the record effective payload.
Add a new record with an unpacked payload . Payload inner bytes MUST go in the body in binary form . These inner bytes will be prefixed with the payloadTagId and the lenght both encoded as ILInt as required to assemble the record effective payload .
def add_record_unpacked(self, applicationId, payloadTagId, rec_bytes, rec_type=RecordType.Data) :
        cur_url = f"/records@{self.id}/with?applicationId={applicationId}&payloadTagId={payloadTagId}&type={rec_type.value}"
        return RecordModel.from_json(self.__rest._post_raw(cur_url, rec_bytes, "application/interlockledger"))
def add_record_unpacked ( self , applicationId , payloadTagId , rec_bytes , rec_type = RecordType . Data ) : cur_url = f"/records@{self.id}/with?applicationId={applicationId}&payloadTagId={payloadTagId}&type={rec_type.value}" return RecordModel . from_json ( self . __rest . _post_raw ( cur_url , rec_bytes , "application/interlockledger" ) )
Add a new record with an unpacked payload.
Add a new record with an unpacked payload .
"""
        Add a new record with an unpacked payload. 
        Payload inner bytes MUST go in the body, in binary form.
        These inner bytes will be prefixed with the payloadTagId and the lenght, both encoded as ILInt, as required to assemble the record effective payload.

        Args:
            applicationId (:obj:`int`): Application id of the record.
            payloadTagId (:obj:`int`): Payload tag id of the record.
            rec_type (:obj:`il2_rest.enumerations.RecordType`): Type of record.
            rec_bytes (:obj:`bytes`): Payload bytes.
            
        Returns:
            :obj:`il2_rest.models.RecordModel`: Added record information.

        Example: 
            >>> node = RestNode(cert_file='recorder.pfx', cert_pass='password', port=32020)
            >>> chain = node.chain_by_id('VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM')
            >>> record = chain.add_record_unpacked(applicationId=1, payloadTagId=300, rec_bytes=bytes([5, 0, 0, 20, 2, 1, 4]))
            >>> print(record)
            {
                "applicationId": 1,
                "chainId": "VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM",
                "createdAt": "2020-02-13T19:01:37.5175345-03:00",
                "hash": "cY7krS7BSJcBi7Ickq-u4iI6V6lYoKULfQtEZGJ-mC0#SHA256",
                "payloadTagId": 300,
                "serial": 4,
                "type": "Data",
                "version": 2,
                "payloadBytes": "+DQHBQAAFAIBBA=="
            }
        """
:obj:`il2_rest.models.RecordModel`: Added record information.
: obj : ` il2_rest . models . RecordModel ` : Added record information .
self
applicationId
payloadTagId
rec_bytes
rec_type
applicationId (
`int`): Application id of the record.
` int ` ) : Application id of the record .
payloadTagId (
`int`): Payload tag id of the record.
` int ` ) : Payload tag id of the record .
rec_type (
`il2_rest.enumerations.RecordType`): Type of record.
` il2_rest . enumerations . RecordType ` ) : Type of record .
rec_bytes (
`bytes`): Payload bytes.
` bytes ` ) : Payload bytes .
examples
>>> node = RestNode(cert_file='recorder.pfx', cert_pass='password', port=32020)
>>> chain = node.chain_by_id('VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM')
>>> record = chain.add_record_unpacked(applicationId=1, payloadTagId=300, rec_bytes=bytes([5, 0, 0, 20, 2, 1, 4]))
>>> print(record)
{
"applicationId": 1,
"chainId": "VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM",
"createdAt": "2020-02-13T19:01:37.5175345-03:00",
"hash": "cY7krS7BSJcBi7Ickq-u4iI6V6lYoKULfQtEZGJ-mC0#SHA256",
"payloadTagId": 300,
"serial": 4,
"type": "Data",
"version": 2,
"payloadBytes": "+DQHBQAAFAIBBA=="
}
>>> node = RestNode ( cert_file = ' recorder . pfx ' cert_pass = ' password ' port = 32020 ) >>> chain = node . chain_by_id ( ' VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM ' ) >>> record = chain . add_record_unpacked ( applicationId = 1 payloadTagId = 300 rec_bytes = bytes ( [ 5 0 0 20 2 1 4 ] )) >>> print ( record ) { " applicationId " : 1 " chainId " : " VzCJczfgBeIiIBlnTRbmtsPriqwrkHqtF2yt8nhTcjM " " createdAt " : " 2020 - 02 - 13T19 : 01 : 37 . 5175345 - 03 : 00 " " hash " : " cY7krS7BSJcBi7Ickq - u4iI6V6lYoKULfQtEZGJ - mC0#SHA256 " " payloadTagId " : 300 " serial " : 4 " type " : " Data " " version " : 2 " payloadBytes " : " + DQHBQAAFAIBBA == " }