MixinApplicator

class aws_cdk.MixinApplicator(scope, selector=None)

Bases: object

Applies mixins to constructs.

ExampleMetadata:

fixture=_generated

Example:

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

# construct_selector: cdk.IConstructSelector

mixin_applicator = cdk.MixinApplicator(self, construct_selector)
Parameters:

Methods

apply(*mixins)

Applies a mixin to selected constructs.

Parameters:

mixins (IMixin)

Return type:

MixinApplicator

require_all()

Requires all selected constructs to support the applied mixins.

Will only check for future call of apply(). Set this before calling apply() to take effect.

Example:

Mixins.of(scope).require_all().apply(MyMixin())
Return type:

MixinApplicator

require_any()

Requires at least one mixin to be successfully applied.

Will only check for future call of apply(). Set this before calling apply() to take effect.

Example:

Mixins.of(scope).require_any().apply(MyMixin())
Return type:

MixinApplicator

Attributes

report

Returns the successful mixin applications.

selected_constructs

The constructs that match the selector in the given scope.