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

///[http://yapi.wisdomcity.com.cn/project/40/interface/api/10067](http://yapi.wisdomcity.com.cn/project/40/interface/api/10067)
///
///update 2020-10-14 17:43:33
///
///公共表列表
// ignore: library_names
library meterReading_common.get;

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

///[http://yapi.wisdomcity.com.cn/project/40/interface/api/10067](http://yapi.wisdomcity.com.cn/project/40/interface/api/10067)
///
///update 2020-10-14 17:43:33
///
///公共表列表
class Interface {
  Interface._();

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

  static const String method = 'get';

  static Future<ResponseModel<ResponsePagingModel<$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) => ResponsePagingModel(
        json: v,
        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/10067
///
///
///
///`id` id
///
///`readerDate` 抄表日期
///
///`communityId` 小区id
///
///`buildId` 楼栋id
///
///`buildName` 楼栋名称
///
///`unitId` 单元id
///
///`unitName` 单元名称
///
///`meterName` 仪表名称
///
///`meterType` 表类型枚举
///
///`meterCode` 表编号
///
///`initalAmount` 初始读数
///
///`backhaulAmount` 仪表回程(最大读数)
///
///`multiple` 倍数
///
///`lastAmount` 上次最新读数
///
///`transcribes` 本期是否抄表
///
///`transcribeDate`
///
///`isVirtual` 是否虚拟表(默认为0 ；0:否 1:是)
///
///`lastActualAmount` 实际行度
///
// ignore: camel_case_types
class $DataModel {
  ///`id` id
  String? id;

  ///`readerDate` 抄表日期
  String? readerDate;

  ///`communityId` 小区id
  String? communityId;

  ///`buildId` 楼栋id
  String? buildId;

  ///`buildName` 楼栋名称
  String? buildName;

  ///`unitId` 单元id
  String? unitId;

  ///`unitName` 单元名称
  String? unitName;

  ///`meterName` 仪表名称
  String? meterName;

  ///`meterType` 表类型枚举
  String? meterType;

  ///`meterCode` 表编号
  String? meterCode;

  ///`initalAmount` 初始读数
  num? initalAmount;

  ///`backhaulAmount` 仪表回程(最大读数)
  num? backhaulAmount;

  ///`multiple` 倍数
  num? multiple;

  ///`lastAmount` 上次最新读数
  num? lastAmount;

  ///`transcribes` 本期是否抄表
  bool? transcribes;

  ///`transcribeDate`
  String? transcribeDate;

  ///`isVirtual` 是否虚拟表(默认为0 ；0:否 1:是)
  bool? isVirtual;

  ///`lastActualAmount` 实际行度
  num? lastActualAmount;

  ///http://yapi.wisdomcity.com.cn/project/40/interface/api/10067
  ///
  ///
  ///
  ///`id` id
  ///
  ///`readerDate` 抄表日期
  ///
  ///`communityId` 小区id
  ///
  ///`buildId` 楼栋id
  ///
  ///`buildName` 楼栋名称
  ///
  ///`unitId` 单元id
  ///
  ///`unitName` 单元名称
  ///
  ///`meterName` 仪表名称
  ///
  ///`meterType` 表类型枚举
  ///
  ///`meterCode` 表编号
  ///
  ///`initalAmount` 初始读数
  ///
  ///`backhaulAmount` 仪表回程(最大读数)
  ///
  ///`multiple` 倍数
  ///
  ///`lastAmount` 上次最新读数
  ///
  ///`transcribes` 本期是否抄表
  ///
  ///`transcribeDate`
  ///
  ///`isVirtual` 是否虚拟表(默认为0 ；0:否 1:是)
  ///
  ///`lastActualAmount` 实际行度
  $DataModel({
    this.id,
    this.readerDate,
    this.communityId,
    this.buildId,
    this.buildName,
    this.unitId,
    this.unitName,
    this.meterName,
    this.meterType,
    this.meterCode,
    this.initalAmount,
    this.backhaulAmount,
    this.multiple,
    this.lastAmount,
    this.transcribes,
    this.transcribeDate,
    this.isVirtual,
    this.lastActualAmount,
  });

  $DataModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json);
    this.id = map['id'];
    this.readerDate = map['readerDate'];
    this.communityId = map['communityId'];
    this.buildId = map['buildId'];
    this.buildName = map['buildName'];
    this.unitId = map['unitId'];
    this.unitName = map['unitName'];
    this.meterName = map['meterName'];
    this.meterType = map['meterType'];
    this.meterCode = map['meterCode'];
    this.initalAmount = map['initalAmount'];
    this.backhaulAmount = map['backhaulAmount'];
    this.multiple = map['multiple'];
    this.lastAmount = map['lastAmount'];
    this.transcribes = map['transcribes'];
    this.transcribeDate = map['transcribeDate'];
    this.isVirtual = map['isVirtual'];
    this.lastActualAmount = map['lastActualAmount'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['id'] = this.id;
    json['readerDate'] = this.readerDate;
    json['communityId'] = this.communityId;
    json['buildId'] = this.buildId;
    json['buildName'] = this.buildName;
    json['unitId'] = this.unitId;
    json['unitName'] = this.unitName;
    json['meterName'] = this.meterName;
    json['meterType'] = this.meterType;
    json['meterCode'] = this.meterCode;
    json['initalAmount'] = this.initalAmount;
    json['backhaulAmount'] = this.backhaulAmount;
    json['multiple'] = this.multiple;
    json['lastAmount'] = this.lastAmount;
    json['transcribes'] = this.transcribes;
    json['transcribeDate'] = this.transcribeDate;
    json['isVirtual'] = this.isVirtual;
    json['lastActualAmount'] = this.lastActualAmount;
    return Map.from(json);
  }
}
