- Python 3.7+
fromtypingimportListfromwrapi.apiimportqueryfromwrapi.authimportWrikePermanentTokenAuthfromwrapi.clientimportclientfromwrapi.endpointsimportfoldersfromwrapi.entities.foldersimportFolderfromwrapi.types_.inputsimportCustomField, Projectdefmain() ->None:
withclient(WrikePermanentTokenAuth("your-auth-token")) ascl:
create_folder=query(
cl,
folders.CreateFolder(
folder_id="12523623",
title="New Field",
custom_fields=(CustomField(id="123456", value="1avagas"),),
project=Project(custom_status_id="12312415"),
),
)
folder=create_folder.as_model(List[Folder])[0]
update_folder=query(cl, folders.ModifyFolder(folder_id=folder.id, add_parents=("123456", )))
update_folder.ignored()
if__name__=="__main__":
main()fromtypingimportListfromasyncioimportrunfromwrapi.apiimportqueryfromwrapi.authimportWrikePermanentTokenAuthfromwrapi.clientimportasync_clientfromwrapi.endpointsimportfoldersfromwrapi.entities.foldersimportFolderfromwrapi.types_.inputsimportCustomField, Projectasyncdefmain() ->None:
asyncwithasync_client(WrikePermanentTokenAuth("your-auth-token")) ascl:
create_folder=query(
cl,
folders.CreateFolder(
folder_id="12523623",
title="New Field",
custom_fields=(CustomField(id="123456", value="1avagas"),),
project=Project(custom_status_id="12312415"),
),
)
folder= (awaitcreate_folder.as_model(List[Folder]))[0]
update_folder=query(cl, folders.ModifyFolder(folder_id=folder.id, add_parents=("123456", )))
awaitupdate_folder.ignored()
if__name__=="__main__":
run(main())Issues: see the list in the github repo.
This library has nothing to do with Wrike LLC and made at my free time as experiment to try httpx and pydantic in action.