81 lines
2.1 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 State {
/// Returns a new [State] instance.
State({
this.name,
this.value,
});
String name;
String value;
@override
bool operator ==(Object other) => identical(this, other) || other is State &&
other.name == name &&
other.value == value;
@override
int get hashCode =>
(name == null ? 0 : name.hashCode) +
(value == null ? 0 : value.hashCode);
@override
String toString() => 'State[name=$name, value=$value]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (name != null) {
json[r'name'] = name;
}
if (value != null) {
json[r'value'] = value;
}
return json;
}
/// Returns a new [State] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static State fromJson(Map<String, dynamic> json) => json == null
? null
: State(
name: json[r'name'],
value: json[r'value'],
);
static List<State> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <State>[]
: json.map((v) => State.fromJson(v)).toList(growable: true == growable);
static Map<String, State> mapFromJson(Map<String, dynamic> json) {
final map = <String, State>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = State.fromJson(v));
}
return map;
}
// maps a json object with a list of State-objects as value to a dart map
static Map<String, List<State>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<State>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = State.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}