// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'bi_training_session.model.dart';

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

BITrainingSession _$BITrainingSessionFromJson(Map<String, dynamic> json) {
  return BITrainingSession()
    ..id = json['id'] as int
    ..box_id = json['box_id'] as int
    ..coach_id = json['coach_id'] as int
    ..training_room_id = json['training_room_id'] as int
    ..training_workout_id = json['training_workout_id'] as int
    ..training_type_id = json['training_type_id'] as int
    ..capacity = json['capacity'] as int
    ..created_at = json['created_at'] == null
        ? null
        : DateTime.parse(json['created_at'] as String)
    ..updated_at = json['updated_at'] == null
        ? null
        : DateTime.parse(json['updated_at'] as String)
    ..training_type = json['training_type'] == null
        ? null
        : TrainingType.fromJson(json['training_type'] as Map<String, dynamic>)
    ..date_start = json['date_start'] == null
        ? null
        : DateTime.parse(json['date_start'] as String)
    ..date_end = json['date_end'] == null
        ? null
        : DateTime.parse(json['date_end'] as String)
    ..coach = json['coach'] == null
        ? null
        : User.fromJson(json['coach'] as Map<String, dynamic>)
    ..credits = json['credits'] ? 1 : 0
    ..users = (json['users'] as List)
        ?.map((e) => e == null ? null : User.fromJson(e as Map<String, dynamic>))
        ?.toList()
    ..state = json['state'] as String
    ..benchmark = json['benchmark'] == null
        ? null
        : UserBenchmark.fromJson(json['benchmark'] as Map<String, dynamic>)
    ..training_room = json['training_room'] == null
        ? null
        : TrainingRoom.fromJson(json['training_room'] as Map<String, dynamic>)
    ..training_workout = json['training_workout'] == null
        ? null
        : TrainingWorkout.fromJson(json['training_workout'] as Map<String, dynamic>);
}

Map<String, dynamic> _$BITrainingSessionToJson(BITrainingSession instance) =>
    <String, dynamic>{
      'id': instance.id,
      'box_id': instance.box_id,
      'coach_id': instance.coach_id,
      'training_room_id': instance.training_room_id,
      'training_workout_id': instance.training_workout_id,
      'training_type_id': instance.training_type_id,
      'capacity': instance.capacity,
      'created_at': instance.created_at?.toIso8601String(),
      'updated_at': instance.updated_at?.toIso8601String(),
      'training_type': instance.training_type,
      'date_start': instance.date_start?.toIso8601String(),
      'date_end': instance.date_end?.toIso8601String(),
      'coach': instance.coach,
      'credits': instance.credits,
      'users': instance.users,
      'state': instance.state,
      'benchmark': instance.benchmark,
      'training_room': instance.training_room,
      'training_workout': instance.training_workout
    };
