software.amazon.awscdk.services.events.targets.CodePipeline Maven / Gradle / Ivy
Show all versions of events-targets Show documentation
package software.amazon.awscdk.services.events.targets;
/**
* Allows the pipeline to be used as an EventBridge rule target.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.21.0 (build 4262b22)", date = "2021-02-23T11:52:46.767Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.events.targets.$Module.class, fqn = "@aws-cdk/aws-events-targets.CodePipeline")
public class CodePipeline extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.events.IRuleTarget {
protected CodePipeline(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected CodePipeline(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param pipeline This parameter is required.
* @param options
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public CodePipeline(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codepipeline.IPipeline pipeline, final @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.events.targets.CodePipelineTargetOptions options) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(pipeline, "pipeline is required"), options });
}
/**
* @param pipeline This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public CodePipeline(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codepipeline.IPipeline pipeline) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(pipeline, "pipeline is required") });
}
/**
* Returns the rule target specification.
*
* NOTE: Do not use the various inputXxx
options. They can be set in a call to addTarget
.
*
* @param _rule This parameter is required.
* @param _id
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.events.RuleTargetConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.events.IRule _rule, final @org.jetbrains.annotations.Nullable java.lang.String _id) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.RuleTargetConfig.class), new Object[] { java.util.Objects.requireNonNull(_rule, "_rule is required"), _id });
}
/**
* Returns the rule target specification.
*
* NOTE: Do not use the various inputXxx
options. They can be set in a call to addTarget
.
*
* @param _rule This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.events.RuleTargetConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.events.IRule _rule) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.RuleTargetConfig.class), new Object[] { java.util.Objects.requireNonNull(_rule, "_rule is required") });
}
/**
* A fluent builder for {@link software.amazon.awscdk.services.events.targets.CodePipeline}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param pipeline This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.amazon.awscdk.services.codepipeline.IPipeline pipeline) {
return new Builder(pipeline);
}
private final software.amazon.awscdk.services.codepipeline.IPipeline pipeline;
private software.amazon.awscdk.services.events.targets.CodePipelineTargetOptions.Builder options;
private Builder(final software.amazon.awscdk.services.codepipeline.IPipeline pipeline) {
this.pipeline = pipeline;
}
/**
* The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.
*
* Default: - a new role will be created
*
* @return {@code this}
* @param eventRole The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder eventRole(final software.amazon.awscdk.services.iam.IRole eventRole) {
this.options().eventRole(eventRole);
return this;
}
/**
* @returns a newly built instance of {@link software.amazon.awscdk.services.events.targets.CodePipeline}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public software.amazon.awscdk.services.events.targets.CodePipeline build() {
return new software.amazon.awscdk.services.events.targets.CodePipeline(
this.pipeline,
this.options != null ? this.options.build() : null
);
}
private software.amazon.awscdk.services.events.targets.CodePipelineTargetOptions.Builder options() {
if (this.options == null) {
this.options = new software.amazon.awscdk.services.events.targets.CodePipelineTargetOptions.Builder();
}
return this.options;
}
}
}