// Converted with: https://app.quicktype.io/?l=dart import 'dart:convert'; MixerState mixerStateFromJson(String str) => MixerState.fromJson(json.decode(str)); String mixerStateToJson(MixerState data) => json.encode(data.toJson()); class MixerState { List inputs; List outputs; MixerState({ required this.inputs, required this.outputs, }); factory MixerState.fromJson(Map json) => MixerState( inputs: List.from(json["inputs"].map((x) => Port.fromJson(x))), outputs: List.from(json["outputs"].map((x) => Port.fromJson(x))), ); Map toJson() => { "inputs": List.from(inputs.map((x) => x.toJson())), "outputs": List.from(outputs.map((x) => x.toJson())), }; } class Port { String uuid; String name; Properties properties; State state; List route; Port({ required this.uuid, required this.name, required this.properties, required this.state, required this.route, }); factory Port.fromJson(Map json) => Port( uuid: json["UUID"], name: json["name"], properties: Properties.fromJson(json["properties"]), state: State.fromJson(json["state"]), route: List.from(json["route"].map((x) => State.fromJson(x))), ); Map toJson() => { "UUID": uuid, "name": name, "properties": properties.toJson(), "state": state.toJson(), "route": List.from(route.map((x) => x.toJson())), }; } class Properties { String backend; int channels; Properties({ required this.backend, required this.channels, }); factory Properties.fromJson(Map json) => Properties( backend: json["backend"], channels: json["channels"], ); Map toJson() => { "backend": backend, "channels": channels, }; } class State { String? toUuid; bool mute; double volume; double balance; State({ this.toUuid, required this.mute, required this.volume, required this.balance, }); factory State.fromJson(Map json) => State( toUuid: json["toUUID"], mute: json["mute"], volume: json["volume"]?.toDouble(), balance: json["balance"]?.toDouble(), ); Map toJson() => { "toUUID": toUuid, "mute": mute, "volume": volume, "balance": balance, }; }