# ValidationResults

A collection of validation results.

Used as argument in: [ValidationResult (initializer)](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.ValidationResult.html#initializer)

- Source: [`core/lib/runtime.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/runtime.ts#L188)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';

declare const validationResult: cdk.ValidationResult;
const validationResults = new cdk.ValidationResults(/* all optional props */ [validationResult]);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

# validation_result: cdk.ValidationResult

validation_results = cdk.ValidationResults([validation_result])
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

ValidationResult validationResult;

ValidationResults validationResults = new ValidationResults(List.of(validationResult));
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

ValidationResult validationResult;

var validationResults = new ValidationResults(new [] { validationResult });
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

var validationResult ValidationResult

validationResults := cdk.NewValidationResults([]ValidationResult{
	validationResult,
})
```

## Initializer

TypeScript:

```ts
new ValidationResults(results?: ValidationResult[])
```

Python:

```python
ValidationResults(results: typing.Optional[typing.List[ValidationResult]] = None)
```

Java:

```java
new ValidationResults(List<ValidationResult> results)
```

C# / .NET:

```csharp
new ValidationResults(ValidationResult[]? results = null)
```

Golang:

```go
NewValidationResults(Results *[]ValidationResult)
```

## Properties

- `isSuccess`: boolean

- `results`: [ValidationResult](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.ValidationResult.html)[]

## Methods

- `collect(result: ValidationResult): void`

- `errorTreeList(): string`

- `wrap(message: string): ValidationResult` — Wrap up all validation results into a single tree node.

  If there are failures in the collection, add a message, otherwise
  return a success.
