User.fromJson constructor

User.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory User.fromJson(Map<String, dynamic> json) {
  return User(
    arn: json['Arn'] as String?,
    directoryUserId: json['DirectoryUserId'] as String?,
    hierarchyGroupId: json['HierarchyGroupId'] as String?,
    id: json['Id'] as String?,
    identityInfo: json['IdentityInfo'] != null
        ? UserIdentityInfo.fromJson(
            json['IdentityInfo'] as Map<String, dynamic>)
        : null,
    phoneConfig: json['PhoneConfig'] != null
        ? UserPhoneConfig.fromJson(
            json['PhoneConfig'] as Map<String, dynamic>)
        : null,
    routingProfileId: json['RoutingProfileId'] as String?,
    securityProfileIds: (json['SecurityProfileIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    tags: (json['Tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    username: json['Username'] as String?,
  );
}