updateIdentity method

Future<void> updateIdentity({
  1. String? contactId,
  2. String? userId,
  3. String? organizationId,
  4. String? propertyId,
})

Implementation

Future<void> updateIdentity({
  String? contactId,
  String? userId,
  String? organizationId,
  String? propertyId,
}) async {
  var changed = false;
  if (contactId != null && contactId != this.contactId) {
    this.contactId = contactId;
    changed = true;
  }
  if (userId != null && userId != this.userId) {
    this.userId = userId;
    changed = true;
  }
  if (organizationId != null && organizationId != this.organizationId) {
    this.organizationId = organizationId;
    changed = true;
  }
  if (propertyId != null && propertyId != this.propertyId) {
    this.propertyId = propertyId;
    changed = true;
  }
  if (changed) {
    _currentETag = null;
    await _fetch();
  }
}