fromJson static method
Returns a new SIPChallengeRequest instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static SIPChallengeRequest? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
return true;
}());
return SIPChallengeRequest(
a1: mapValueOfType<String>(json, r'a1'),
algorithm: mapValueOfType<String>(json, r'algorithm'),
charset: mapValueOfType<String>(json, r'charset'),
cnonce: mapValueOfType<String>(json, r'cnonce'),
domain: json[r'domain'] is Iterable
? (json[r'domain'] as Iterable)
.cast<String>()
.toList(growable: false)
: const [],
method: mapValueOfType<String>(json, r'method'),
nc: mapValueOfType<String>(json, r'nc'),
nonce: mapValueOfType<String>(json, r'nonce'),
opaque: mapValueOfType<String>(json, r'opaque'),
qop: json[r'qop'] is Iterable
? (json[r'qop'] as Iterable).cast<String>().toList(growable: false)
: const [],
realm: mapValueOfType<String>(json, r'realm'),
response: mapValueOfType<String>(json, r'response'),
stale: mapValueOfType<bool>(json, r'stale'),
uri: mapValueOfType<String>(json, r'uri'),
userhash: mapValueOfType<bool>(json, r'userhash'),
username: mapValueOfType<String>(json, r'username'),
);
}
return null;
}