deleteProject method

Future<DeleteProjectResult> deleteProject({
  1. required String id,
  2. String? clientRequestToken,
  3. bool? deleteStack,
})

Deletes a project, including project resources. Does not delete users associated with the project, but does delete the IAM roles that allowed access to the project.

May throw ConcurrentModificationException. May throw ValidationException. May throw InvalidServiceRoleException.

Parameter id : The ID of the project to be deleted in AWS CodeStar.

Parameter clientRequestToken : A user- or system-generated token that identifies the entity that requested project deletion. This token can be used to repeat the request.

Parameter deleteStack : Whether to send a delete request for the primary stack in AWS CloudFormation originally used to generate the project and its resources. This option will delete all AWS resources for the project (except for any buckets in Amazon S3) as well as deleting the project itself. Recommended for most use cases.

Implementation

Future<DeleteProjectResult> deleteProject({
  required String id,
  String? clientRequestToken,
  bool? deleteStack,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    2,
    15,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeStar_20170419.DeleteProject'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      if (clientRequestToken != null)
        'clientRequestToken': clientRequestToken,
      if (deleteStack != null) 'deleteStack': deleteStack,
    },
  );

  return DeleteProjectResult.fromJson(jsonResponse.body);
}