// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'tmdb.dart';

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

_TmdbCastMember _$TmdbCastMemberFromJson(Map<String, dynamic> json) =>
    _TmdbCastMember(
      id: _intRequired(json['id']),
      name: json['name'] == null ? '' : _strOrEmpty(json['name']),
      character: json['character'] as String?,
      profilePath: json['profile_path'] as String?,
      order: json['order'] == null ? 0 : _intOrZero(json['order']),
    );

Map<String, dynamic> _$TmdbCastMemberToJson(_TmdbCastMember instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'character': instance.character,
      'profile_path': instance.profilePath,
      'order': instance.order,
    };

_TmdbCrewMember _$TmdbCrewMemberFromJson(Map<String, dynamic> json) =>
    _TmdbCrewMember(
      id: _intRequired(json['id']),
      name: json['name'] == null ? '' : _strOrEmpty(json['name']),
      job: json['job'] as String?,
      department: json['department'] as String?,
      profilePath: json['profile_path'] as String?,
    );

Map<String, dynamic> _$TmdbCrewMemberToJson(_TmdbCrewMember instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'job': instance.job,
      'department': instance.department,
      'profile_path': instance.profilePath,
    };

_TmdbCreditsRes _$TmdbCreditsResFromJson(Map<String, dynamic> json) =>
    _TmdbCreditsRes(
      cast:
          (json['cast'] as List<dynamic>?)
              ?.map((e) => TmdbCastMember.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbCastMember>[],
      crew:
          (json['crew'] as List<dynamic>?)
              ?.map((e) => TmdbCrewMember.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbCrewMember>[],
    );

Map<String, dynamic> _$TmdbCreditsResToJson(_TmdbCreditsRes instance) =>
    <String, dynamic>{'cast': instance.cast, 'crew': instance.crew};

_TmdbRecommendation _$TmdbRecommendationFromJson(Map<String, dynamic> json) =>
    _TmdbRecommendation(
      id: _intRequired(json['id']),
      title: json['title'] as String,
      posterPath: json['poster_path'] as String?,
      backdropPath: json['backdrop_path'] as String?,
      overview: json['overview'] as String?,
      voteAverage: _doubleOrNull(json['vote_average']),
      mediaType: json['media_type'] as String?,
    );

Map<String, dynamic> _$TmdbRecommendationToJson(_TmdbRecommendation instance) =>
    <String, dynamic>{
      'id': instance.id,
      'title': instance.title,
      'poster_path': instance.posterPath,
      'backdrop_path': instance.backdropPath,
      'overview': instance.overview,
      'vote_average': instance.voteAverage,
      'media_type': instance.mediaType,
    };

_TmdbRecommendationsRes _$TmdbRecommendationsResFromJson(
  Map<String, dynamic> json,
) => _TmdbRecommendationsRes(
  results:
      (json['results'] as List<dynamic>?)
          ?.map((e) => TmdbRecommendation.fromJson(e as Map<String, dynamic>))
          .toList() ??
      const <TmdbRecommendation>[],
  totalResults: json['total_results'] == null
      ? 0
      : _intOrZero(json['total_results']),
);

Map<String, dynamic> _$TmdbRecommendationsResToJson(
  _TmdbRecommendationsRes instance,
) => <String, dynamic>{
  'results': instance.results,
  'total_results': instance.totalResults,
};

_TmdbEpisode _$TmdbEpisodeFromJson(Map<String, dynamic> json) => _TmdbEpisode(
  episodeNumber: _intRequired(json['episode_number']),
  name: json['name'] == null ? '' : _strOrEmpty(json['name']),
  overview: json['overview'] as String?,
  stillPath: json['still_path'] as String?,
  airDate: json['air_date'] as String?,
  voteAverage: _doubleOrNull(json['vote_average']),
  runtime: _intOrNull(json['runtime']),
);

Map<String, dynamic> _$TmdbEpisodeToJson(_TmdbEpisode instance) =>
    <String, dynamic>{
      'episode_number': instance.episodeNumber,
      'name': instance.name,
      'overview': instance.overview,
      'still_path': instance.stillPath,
      'air_date': instance.airDate,
      'vote_average': instance.voteAverage,
      'runtime': instance.runtime,
    };

_TmdbSeasonDetail _$TmdbSeasonDetailFromJson(Map<String, dynamic> json) =>
    _TmdbSeasonDetail(
      seasonNumber: _intRequired(json['season_number']),
      name: json['name'] == null ? '' : _strOrEmpty(json['name']),
      overview: json['overview'] as String?,
      posterPath: json['poster_path'] as String?,
      episodes:
          (json['episodes'] as List<dynamic>?)
              ?.map((e) => TmdbEpisode.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbEpisode>[],
    );

Map<String, dynamic> _$TmdbSeasonDetailToJson(_TmdbSeasonDetail instance) =>
    <String, dynamic>{
      'season_number': instance.seasonNumber,
      'name': instance.name,
      'overview': instance.overview,
      'poster_path': instance.posterPath,
      'episodes': instance.episodes,
    };

_TmdbVideo _$TmdbVideoFromJson(Map<String, dynamic> json) => _TmdbVideo(
  id: json['id'] == null ? '' : _strOrEmpty(json['id']),
  key: json['key'] == null ? '' : _strOrEmpty(json['key']),
  name: json['name'] == null ? '' : _strOrEmpty(json['name']),
  site: json['site'] == null ? '' : _strOrEmpty(json['site']),
  type: json['type'] == null ? '' : _strOrEmpty(json['type']),
  size: json['size'] == null ? 0 : _intOrZero(json['size']),
  official: json['official'] == null ? false : _boolOrFalse(json['official']),
);

Map<String, dynamic> _$TmdbVideoToJson(_TmdbVideo instance) =>
    <String, dynamic>{
      'id': instance.id,
      'key': instance.key,
      'name': instance.name,
      'site': instance.site,
      'type': instance.type,
      'size': instance.size,
      'official': instance.official,
    };

_TmdbVideosRes _$TmdbVideosResFromJson(Map<String, dynamic> json) =>
    _TmdbVideosRes(
      results:
          (json['results'] as List<dynamic>?)
              ?.map((e) => TmdbVideo.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbVideo>[],
    );

Map<String, dynamic> _$TmdbVideosResToJson(_TmdbVideosRes instance) =>
    <String, dynamic>{'results': instance.results};

_TmdbPersonDetail _$TmdbPersonDetailFromJson(Map<String, dynamic> json) =>
    _TmdbPersonDetail(
      id: _intRequired(json['id']),
      name: json['name'] == null ? '' : _strOrEmpty(json['name']),
      biography: json['biography'] as String?,
      birthday: json['birthday'] as String?,
      deathday: json['deathday'] as String?,
      placeOfBirth: json['place_of_birth'] as String?,
      profilePath: json['profile_path'] as String?,
      knownForDepartment: json['known_for_department'] as String?,
      popularity: _doubleOrNull(json['popularity']),
    );

Map<String, dynamic> _$TmdbPersonDetailToJson(_TmdbPersonDetail instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'biography': instance.biography,
      'birthday': instance.birthday,
      'deathday': instance.deathday,
      'place_of_birth': instance.placeOfBirth,
      'profile_path': instance.profilePath,
      'known_for_department': instance.knownForDepartment,
      'popularity': instance.popularity,
    };

_TmdbPersonCredit _$TmdbPersonCreditFromJson(Map<String, dynamic> json) =>
    _TmdbPersonCredit(
      id: _intRequired(json['id']),
      title: json['title'] as String,
      character: json['character'] as String?,
      posterPath: json['poster_path'] as String?,
      releaseDate: json['release_date'] as String?,
      voteAverage: _doubleOrNull(json['vote_average']),
      mediaType: json['media_type'] as String?,
    );

Map<String, dynamic> _$TmdbPersonCreditToJson(_TmdbPersonCredit instance) =>
    <String, dynamic>{
      'id': instance.id,
      'title': instance.title,
      'character': instance.character,
      'poster_path': instance.posterPath,
      'release_date': instance.releaseDate,
      'vote_average': instance.voteAverage,
      'media_type': instance.mediaType,
    };

_TmdbPersonCreditsRes _$TmdbPersonCreditsResFromJson(
  Map<String, dynamic> json,
) => _TmdbPersonCreditsRes(
  cast:
      (json['cast'] as List<dynamic>?)
          ?.map((e) => TmdbPersonCredit.fromJson(e as Map<String, dynamic>))
          .toList() ??
      const <TmdbPersonCredit>[],
);

Map<String, dynamic> _$TmdbPersonCreditsResToJson(
  _TmdbPersonCreditsRes instance,
) => <String, dynamic>{'cast': instance.cast};

_TmdbGenre _$TmdbGenreFromJson(Map<String, dynamic> json) => _TmdbGenre(
  id: _intRequired(json['id']),
  name: json['name'] == null ? '' : _strOrEmpty(json['name']),
);

Map<String, dynamic> _$TmdbGenreToJson(_TmdbGenre instance) =>
    <String, dynamic>{'id': instance.id, 'name': instance.name};

_TmdbMediaDetail _$TmdbMediaDetailFromJson(Map<String, dynamic> json) =>
    _TmdbMediaDetail(
      id: _intRequired(json['id']),
      title: json['title'] == null ? '' : _strOrEmpty(json['title']),
      posterPath: json['poster_path'] as String?,
      backdropPath: json['backdrop_path'] as String?,
      releaseDate: json['release_date'] as String?,
      genres:
          (json['genres'] as List<dynamic>?)
              ?.map((e) => TmdbGenre.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbGenre>[],
      runtime: _intOrNull(json['runtime']),
      tagline: json['tagline'] as String?,
      overview: json['overview'] as String?,
      status: json['status'] as String?,
      homepage: json['homepage'] as String?,
      voteAverage: _doubleOrNull(json['vote_average']),
      voteCount: _intOrNull(json['vote_count']),
      revenue: _intOrNull(json['revenue']),
      budget: _intOrNull(json['budget']),
    );

Map<String, dynamic> _$TmdbMediaDetailToJson(_TmdbMediaDetail instance) =>
    <String, dynamic>{
      'id': instance.id,
      'title': instance.title,
      'poster_path': instance.posterPath,
      'backdrop_path': instance.backdropPath,
      'release_date': instance.releaseDate,
      'genres': instance.genres,
      'runtime': instance.runtime,
      'tagline': instance.tagline,
      'overview': instance.overview,
      'status': instance.status,
      'homepage': instance.homepage,
      'vote_average': instance.voteAverage,
      'vote_count': instance.voteCount,
      'revenue': instance.revenue,
      'budget': instance.budget,
    };

_TmdbImage _$TmdbImageFromJson(Map<String, dynamic> json) => _TmdbImage(
  filePath: json['file_path'] == null ? '' : _strOrEmpty(json['file_path']),
  width: json['width'] == null ? 0 : _intOrZero(json['width']),
  height: json['height'] == null ? 0 : _intOrZero(json['height']),
  voteAverage: _doubleOrNull(json['vote_average']),
  iso639: json['iso_639_1'] as String?,
);

Map<String, dynamic> _$TmdbImageToJson(_TmdbImage instance) =>
    <String, dynamic>{
      'file_path': instance.filePath,
      'width': instance.width,
      'height': instance.height,
      'vote_average': instance.voteAverage,
      'iso_639_1': instance.iso639,
    };

_TmdbImageSet _$TmdbImageSetFromJson(Map<String, dynamic> json) =>
    _TmdbImageSet(
      backdrops:
          (json['backdrops'] as List<dynamic>?)
              ?.map((e) => TmdbImage.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbImage>[],
      posters:
          (json['posters'] as List<dynamic>?)
              ?.map((e) => TmdbImage.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbImage>[],
      logos:
          (json['logos'] as List<dynamic>?)
              ?.map((e) => TmdbImage.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbImage>[],
    );

Map<String, dynamic> _$TmdbImageSetToJson(_TmdbImageSet instance) =>
    <String, dynamic>{
      'backdrops': instance.backdrops,
      'posters': instance.posters,
      'logos': instance.logos,
    };

_TmdbNetwork _$TmdbNetworkFromJson(Map<String, dynamic> json) => _TmdbNetwork(
  id: _intRequired(json['id']),
  name: json['name'] == null ? '' : _strOrEmpty(json['name']),
  logoPath: json['logo_path'] as String?,
  originCountry: json['origin_country'] as String?,
);

Map<String, dynamic> _$TmdbNetworkToJson(_TmdbNetwork instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'logo_path': instance.logoPath,
      'origin_country': instance.originCountry,
    };

_TmdbEnrichedDetail _$TmdbEnrichedDetailFromJson(Map<String, dynamic> json) =>
    _TmdbEnrichedDetail(
      detail: TmdbMediaDetail.fromJson(json['detail'] as Map<String, dynamic>),
      videos: json['videos'] == null
          ? null
          : TmdbVideosRes.fromJson(json['videos'] as Map<String, dynamic>),
      credits: json['credits'] == null
          ? null
          : TmdbCreditsRes.fromJson(json['credits'] as Map<String, dynamic>),
      recommendations: json['recommendations'] == null
          ? null
          : TmdbRecommendationsRes.fromJson(
              json['recommendations'] as Map<String, dynamic>,
            ),
      images: json['images'] == null
          ? null
          : TmdbImageSet.fromJson(json['images'] as Map<String, dynamic>),
      imdbId: json['imdbId'] as String?,
      networks:
          (json['networks'] as List<dynamic>?)
              ?.map((e) => TmdbNetwork.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <TmdbNetwork>[],
    );

Map<String, dynamic> _$TmdbEnrichedDetailToJson(_TmdbEnrichedDetail instance) =>
    <String, dynamic>{
      'detail': instance.detail,
      'videos': instance.videos,
      'credits': instance.credits,
      'recommendations': instance.recommendations,
      'images': instance.images,
      'imdbId': instance.imdbId,
      'networks': instance.networks,
    };
