class SmsRequest { String? locale; int? channelTimeout; // String? clientRef; int? codeLength; String? code; String? brand; List? workflow; SmsRequest( {this.locale, this.channelTimeout, // this.clientRef, this.codeLength, this.code, this.brand, this.workflow}); SmsRequest.fromJson(Map json) { locale = json['locale']; channelTimeout = json['channel_timeout']; // clientRef = json['client_ref']; codeLength = json['code_length']; code = json['code']; brand = json['brand']; if (json['workflow'] != null) { workflow = []; json['workflow'].forEach((v) { workflow!.add(new Workflow.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['locale'] = this.locale; data['channel_timeout'] = this.channelTimeout; // data['client_ref'] = this.clientRef; data['code_length'] = this.codeLength; data['code'] = this.code; data['brand'] = this.brand; if (this.workflow != null) { data['workflow'] = this.workflow!.map((v) => v.toJson()).toList(); } return data; } } class Workflow { String? channel; String? to; Workflow({this.channel, this.to}); Workflow.fromJson(Map json) { channel = json['channel']; to = json['to']; } Map toJson() { final Map data = new Map(); data['channel'] = this.channel; data['to'] = this.to; return data; } }