Map<String, dynamic> toJson() { final services = this.services; final thingName = this.thingName; return { 'services': services, if (thingName != null) 'thingName': thingName, }; }