listDeploymentGroups method

Future<ListDeploymentGroupsOutput> listDeploymentGroups({
  1. required String applicationName,
  2. String? nextToken,
})

Lists the deployment groups for an application registered with the IAM user or AWS account.

May throw ApplicationNameRequiredException. May throw InvalidApplicationNameException. May throw ApplicationDoesNotExistException. May throw InvalidNextTokenException.

Parameter applicationName : The name of an AWS CodeDeploy application associated with the IAM user or AWS account.

Parameter nextToken : An identifier returned from the previous list deployment groups call. It can be used to return the next set of deployment groups in the list.

Implementation

Future<ListDeploymentGroupsOutput> listDeploymentGroups({
  required String applicationName,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(applicationName, 'applicationName');
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    100,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.ListDeploymentGroups'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'applicationName': applicationName,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListDeploymentGroupsOutput.fromJson(jsonResponse.body);
}