io.cloudshiftdev.awscdk.services.codepipeline.CommonActionProps.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.codepipeline
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.Number
import kotlin.String
import kotlin.Unit
/**
* Common properties shared by all Actions.
*
* Example:
*
* ```
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import io.cloudshiftdev.awscdk.services.codepipeline.*;
* CommonActionProps commonActionProps = CommonActionProps.builder()
* .actionName("actionName")
* // the properties below are optional
* .runOrder(123)
* .variablesNamespace("variablesNamespace")
* .build();
* ```
*/
public interface CommonActionProps {
/**
* The physical, human-readable name of the Action.
*
* Note that Action names must be unique within a single Stage.
*/
public fun actionName(): String
/**
* The runOrder property for this Action.
*
* RunOrder determines the relative order in which multiple Actions in the same Stage execute.
*
* Default: 1
*
* [Documentation](https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html)
*/
public fun runOrder(): Number? = unwrap(this).getRunOrder()
/**
* The name of the namespace to use for variables emitted by this action.
*
* Default: - a name will be generated, based on the stage and action names,
* if any of the action's variables were referenced - otherwise,
* no namespace will be set
*/
public fun variablesNamespace(): String? = unwrap(this).getVariablesNamespace()
/**
* A builder for [CommonActionProps]
*/
@CdkDslMarker
public interface Builder {
/**
* @param actionName The physical, human-readable name of the Action.
* Note that Action names must be unique within a single Stage.
*/
public fun actionName(actionName: String)
/**
* @param runOrder The runOrder property for this Action.
* RunOrder determines the relative order in which multiple Actions in the same Stage execute.
*/
public fun runOrder(runOrder: Number)
/**
* @param variablesNamespace The name of the namespace to use for variables emitted by this
* action.
*/
public fun variablesNamespace(variablesNamespace: String)
}
private class BuilderImpl : Builder {
private val cdkBuilder: software.amazon.awscdk.services.codepipeline.CommonActionProps.Builder =
software.amazon.awscdk.services.codepipeline.CommonActionProps.builder()
/**
* @param actionName The physical, human-readable name of the Action.
* Note that Action names must be unique within a single Stage.
*/
override fun actionName(actionName: String) {
cdkBuilder.actionName(actionName)
}
/**
* @param runOrder The runOrder property for this Action.
* RunOrder determines the relative order in which multiple Actions in the same Stage execute.
*/
override fun runOrder(runOrder: Number) {
cdkBuilder.runOrder(runOrder)
}
/**
* @param variablesNamespace The name of the namespace to use for variables emitted by this
* action.
*/
override fun variablesNamespace(variablesNamespace: String) {
cdkBuilder.variablesNamespace(variablesNamespace)
}
public fun build(): software.amazon.awscdk.services.codepipeline.CommonActionProps =
cdkBuilder.build()
}
private class Wrapper(
cdkObject: software.amazon.awscdk.services.codepipeline.CommonActionProps,
) : CdkObject(cdkObject),
CommonActionProps {
/**
* The physical, human-readable name of the Action.
*
* Note that Action names must be unique within a single Stage.
*/
override fun actionName(): String = unwrap(this).getActionName()
/**
* The runOrder property for this Action.
*
* RunOrder determines the relative order in which multiple Actions in the same Stage execute.
*
* Default: 1
*
* [Documentation](https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html)
*/
override fun runOrder(): Number? = unwrap(this).getRunOrder()
/**
* The name of the namespace to use for variables emitted by this action.
*
* Default: - a name will be generated, based on the stage and action names,
* if any of the action's variables were referenced - otherwise,
* no namespace will be set
*/
override fun variablesNamespace(): String? = unwrap(this).getVariablesNamespace()
}
public companion object {
public operator fun invoke(block: Builder.() -> Unit = {}): CommonActionProps {
val builderImpl = BuilderImpl()
return Wrapper(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.codepipeline.CommonActionProps):
CommonActionProps = CdkObjectWrappers.wrap(cdkObject) as? CommonActionProps ?:
Wrapper(cdkObject)
internal fun unwrap(wrapped: CommonActionProps):
software.amazon.awscdk.services.codepipeline.CommonActionProps = (wrapped as
CdkObject).cdkObject as software.amazon.awscdk.services.codepipeline.CommonActionProps
}
}