def _create_prelim(self):
self._verify(self.payload)<EOL>if "<STR_LIT:key>" in self.payload[<NUM_LIT:0>] and self.payload[<NUM_LIT:0>]["<STR_LIT:key>"]:<EOL><INDENT>if next((i for i in self.payload if "<STR_LIT:key>" not in i), False):<EOL><INDENT>raise ze.UnsupportedParams(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>return None  <EOL><DEDENT>liblevel = "<STR_LIT>"<EOL>headers = {"<STR_LIT>": token(), "<STR_LIT:Content-Type>": "<STR_LIT:application/json>"}<EOL>headers.update(self.zinstance.default_headers())<EOL>if self.parentid:<EOL><INDENT>for child in self.payload:<EOL><INDENT>child["<STR_LIT>"] = self.parentid<EOL><DEDENT><DEDENT>to_send = json.dumps(self.payload)<EOL>req = requests.post(<EOL>url=self.zinstance.endpoint<EOL>+ liblevel.format(<EOL>t=self.zinstance.library_type, u=self.zinstance.library_id<EOL>),<EOL>data=to_send,<EOL>headers=headers,<EOL>)<EOL>try:<EOL><INDENT>req.raise_for_status()<EOL><DEDENT>except requests.exceptions.HTTPError:<EOL><INDENT>error_handler(req)<EOL><DEDENT>data = req.json()<EOL>for k in data["<STR_LIT:success>"]:<EOL><INDENT>self.payload[int(k)]["<STR_LIT:key>"] = data["<STR_LIT:success>"][k]<EOL><DEDENT>return data<EOL>
Step 0: Register intent to upload files