getCSVHeader method

Future<GetCSVHeaderResponse> getCSVHeader({
  1. required String userPoolId,
})

Gets the header information for the .csv file to be used as input for the user import job.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw TooManyRequestsException. May throw NotAuthorizedException. May throw InternalErrorException.

Parameter userPoolId : The user pool ID for the user pool that the users are to be imported into.

Implementation

Future<GetCSVHeaderResponse> getCSVHeader({
  required String userPoolId,
}) async {
  ArgumentError.checkNotNull(userPoolId, 'userPoolId');
  _s.validateStringLength(
    'userPoolId',
    userPoolId,
    1,
    55,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.GetCSVHeader'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'UserPoolId': userPoolId,
    },
  );

  return GetCSVHeaderResponse.fromJson(jsonResponse.body);
}