listPlanExecutions method

Future<ListPlanExecutionsResponse> listPlanExecutions({
  1. required String planArn,
  2. int? maxResults,
  3. String? nextToken,
  4. ExecutionState? state,
})

Lists the executions of a Region switch plan. This operation returns information about both current and historical executions.

May throw AccessDeniedException. May throw ResourceNotFoundException.

Parameter planArn : The ARN for the plan.

Parameter maxResults : The number of objects that you want to return with this call.

Parameter nextToken : Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.

Parameter state : The state of the plan execution. For example, the plan execution might be In Progress.

Implementation

Future<ListPlanExecutionsResponse> listPlanExecutions({
  required String planArn,
  int? maxResults,
  String? nextToken,
  ExecutionState? state,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'ArcRegionSwitch.ListPlanExecutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'planArn': planArn,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (state != null) 'state': state.value,
    },
  );

  return ListPlanExecutionsResponse.fromJson(jsonResponse.body);
}