putEmailMonitoringConfiguration method
Creates or updates the email monitoring configuration for a specified organization.
May throw InvalidParameterException.
May throw OrganizationNotFoundException.
May throw OrganizationStateException.
May throw ResourceNotFoundException.
Parameter logGroupArn :
The Amazon Resource Name (ARN) of the CloudWatch Log group associated with
the email monitoring configuration.
Parameter organizationId :
The ID of the organization for which the email monitoring configuration is
set.
Parameter roleArn :
The Amazon Resource Name (ARN) of the IAM Role associated with the email
monitoring configuration. If absent, the IAM Role Arn of
AWSServiceRoleForAmazonWorkMailEvents will be used.
Implementation
Future<void> putEmailMonitoringConfiguration({
required String logGroupArn,
required String organizationId,
String? roleArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'WorkMailService.PutEmailMonitoringConfiguration'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'LogGroupArn': logGroupArn,
'OrganizationId': organizationId,
if (roleArn != null) 'RoleArn': roleArn,
},
);
}