User.fromJSON constructor

User.fromJSON(
  1. Map<String, dynamic> data
)

Implementation

factory User.fromJSON(Map<String, dynamic> data) {
	return User(
		(data["id"] as String),
		rev: (data["rev"] as String?),
		deletionDate: (data["deletionDate"] as int?),
		created: (data["created"] as int?),
		identifier: (data["identifier"] as List<dynamic>).map((x0) => Identifier.fromJSON(x0) ).toList(),
		name: (data["name"] as String?),
		properties: (data["properties"] as List<dynamic>).map((x0) => DecryptedPropertyStub.fromJSON(x0) ).toSet(),
		permissions: (data["permissions"] as List<dynamic>).map((x0) => Permission.fromJSON(x0) ).toSet(),
		roles: (data["roles"] as List<dynamic>).map((x0) => (x0 as String) ).toSet(),
		type: data["type"] == null ? null : UsersType.fromJSON(data["type"]),
		status: data["status"] == null ? null : UsersStatus.fromJSON(data["status"]),
		login: (data["login"] as String?),
		passwordHash: (data["passwordHash"] as String?),
		groupId: (data["groupId"] as String?),
		healthcarePartyId: (data["healthcarePartyId"] as String?),
		patientId: (data["patientId"] as String?),
		deviceId: (data["deviceId"] as String?),
		autoDelegations: (data["autoDelegations"] as Map<String, dynamic>).map((k0, v0) => MapEntry(DelegationTag.fromJSON(k0), (v0 as List<dynamic>).map((x1) => (x1 as String) ).toSet())),
		createdDate: data["createdDate"] == null ? null : DateTime.fromMillisecondsSinceEpoch(data["createdDate"] as int),
		termsOfUseDate: data["termsOfUseDate"] == null ? null : DateTime.fromMillisecondsSinceEpoch(data["termsOfUseDate"] as int),
		email: (data["email"] as String?),
		mobilePhone: (data["mobilePhone"] as String?),
		applicationTokens: (data["applicationTokens"] as Map<String, dynamic>).map((k0, v0) => MapEntry((k0 as String), (v0 as String))),
		authenticationTokens: (data["authenticationTokens"] as Map<String, dynamic>).map((k0, v0) => MapEntry((k0 as String), AuthenticationToken.fromJSON(v0))),
		systemMetadata: data["systemMetadata"] == null ? null : UserSystemMetadata.fromJSON(data["systemMetadata"]),
	);
}