getUserId method

Future<GetUserIdResponse> getUserId({
  1. required AlternateIdentifier alternateIdentifier,
  2. required String identityStoreId,
})

Retrieves the UserId in an identity store.

May throw ResourceNotFoundException. May throw ValidationException.

Parameter alternateIdentifier : A unique identifier for a user or group that is not the primary identifier. This value can be an identifier from an external identity provider (IdP) that is associated with the user, the group, or a unique attribute. For the unique attribute, the only valid paths are userName and emails.value.

Parameter identityStoreId : The globally unique identifier for the identity store.

Implementation

Future<GetUserIdResponse> getUserId({
  required AlternateIdentifier alternateIdentifier,
  required String identityStoreId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSIdentityStore.GetUserId'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AlternateIdentifier': alternateIdentifier,
      'IdentityStoreId': identityStoreId,
    },
  );

  return GetUserIdResponse.fromJson(jsonResponse.body);
}