GetExtensionResponse.fromMap constructor

GetExtensionResponse.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory GetExtensionResponse.fromMap(Map<String, dynamic> map) {
  return GetExtensionResponse(
    id: map['id'] is String
        ? int.parse(map['id'] as String)
        : map['id'] as int,
    sipServer: SipServer.fromMap(map['sip_server'] as Map<String, dynamic>),
    username: map['username'] as String,
    password: map['password'] as String,
    displayName: map['display_name'] as String,
    enabled: map['enabled'] is String
        ? map['enabled'].toLowerCase() == 'true'
        : map['enabled'] as bool,
  );
}