describeOptOutLists method

Future<DescribeOptOutListsResult> describeOptOutLists({
  1. int? maxResults,
  2. String? nextToken,
  3. List<String>? optOutListNames,
  4. Owner? owner,
})

Describes the specified opt-out list or all opt-out lists in your account.

If you specify opt-out list names, the output includes information for only the specified opt-out lists. Opt-out lists include only those that meet the filter criteria. If you don't specify opt-out list names or filters, the output includes information for all opt-out lists.

If you specify an opt-out list name that isn't valid, an error is returned.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter maxResults : The maximum number of results to return per each request.

Parameter nextToken : The token to be used for the next set of paginated results. You don't need to supply a value for this field in the initial request.

Parameter optOutListNames : The OptOutLists to show the details of. This is an array of strings that can be either the OptOutListName or OptOutListArn.

Parameter owner : Use SELF to filter the list of Opt-Out List to ones your account owns or use SHARED to filter on Opt-Out List shared with your account. The Owner and OptOutListNames parameters can't be used at the same time.

Implementation

Future<DescribeOptOutListsResult> describeOptOutLists({
  int? maxResults,
  String? nextToken,
  List<String>? optOutListNames,
  Owner? owner,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.DescribeOptOutLists'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (optOutListNames != null) 'OptOutListNames': optOutListNames,
      if (owner != null) 'Owner': owner.value,
    },
  );

  return DescribeOptOutListsResult.fromJson(jsonResponse.body);
}