101 lines
2.8 KiB
Dart

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class OddNice {
/// Returns a new [OddNice] instance.
OddNice({
this.teams,
this.commenceTime,
this.homeTeam,
this.odds,
});
List<String> teams;
int commenceTime;
String homeTeam;
OneOfOddH2H odds;
@override
bool operator ==(Object other) => identical(this, other) || other is OddNice &&
other.teams == teams &&
other.commenceTime == commenceTime &&
other.homeTeam == homeTeam &&
other.odds == odds;
@override
int get hashCode =>
(teams == null ? 0 : teams.hashCode) +
(commenceTime == null ? 0 : commenceTime.hashCode) +
(homeTeam == null ? 0 : homeTeam.hashCode) +
(odds == null ? 0 : odds.hashCode);
@override
String toString() => 'OddNice[teams=$teams, commenceTime=$commenceTime, homeTeam=$homeTeam, odds=$odds]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (teams != null) {
json[r'teams'] = teams;
}
if (commenceTime != null) {
json[r'commence_time'] = commenceTime;
}
if (homeTeam != null) {
json[r'home_team'] = homeTeam;
}
if (odds != null) {
json[r'odds'] = odds;
}
return json;
}
/// Returns a new [OddNice] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static OddNice fromJson(Map<String, dynamic> json) => json == null
? null
: OddNice(
teams: json[r'teams'] == null
? null
: (json[r'teams'] as List).cast<String>(),
commenceTime: json[r'commence_time'],
homeTeam: json[r'home_team'],
odds: OneOfOddH2H.fromJson(json[r'odds']),
);
static List<OddNice> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <OddNice>[]
: json.map((v) => OddNice.fromJson(v)).toList(growable: true == growable);
static Map<String, OddNice> mapFromJson(Map<String, dynamic> json) {
final map = <String, OddNice>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = OddNice.fromJson(v));
}
return map;
}
// maps a json object with a list of OddNice-objects as value to a dart map
static Map<String, List<OddNice>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<OddNice>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = OddNice.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}