linkIdentity method

Future linkIdentity({
  1. required String identityId,
  2. required String targetIdentityId,
  3. Map<String, dynamic>? linkAttrs,
})

link an identity to another identity so that if the first identity is accessed, the second identity (linked one; targetIdentityId) is presented instead.

Implementation

Future linkIdentity({
	required String identityId,
	required String targetIdentityId,
	Map<String,dynamic>? linkAttrs,
}) async {
	var url = '/link-identity';
	var params = <String,dynamic>{
		'identityId': identityId,
		'targetIdentityId': targetIdentityId
	};

	if (linkAttrs != null) {
		params["linkAttrs"] = linkAttrs;
	}

	var resp = await _invoke(url, params, true);

	if (resp['result'] != 'OK') throw resp['result'];
}