code: def from_dict(self, d):
          
          for key in d:
              if key == 'data':
                  for dkey in d['data']:
                      if dkey in self._encode_fields:
                          setattr(self, str(dkey), base64.b64decode(d['data'][dkey]))
                      else:
                          setattr(self, str(dkey), d['data'][dkey])
              else:
                  setattr(self, str(key), d[key])
docs: Initialise an API message from a transmission-safe dictionary.