def to_dict(self):
body = {<EOL>'<STR_LIT>': self.tier,<EOL>'<STR_LIT:title>': self.title,<EOL>'<STR_LIT:size>': self.size,<EOL>}<EOL>if hasattr(self, '<STR_LIT:address>') and self.address:<EOL><INDENT>body['<STR_LIT:address>'] = self.address<EOL><DEDENT>if hasattr(self, '<STR_LIT>') and self.zone:<EOL><INDENT>body['<STR_LIT>'] = self.zone<EOL><DEDENT>return body<EOL>
Return a dict that can be serialised to JSON and sent to UpCloud's API.

Uses the convenience attribute `os` for determining `action` and `storage`
fields.