// To parse this JSON data, do
//
//     final refreshToken = refreshTokenFromJson(jsonString);

import 'dart:convert';

RefreshToken refreshTokenFromJson(String str) => RefreshToken.fromJson(json.decode(str));

String refreshTokenToJson(RefreshToken data) => json.encode(data.toJson());

class RefreshToken {
  RefreshToken({
    this.totalItemsCount,
    this.data,
    this.messageStatus,
    this.message,
  });

  final dynamic? totalItemsCount;
  final RefreshData? data;
  final int? messageStatus;
  final String? message;

  factory RefreshToken.fromJson(Map<String, dynamic> json) => RefreshToken(
    totalItemsCount: json["totalItemsCount"],
    data: json["data"] == null ? null : RefreshData.fromJson(json["data"]),
    messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
    message: json["message"] == null ? null : json["message"],
  );

  Map<String, dynamic> toJson() => {
    "totalItemsCount": totalItemsCount,
    "data": data == null ? null : data!.toJson(),
    "messageStatus": messageStatus == null ? null : messageStatus,
    "message": message == null ? null : message,
  };
}

class RefreshData {
  RefreshData({
    this.accessToken,
    this.refreshToken,
    this.expiryDate,
    this.userInfo,
  });

  final String? accessToken;
  final String? refreshToken;
  final DateTime? expiryDate;
  final dynamic? userInfo;

  factory RefreshData.fromJson(Map<String, dynamic> json) => RefreshData(
    accessToken: json["accessToken"] == null ? null : json["accessToken"],
    refreshToken: json["refreshToken"] == null ? null : json["refreshToken"],
    expiryDate: json["expiryDate"] == null ? null : DateTime.parse(json["expiryDate"]),
    userInfo: json["userInfo"],
  );

  Map<String, dynamic> toJson() => {
    "accessToken": accessToken == null ? null : accessToken,
    "refreshToken": refreshToken == null ? null : refreshToken,
    "expiryDate": expiryDate == null ? null : expiryDate!.toIso8601String(),
    "userInfo": userInfo,
  };
}
