When all agents or tests were removed from a label/group the client was marshalling the absence of those fields to null. The ThousandEyes API ignored the null value and didn't actually make any changes to the label/group. But from terraform's perspective the agents/tests had been removed (from the state). By passing an empty array, the ThousandEyes API removes the agents/tests sucessfully from the label.
When all agents or tests were removed from a label/group the client was marshalling the absence of those fields to null. The ThousandEyes API ignored the null value and didn't actually make any changes to the label/group. But from terraform's perspective the agents/tests had been removed (from the state). By passing an empty array, the ThousandEyes API removes the agents/tests sucessfully from the label.
Before change with debug logging enabled:
After change with debug logging enabled: