File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ The same situation applies to both `client.batch_send()` and `client.sending_api
276276- Permissions listing – [ ` general/permissions.py ` ] ( examples/general/permissions.py )
277277
278278### Organizations API:
279- - Sub-Accounts management – [ ` organizations/sub_accounts.py ` ] ( examples/organizations/sub_accounts.py )
279+ - Sub-Accounts management (list, create, delete) – [ ` organizations/sub_accounts.py ` ] ( examples/organizations/sub_accounts.py )
280280
281281## Contributing
282282
Original file line number Diff line number Diff line change 11import os
22
33import mailtrap as mt
4+ from mailtrap .models .common import DeletedObject
45from mailtrap .models .organizations import SubAccount
56
67API_KEY = os .environ ["MAILTRAP_API_KEY" ]
@@ -18,9 +19,16 @@ def create_sub_account(name: str) -> SubAccount:
1819 return sub_accounts_api .create (mt .CreateSubAccountParams (name = name ))
1920
2021
22+ def delete_sub_account (sub_account_id : int ) -> DeletedObject :
23+ return sub_accounts_api .delete (sub_account_id = sub_account_id )
24+
25+
2126if __name__ == "__main__" :
2227 sub_accounts = list_sub_accounts ()
2328 print (sub_accounts )
2429
2530 created = create_sub_account ("New Team Account" )
2631 print (created )
32+
33+ deleted = delete_sub_account (created .id )
34+ print (deleted )
You can’t perform that action at this time.
0 commit comments