import 'package:satu/core/utils/utils_parse.dart';

/// user_id : 10
/// company_id : 281
/// kassa_id : 3
/// token : "nFH2bzcwAQ4UMpzT5TVVvZr7QaljNfpmG0aqUzgU6J9gXnaDPo4VvBa3CNUn"
/// auth_at : "2021-04-30\n11:38:52"
/// shard : 1
/// message : "Authorization confirm"
/// operation : true

class AuthResponse {
  int? userId;
  int? companyId;
  int? kassaId;
  String? token;
  String? authAt;
  int? shard;
  String? message;
  bool? operation;

  static AuthResponse fromMap(dynamic map) {
    final AuthResponse authResponseBean = AuthResponse();
    authResponseBean.userId = cast<int>(map['user_id']);
    authResponseBean.companyId = cast<int>(map['company_id']);
    authResponseBean.kassaId = cast<int>(map['kassa_id']);
    authResponseBean.token = cast<String>(map['token']);
    authResponseBean.authAt = cast<String>(map['auth_at']);
    authResponseBean.shard = cast<int>(map['shard']);
    authResponseBean.message = cast<String>(map['message']);
    authResponseBean.operation = map['operation'] as bool;
    return authResponseBean;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> map = <String, dynamic>{
      'user_id': userId,
      'company_id': companyId,
      'kassa_id': kassaId,
      'token': token,
      'auth_at': authAt,
      'shard': shard,
      'message': message,
      'operation': operation,
    };
    return map;
  }
}
