setPrincipalTagAttributeMap method
You can use this operation to use default (username and clientID) attribute or custom attribute mappings.
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotAuthorizedException.
May throw ResourceNotFoundException.
May throw TooManyRequestsException.
Parameter identityPoolId :
The ID of the Identity Pool you want to set attribute mappings for.
Parameter identityProviderName :
The provider name you want to use for attribute mappings.
Parameter principalTags :
You can use this operation to add principal tags.
Parameter useDefaults :
You can use this operation to use default (username and clientID)
attribute mappings.
Implementation
Future<SetPrincipalTagAttributeMapResponse> setPrincipalTagAttributeMap({
required String identityPoolId,
required String identityProviderName,
Map<String, String>? principalTags,
bool? useDefaults,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityService.SetPrincipalTagAttributeMap'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'IdentityPoolId': identityPoolId,
'IdentityProviderName': identityProviderName,
if (principalTags != null) 'PrincipalTags': principalTags,
if (useDefaults != null) 'UseDefaults': useDefaults,
},
);
return SetPrincipalTagAttributeMapResponse.fromJson(jsonResponse.body);
}