getAnomalySubscriptions method

Future<GetAnomalySubscriptionsResponse> getAnomalySubscriptions({
  1. int? maxResults,
  2. String? monitorArn,
  3. String? nextPageToken,
  4. List<String>? subscriptionArnList,
})

Retrieves the cost anomaly subscription objects for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs).

May throw LimitExceededException. May throw UnknownSubscriptionException. May throw InvalidNextTokenException.

Parameter maxResults : The number of entries a paginated response contains.

Parameter monitorArn : Cost anomaly monitor ARNs.

Parameter nextPageToken : The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.

Parameter subscriptionArnList : A list of cost anomaly subscription ARNs.

Implementation

Future<GetAnomalySubscriptionsResponse> getAnomalySubscriptions({
  int? maxResults,
  String? monitorArn,
  String? nextPageToken,
  List<String>? subscriptionArnList,
}) async {
  _s.validateStringLength(
    'monitorArn',
    monitorArn,
    0,
    1024,
  );
  _s.validateStringLength(
    'nextPageToken',
    nextPageToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSInsightsIndexService.GetAnomalySubscriptions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (monitorArn != null) 'MonitorArn': monitorArn,
      if (nextPageToken != null) 'NextPageToken': nextPageToken,
      if (subscriptionArnList != null)
        'SubscriptionArnList': subscriptionArnList,
    },
  );

  return GetAnomalySubscriptionsResponse.fromJson(jsonResponse.body);
}