listDomainDeliverabilityCampaigns method

Future<ListDomainDeliverabilityCampaignsResponse> listDomainDeliverabilityCampaigns({
  1. required DateTime endDate,
  2. required DateTime startDate,
  3. required String subscribedDomain,
  4. String? nextToken,
  5. int? pageSize,
})

Retrieve deliverability data for all the campaigns that used a specific domain to send email during a specified time range. This data is available for a domain only if you enabled the Deliverability dashboard (PutDeliverabilityDashboardOption operation) for the domain.

May throw TooManyRequestsException. May throw BadRequestException. May throw NotFoundException.

Parameter endDate : The last day, in Unix time format, that you want to obtain deliverability data for. This value has to be less than or equal to 30 days after the value of the StartDate parameter.

Parameter startDate : The first day, in Unix time format, that you want to obtain deliverability data for.

Parameter subscribedDomain : The domain to obtain deliverability data for.

Parameter nextToken : A token that’s returned from a previous call to the ListDomainDeliverabilityCampaigns operation. This token indicates the position of a campaign in the list of campaigns.

Parameter pageSize : The maximum number of results to include in response to a single call to the ListDomainDeliverabilityCampaigns operation. If the number of results is larger than the number that you specify in this parameter, the response includes a NextToken element, which you can use to obtain additional results.

Implementation

Future<ListDomainDeliverabilityCampaignsResponse>
    listDomainDeliverabilityCampaigns({
  required DateTime endDate,
  required DateTime startDate,
  required String subscribedDomain,
  String? nextToken,
  int? pageSize,
}) async {
  ArgumentError.checkNotNull(endDate, 'endDate');
  ArgumentError.checkNotNull(startDate, 'startDate');
  ArgumentError.checkNotNull(subscribedDomain, 'subscribedDomain');
  final $query = <String, List<String>>{
    'EndDate': [_s.iso8601ToJson(endDate).toString()],
    'StartDate': [_s.iso8601ToJson(startDate).toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (pageSize != null) 'PageSize': [pageSize.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v1/email/deliverability-dashboard/domains/${Uri.encodeComponent(subscribedDomain)}/campaigns',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListDomainDeliverabilityCampaignsResponse.fromJson(response);
}