public StageDeclaration withOnSuccess(SuccessConditions onSuccess) {
        setOnSuccess(onSuccess);
        return this;
    }
<p>
The method to use when a stage has succeeded. For example, configuring this field for conditions will allow the
stage to succeed when the conditions are met.
</p>

@param onSuccess
       The method to use when a stage has succeeded. For example, configuring this field for conditions will
       allow the stage to succeed when the conditions are met.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/StageDeclaration.java