//*****************************************************************
//             Generate by vsc-wisdom-flutter-kit
//*****************************************************************

///[http://yapi.wisdomcity.com.cn/project/40/interface/api/10562](http://yapi.wisdomcity.com.cn/project/40/interface/api/10562)
///
///update 2020-10-14 9:32:39
///
///公共抄表楼栋统计页面
// ignore: library_names
library meterReading_common_count.get;

import 'response_model.dart';
import 'package:dio/dio.dart';

///[http://yapi.wisdomcity.com.cn/project/40/interface/api/10562](http://yapi.wisdomcity.com.cn/project/40/interface/api/10562)
///
///update 2020-10-14 9:32:39
///
///公共抄表楼栋统计页面
class Interface {
  Interface._();

  static const String path = '/app/admin/meterReading/common/count';

  static const String method = 'get';

  static Future<ResponseModel<$DataModel>> request(
    Dio dio, {
    Options? options,
    Map<String, dynamic>? pathParameters,
    Map<String, dynamic>? queryParameters,
    data,
    CancelToken? cancelToken,
    ProgressCallback? onSendProgress,
    ProgressCallback? onReceiveProgress,
  }) async {
    final res = await dio.request(
      _path(pathParameters ?? {}),
      data: data,
      queryParameters: queryParameters,
      cancelToken: cancelToken,
      options: Options(method: 'get'),
      onSendProgress: onSendProgress,
      onReceiveProgress: onReceiveProgress,
    );

    return ResponseModel(
      json: res.data,
      to: (v) => v.toJson(),
      from: (v) => $DataModel.fromJson(v),
    );
  }

  static String _path(Map<String, dynamic> pathParameters) {
    String back = path;
    for (final key in pathParameters.keys) {
      back = back.replaceAll('{$key}', pathParameters[key].toString());
    }
    return back;
  }
}

///http://yapi.wisdomcity.com.cn/project/40/interface/api/10562
///
///
///
///`communityNoTranscribe` 小区未抄表总数
///
///`communityHasTranscribe` 小区已经抄表总数
///
///`meterCommonBuildDtos` 各个单元统计
///
// ignore: camel_case_types
class $DataModel {
  ///`communityNoTranscribe` 小区未抄表总数
  num? communityNoTranscribe;

  ///`communityHasTranscribe` 小区已经抄表总数
  num? communityHasTranscribe;

  ///`meterCommonBuildDtos` 各个单元统计
  List<$JuniorMeterCommonBuildDtosModel>? meterCommonBuildDtos;

  ///http://yapi.wisdomcity.com.cn/project/40/interface/api/10562
  ///
  ///
  ///
  ///`communityNoTranscribe` 小区未抄表总数
  ///
  ///`communityHasTranscribe` 小区已经抄表总数
  ///
  ///`meterCommonBuildDtos` 各个单元统计
  $DataModel({
    this.communityNoTranscribe,
    this.communityHasTranscribe,
    this.meterCommonBuildDtos,
  });

  $DataModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json);
    this.communityNoTranscribe = map['communityNoTranscribe'];
    this.communityHasTranscribe = map['communityHasTranscribe'];
    if (map['meterCommonBuildDtos'] != null)
      this.meterCommonBuildDtos = List.of(map['meterCommonBuildDtos'])
          .map((e) => $JuniorMeterCommonBuildDtosModel.fromJson(e ?? {}))
          .toList();
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['communityNoTranscribe'] = this.communityNoTranscribe;
    json['communityHasTranscribe'] = this.communityHasTranscribe;
    json['meterCommonBuildDtos'] =
        this.meterCommonBuildDtos?.map((e) => e.toJson()).toList();
    return Map.from(json);
  }
}

///http://yapi.wisdomcity.com.cn/project/40/interface/api/10562
///
///
///
///`buildId`
///
///`buildName`
///
///`buildNoTranscribe` 楼栋未抄表总数
///
///`buildEleNoTranscribe` 楼栋电表未抄表总数
///
///`buildWaterNoTranscribe` 楼栋水表未抄表总数
///
///`buildHasTranscribe` 楼栋已经抄表总数
///
// ignore: camel_case_types
class $JuniorMeterCommonBuildDtosModel {
  ///`buildId`
  String? buildId;

  ///`buildName`
  String? buildName;

  ///`buildNoTranscribe` 楼栋未抄表总数
  num? buildNoTranscribe;

  ///`buildEleNoTranscribe` 楼栋电表未抄表总数
  num? buildEleNoTranscribe;

  ///`buildWaterNoTranscribe` 楼栋水表未抄表总数
  num? buildWaterNoTranscribe;

  ///`buildHasTranscribe` 楼栋已经抄表总数
  num? buildHasTranscribe;

  ///http://yapi.wisdomcity.com.cn/project/40/interface/api/10562
  ///
  ///
  ///
  ///`buildId`
  ///
  ///`buildName`
  ///
  ///`buildNoTranscribe` 楼栋未抄表总数
  ///
  ///`buildEleNoTranscribe` 楼栋电表未抄表总数
  ///
  ///`buildWaterNoTranscribe` 楼栋水表未抄表总数
  ///
  ///`buildHasTranscribe` 楼栋已经抄表总数
  $JuniorMeterCommonBuildDtosModel({
    this.buildId,
    this.buildName,
    this.buildNoTranscribe,
    this.buildEleNoTranscribe,
    this.buildWaterNoTranscribe,
    this.buildHasTranscribe,
  });

  $JuniorMeterCommonBuildDtosModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json);
    this.buildId = map['buildId'];
    this.buildName = map['buildName'];
    this.buildNoTranscribe = map['buildNoTranscribe'];
    this.buildEleNoTranscribe = map['buildEleNoTranscribe'];
    this.buildWaterNoTranscribe = map['buildWaterNoTranscribe'];
    this.buildHasTranscribe = map['buildHasTranscribe'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['buildId'] = this.buildId;
    json['buildName'] = this.buildName;
    json['buildNoTranscribe'] = this.buildNoTranscribe;
    json['buildEleNoTranscribe'] = this.buildEleNoTranscribe;
    json['buildWaterNoTranscribe'] = this.buildWaterNoTranscribe;
    json['buildHasTranscribe'] = this.buildHasTranscribe;
    return Map.from(json);
  }
}
