fromJson static method
Returns a new GetCallSessionParticipantStatsDetailsResponse instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static GetCallSessionParticipantStatsDetailsResponse? 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(() {
assert(json.containsKey(r'call_id'),
'Required key "GetCallSessionParticipantStatsDetailsResponse[call_id]" is missing from JSON.');
assert(json[r'call_id'] != null,
'Required key "GetCallSessionParticipantStatsDetailsResponse[call_id]" has a null value in JSON.');
assert(json.containsKey(r'call_session_id'),
'Required key "GetCallSessionParticipantStatsDetailsResponse[call_session_id]" is missing from JSON.');
assert(json[r'call_session_id'] != null,
'Required key "GetCallSessionParticipantStatsDetailsResponse[call_session_id]" has a null value in JSON.');
assert(json.containsKey(r'call_type'),
'Required key "GetCallSessionParticipantStatsDetailsResponse[call_type]" is missing from JSON.');
assert(json[r'call_type'] != null,
'Required key "GetCallSessionParticipantStatsDetailsResponse[call_type]" has a null value in JSON.');
assert(json.containsKey(r'duration'),
'Required key "GetCallSessionParticipantStatsDetailsResponse[duration]" is missing from JSON.');
assert(json[r'duration'] != null,
'Required key "GetCallSessionParticipantStatsDetailsResponse[duration]" has a null value in JSON.');
assert(json.containsKey(r'user_id'),
'Required key "GetCallSessionParticipantStatsDetailsResponse[user_id]" is missing from JSON.');
assert(json[r'user_id'] != null,
'Required key "GetCallSessionParticipantStatsDetailsResponse[user_id]" has a null value in JSON.');
assert(json.containsKey(r'user_session_id'),
'Required key "GetCallSessionParticipantStatsDetailsResponse[user_session_id]" is missing from JSON.');
assert(json[r'user_session_id'] != null,
'Required key "GetCallSessionParticipantStatsDetailsResponse[user_session_id]" has a null value in JSON.');
return true;
}());
return GetCallSessionParticipantStatsDetailsResponse(
callId: mapValueOfType<String>(json, r'call_id')!,
callSessionId: mapValueOfType<String>(json, r'call_session_id')!,
callType: mapValueOfType<String>(json, r'call_type')!,
duration: mapValueOfType<String>(json, r'duration')!,
publisher: ParticipantSeriesPublisherStats.fromJson(json[r'publisher']),
subscriber:
ParticipantSeriesSubscriberStats.fromJson(json[r'subscriber']),
timeframe: ParticipantSeriesTimeframe.fromJson(json[r'timeframe']),
user: ParticipantSeriesUserStats.fromJson(json[r'user']),
userId: mapValueOfType<String>(json, r'user_id')!,
userSessionId: mapValueOfType<String>(json, r'user_session_id')!,
);
}
return null;
}