// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'auth_session_model.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

_AppInfo _$AppInfoFromJson(Map<String, dynamic> json) => $checkedCreate(
  '_AppInfo',
  json,
  ($checkedConvert) {
    final val = _AppInfo(
      appTitle: $checkedConvert('app_title', (v) => v as String),
      appEndpoint: $checkedConvert('app_endpoint', (v) => v as String),
      appLogo: $checkedConvert('app_logo', (v) => v as String),
    );
    return val;
  },
  fieldKeyMap: const {
    'appTitle': 'app_title',
    'appEndpoint': 'app_endpoint',
    'appLogo': 'app_logo',
  },
);

Map<String, dynamic> _$AppInfoToJson(_AppInfo instance) => <String, dynamic>{
  'app_title': instance.appTitle,
  'app_endpoint': instance.appEndpoint,
  'app_logo': instance.appLogo,
};

_LoginMessage _$LoginMessageFromJson(Map<String, dynamic> json) =>
    $checkedCreate('_LoginMessage', json, ($checkedConvert) {
      final val = _LoginMessage(
        success: $checkedConvert('success', (v) => v as bool),
        message: $checkedConvert('message', (v) => v as String),
        sid: $checkedConvert('sid', (v) => v as String),
        csrfToken: $checkedConvert('csrf_token', (v) => v as String),
        apps: $checkedConvert(
          'apps',
          (v) =>
              (v as List<dynamic>?)
                  ?.map((e) => AppInfo.fromJson(e as Map<String, dynamic>))
                  .toList() ??
              const [],
        ),
      );
      return val;
    }, fieldKeyMap: const {'csrfToken': 'csrf_token'});

Map<String, dynamic> _$LoginMessageToJson(_LoginMessage instance) =>
    <String, dynamic>{
      'success': instance.success,
      'message': instance.message,
      'sid': instance.sid,
      'csrf_token': instance.csrfToken,
      'apps': instance.apps.map((e) => e.toJson()).toList(),
    };

_AuthSessionResponse _$AuthSessionResponseFromJson(Map<String, dynamic> json) =>
    $checkedCreate(
      '_AuthSessionResponse',
      json,
      ($checkedConvert) {
        final val = _AuthSessionResponse(
          sessionExpired: $checkedConvert(
            'session_expired',
            (v) => (v as num).toInt(),
          ),
          message: $checkedConvert(
            'message',
            (v) => LoginMessage.fromJson(v as Map<String, dynamic>),
          ),
          homePage: $checkedConvert('home_page', (v) => v as String),
          fullName: $checkedConvert('full_name', (v) => v as String),
        );
        return val;
      },
      fieldKeyMap: const {
        'sessionExpired': 'session_expired',
        'homePage': 'home_page',
        'fullName': 'full_name',
      },
    );

Map<String, dynamic> _$AuthSessionResponseToJson(
  _AuthSessionResponse instance,
) => <String, dynamic>{
  'session_expired': instance.sessionExpired,
  'message': instance.message.toJson(),
  'home_page': instance.homePage,
  'full_name': instance.fullName,
};

_GetSessionData _$GetSessionDataFromJson(Map<String, dynamic> json) =>
    $checkedCreate('_GetSessionData', json, ($checkedConvert) {
      final val = _GetSessionData(
        sid: $checkedConvert('sid', (v) => v as String),
        csrfToken: $checkedConvert('csrf_token', (v) => v as String),
      );
      return val;
    }, fieldKeyMap: const {'csrfToken': 'csrf_token'});

Map<String, dynamic> _$GetSessionDataToJson(_GetSessionData instance) =>
    <String, dynamic>{'sid': instance.sid, 'csrf_token': instance.csrfToken};

_GetSessionMessage _$GetSessionMessageFromJson(Map<String, dynamic> json) =>
    $checkedCreate('_GetSessionMessage', json, ($checkedConvert) {
      final val = _GetSessionMessage(
        data: $checkedConvert(
          'data',
          (v) => GetSessionData.fromJson(v as Map<String, dynamic>),
        ),
      );
      return val;
    });

Map<String, dynamic> _$GetSessionMessageToJson(_GetSessionMessage instance) =>
    <String, dynamic>{'data': instance.data.toJson()};

_GetSessionResponse _$GetSessionResponseFromJson(Map<String, dynamic> json) =>
    $checkedCreate(
      '_GetSessionResponse',
      json,
      ($checkedConvert) {
        final val = _GetSessionResponse(
          message: $checkedConvert(
            'message',
            (v) => GetSessionMessage.fromJson(v as Map<String, dynamic>),
          ),
          homePage: $checkedConvert('home_page', (v) => v as String),
          fullName: $checkedConvert('full_name', (v) => v as String),
        );
        return val;
      },
      fieldKeyMap: const {'homePage': 'home_page', 'fullName': 'full_name'},
    );

Map<String, dynamic> _$GetSessionResponseToJson(_GetSessionResponse instance) =>
    <String, dynamic>{
      'message': instance.message.toJson(),
      'home_page': instance.homePage,
      'full_name': instance.fullName,
    };

_SessionData _$SessionDataFromJson(Map<String, dynamic> json) => $checkedCreate(
  '_SessionData',
  json,
  ($checkedConvert) {
    final val = _SessionData(
      sid: $checkedConvert('sid', (v) => v as String),
      csrfToken: $checkedConvert('csrf_token', (v) => v as String),
      fullName: $checkedConvert('full_name', (v) => v as String),
      createdAt: $checkedConvert(
        'created_at',
        (v) => DateTime.parse(v as String),
      ),
      apps: $checkedConvert(
        'apps',
        (v) => (v as List<dynamic>?)
            ?.map((e) => AppInfo.fromJson(e as Map<String, dynamic>))
            .toList(),
      ),
    );
    return val;
  },
  fieldKeyMap: const {
    'csrfToken': 'csrf_token',
    'fullName': 'full_name',
    'createdAt': 'created_at',
  },
);

Map<String, dynamic> _$SessionDataToJson(_SessionData instance) =>
    <String, dynamic>{
      'sid': instance.sid,
      'csrf_token': instance.csrfToken,
      'full_name': instance.fullName,
      'created_at': instance.createdAt.toIso8601String(),
      'apps': ?instance.apps?.map((e) => e.toJson()).toList(),
    };
