Map<String, dynamic> get attributes => hasEmptyAttributes ? <String, dynamic>{} : _attributes!.map((key, value) => MapEntry<String, dynamic>( key, value.isCollection ? value.values : value.value));