Skip to content
v2.273.0

ValidationResults Class ​

A collection of validation results.

Example ​

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
# 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
// 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));
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 });
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 ​

ts
new ValidationResults(results?: ValidationResult[])
python
ValidationResults(results: typing.Optional[typing.List[ValidationResult]] = None)
java
new ValidationResults(List<ValidationResult> results)
csharp
new ValidationResults(ValidationResult[]? results = null)
go
NewValidationResults(Results *[]ValidationResult)

Properties ​

isSuccessbooleanis_successboolisSuccessBooleanIsSuccessboolIsSuccess*boolrequired#
resultsValidationResult[]resultstyping.List[ValidationResult]resultsList<ValidationResult>ResultsValidationResult[]Results*[]ValidationResultrequired#

Methods ​

collect(result: ValidationResult): voiddef collect(self, result: ValidationResult) -> Nonepublic void collect(ValidationResult result)public void Collect(ValidationResult result)func Collect(Result ValidationResult)#
errorTreeList(): stringdef error_tree_list(self, ) -> strpublic String errorTreeList()public string ErrorTreeList()func ErrorTreeList() *string#
wrap(message: string): ValidationResultdef wrap(self, message: str) -> ValidationResultpublic ValidationResult wrap(String message)public ValidationResult Wrap(string message)func 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.