deleteOrganizationalUnit
abstract suspend fun deleteOrganizationalUnit(input: DeleteOrganizationalUnitRequest): DeleteOrganizationalUnitResponse
Deletes an organizational unit (OU) from a root or another OU. You must first remove all accounts and child OUs from the OU that you want to delete.
This operation can be called only from the organization's management account.
Samples
fun main() {
//sampleStart
// The following example shows how to delete an OU. The example assumes that you previously removed all
// accounts and other OUs from the OU
organizationsClient.deleteOrganizationalUnit {
organizationalUnitId = "ou-examplerootid111-exampleouid111"
}
//sampleEnd
}