listMailDomains method
Lists the mail domains in a given WorkMail organization.
May throw InvalidParameterException.
May throw OrganizationNotFoundException.
May throw OrganizationStateException.
Parameter organizationId :
The WorkMail organization for which to list domains.
Parameter maxResults :
The maximum number of results to return in a single call.
Parameter nextToken :
The token to use to retrieve the next page of results. The first call does
not require a token.
Implementation
Future<ListMailDomainsResponse> listMailDomains({
required String organizationId,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'WorkMailService.ListMailDomains'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'OrganizationId': organizationId,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListMailDomainsResponse.fromJson(jsonResponse.body);
}