fromJson static method

OpenApiChannelInformationResponse fromJson(
  1. Map<String, dynamic>? json
)

Convert the body of the HTTP response into a OpenApiChannelInformationResponse instance

Implementation

static OpenApiChannelInformationResponse fromJson(
    Map<String, dynamic>? json) {
  List? data = json?['data'];

  final channelInformationResults = <ChannelInformationResult>[];

  if (data != null) {
    for (var item in data) {
      var jsonConverted = ChannelInformationResult.fromJson(item);
      if (jsonConverted != null) {
        channelInformationResults.add(jsonConverted);
      }
    }
  }

  return OpenApiChannelInformationResponse(
    channelList: channelInformationResults,
    status: json?['status'],
    message: json?['message'],
  );
}