io.cloudshiftdev.awscdk.services.stepfunctions.tasks.EksCallProps.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.stepfunctions.tasks
import io.cloudshiftdev.awscdk.Duration
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import io.cloudshiftdev.awscdk.services.eks.ICluster
import io.cloudshiftdev.awscdk.services.stepfunctions.Credentials
import io.cloudshiftdev.awscdk.services.stepfunctions.IntegrationPattern
import io.cloudshiftdev.awscdk.services.stepfunctions.TaskInput
import io.cloudshiftdev.awscdk.services.stepfunctions.TaskStateBaseProps
import io.cloudshiftdev.awscdk.services.stepfunctions.Timeout
import kotlin.Any
import kotlin.Deprecated
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Properties for calling a EKS endpoint with EksCall.
*
* Example:
*
* ```
* import io.cloudshiftdev.awscdk.services.eks.*;
* Cluster myEksCluster = Cluster.Builder.create(this, "my sample cluster")
* .version(KubernetesVersion.V1_18)
* .clusterName("myEksCluster")
* .build();
* EksCall.Builder.create(this, "Call a EKS Endpoint")
* .cluster(myEksCluster)
* .httpMethod(HttpMethods.GET)
* .httpPath("/api/v1/namespaces/default/pods")
* .build();
* ```
*/
public interface EksCallProps : TaskStateBaseProps {
/**
* The EKS cluster.
*/
public fun cluster(): ICluster
/**
* HTTP method ("GET", "POST", "PUT", ...) part of HTTP request.
*/
public fun httpMethod(): HttpMethods
/**
* HTTP path of the Kubernetes REST API operation For example: /api/v1/namespaces/default/pods.
*/
public fun httpPath(): String
/**
* Query Parameters part of HTTP request.
*
* Default: - no query parameters
*/
public fun queryParameters(): Map> = unwrap(this).getQueryParameters() ?:
emptyMap()
/**
* Request body part of HTTP request.
*
* Default: - No request body
*/
public fun requestBody(): TaskInput? = unwrap(this).getRequestBody()?.let(TaskInput::wrap)
/**
* A builder for [EksCallProps]
*/
@CdkDslMarker
public interface Builder {
/**
* @param cluster The EKS cluster.
*/
public fun cluster(cluster: ICluster)
/**
* @param comment An optional description for this state.
*/
public fun comment(comment: String)
/**
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
* This enables cross-account resource invocations.
*/
public fun credentials(credentials: Credentials)
/**
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
* This enables cross-account resource invocations.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("ad471e465b2fd24538d4e97901e8c85bfe0b1fc2c8e9d31b20f55b906f6ce9c5")
public fun credentials(credentials: Credentials.Builder.() -> Unit)
/**
* @param heartbeat Timeout for the heartbeat.
* @deprecated use `heartbeatTimeout`
*/
@Deprecated(message = "deprecated in CDK")
public fun heartbeat(heartbeat: Duration)
/**
* @param heartbeatTimeout Timeout for the heartbeat.
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*/
public fun heartbeatTimeout(heartbeatTimeout: Timeout)
/**
* @param httpMethod HTTP method ("GET", "POST", "PUT", ...) part of HTTP request.
*/
public fun httpMethod(httpMethod: HttpMethods)
/**
* @param httpPath HTTP path of the Kubernetes REST API operation For example:
* /api/v1/namespaces/default/pods.
*/
public fun httpPath(httpPath: String)
/**
* @param inputPath JSONPath expression to select part of the state to be the input to this
* state.
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*/
public fun inputPath(inputPath: String)
/**
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon
* States Language.
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*/
public fun integrationPattern(integrationPattern: IntegrationPattern)
/**
* @param outputPath JSONPath expression to select select a portion of the state output to pass
* to the next state.
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*/
public fun outputPath(outputPath: String)
/**
* @param queryParameters Query Parameters part of HTTP request.
*/
public fun queryParameters(queryParameters: Map>)
/**
* @param requestBody Request body part of HTTP request.
*/
public fun requestBody(requestBody: TaskInput)
/**
* @param resultPath JSONPath expression to indicate where to inject the state's output.
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*/
public fun resultPath(resultPath: String)
/**
* @param resultSelector The JSON that will replace the state's raw result and become the
* effective result before ResultPath is applied.
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*/
public fun resultSelector(resultSelector: Map)
/**
* @param stateName Optional name for this state.
*/
public fun stateName(stateName: String)
/**
* @param taskTimeout Timeout for the task.
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*/
public fun taskTimeout(taskTimeout: Timeout)
/**
* @param timeout Timeout for the task.
* @deprecated use `taskTimeout`
*/
@Deprecated(message = "deprecated in CDK")
public fun timeout(timeout: Duration)
}
private class BuilderImpl : Builder {
private val cdkBuilder: software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps.Builder
= software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps.builder()
/**
* @param cluster The EKS cluster.
*/
override fun cluster(cluster: ICluster) {
cdkBuilder.cluster(cluster.let(ICluster.Companion::unwrap))
}
/**
* @param comment An optional description for this state.
*/
override fun comment(comment: String) {
cdkBuilder.comment(comment)
}
/**
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
* This enables cross-account resource invocations.
*/
override fun credentials(credentials: Credentials) {
cdkBuilder.credentials(credentials.let(Credentials.Companion::unwrap))
}
/**
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
* This enables cross-account resource invocations.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("ad471e465b2fd24538d4e97901e8c85bfe0b1fc2c8e9d31b20f55b906f6ce9c5")
override fun credentials(credentials: Credentials.Builder.() -> Unit): Unit =
credentials(Credentials(credentials))
/**
* @param heartbeat Timeout for the heartbeat.
* @deprecated use `heartbeatTimeout`
*/
@Deprecated(message = "deprecated in CDK")
override fun heartbeat(heartbeat: Duration) {
cdkBuilder.heartbeat(heartbeat.let(Duration.Companion::unwrap))
}
/**
* @param heartbeatTimeout Timeout for the heartbeat.
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*/
override fun heartbeatTimeout(heartbeatTimeout: Timeout) {
cdkBuilder.heartbeatTimeout(heartbeatTimeout.let(Timeout.Companion::unwrap))
}
/**
* @param httpMethod HTTP method ("GET", "POST", "PUT", ...) part of HTTP request.
*/
override fun httpMethod(httpMethod: HttpMethods) {
cdkBuilder.httpMethod(httpMethod.let(HttpMethods.Companion::unwrap))
}
/**
* @param httpPath HTTP path of the Kubernetes REST API operation For example:
* /api/v1/namespaces/default/pods.
*/
override fun httpPath(httpPath: String) {
cdkBuilder.httpPath(httpPath)
}
/**
* @param inputPath JSONPath expression to select part of the state to be the input to this
* state.
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*/
override fun inputPath(inputPath: String) {
cdkBuilder.inputPath(inputPath)
}
/**
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon
* States Language.
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*/
override fun integrationPattern(integrationPattern: IntegrationPattern) {
cdkBuilder.integrationPattern(integrationPattern.let(IntegrationPattern.Companion::unwrap))
}
/**
* @param outputPath JSONPath expression to select select a portion of the state output to pass
* to the next state.
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*/
override fun outputPath(outputPath: String) {
cdkBuilder.outputPath(outputPath)
}
/**
* @param queryParameters Query Parameters part of HTTP request.
*/
override fun queryParameters(queryParameters: Map>) {
cdkBuilder.queryParameters(queryParameters)
}
/**
* @param requestBody Request body part of HTTP request.
*/
override fun requestBody(requestBody: TaskInput) {
cdkBuilder.requestBody(requestBody.let(TaskInput.Companion::unwrap))
}
/**
* @param resultPath JSONPath expression to indicate where to inject the state's output.
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*/
override fun resultPath(resultPath: String) {
cdkBuilder.resultPath(resultPath)
}
/**
* @param resultSelector The JSON that will replace the state's raw result and become the
* effective result before ResultPath is applied.
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*/
override fun resultSelector(resultSelector: Map) {
cdkBuilder.resultSelector(resultSelector.mapValues{CdkObjectWrappers.unwrap(it.value)})
}
/**
* @param stateName Optional name for this state.
*/
override fun stateName(stateName: String) {
cdkBuilder.stateName(stateName)
}
/**
* @param taskTimeout Timeout for the task.
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*/
override fun taskTimeout(taskTimeout: Timeout) {
cdkBuilder.taskTimeout(taskTimeout.let(Timeout.Companion::unwrap))
}
/**
* @param timeout Timeout for the task.
* @deprecated use `taskTimeout`
*/
@Deprecated(message = "deprecated in CDK")
override fun timeout(timeout: Duration) {
cdkBuilder.timeout(timeout.let(Duration.Companion::unwrap))
}
public fun build(): software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps =
cdkBuilder.build()
}
private class Wrapper(
cdkObject: software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps,
) : CdkObject(cdkObject),
EksCallProps {
/**
* The EKS cluster.
*/
override fun cluster(): ICluster = unwrap(this).getCluster().let(ICluster::wrap)
/**
* An optional description for this state.
*
* Default: - No comment
*/
override fun comment(): String? = unwrap(this).getComment()
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
*/
override fun credentials(): Credentials? = unwrap(this).getCredentials()?.let(Credentials::wrap)
/**
* (deprecated) Timeout for the heartbeat.
*
* Default: - None
*
* @deprecated use `heartbeatTimeout`
*/
@Deprecated(message = "deprecated in CDK")
override fun heartbeat(): Duration? = unwrap(this).getHeartbeat()?.let(Duration::wrap)
/**
* Timeout for the heartbeat.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*/
override fun heartbeatTimeout(): Timeout? =
unwrap(this).getHeartbeatTimeout()?.let(Timeout::wrap)
/**
* HTTP method ("GET", "POST", "PUT", ...) part of HTTP request.
*/
override fun httpMethod(): HttpMethods = unwrap(this).getHttpMethod().let(HttpMethods::wrap)
/**
* HTTP path of the Kubernetes REST API operation For example: /api/v1/namespaces/default/pods.
*/
override fun httpPath(): String = unwrap(this).getHttpPath()
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* Default: - The entire task input (JSON path '$')
*/
override fun inputPath(): String? = unwrap(this).getInputPath()
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
*
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*
* Default: - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and
* `EmrContainersStartJobRun`.
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)
*/
override fun integrationPattern(): IntegrationPattern? =
unwrap(this).getIntegrationPattern()?.let(IntegrationPattern::wrap)
/**
* JSONPath expression to select select a portion of the state output to pass to the next state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* Default: - The entire JSON node determined by the state input, the task result,
* and resultPath is passed to the next state (JSON path '$')
*/
override fun outputPath(): String? = unwrap(this).getOutputPath()
/**
* Query Parameters part of HTTP request.
*
* Default: - no query parameters
*/
override fun queryParameters(): Map> = unwrap(this).getQueryParameters() ?:
emptyMap()
/**
* Request body part of HTTP request.
*
* Default: - No request body
*/
override fun requestBody(): TaskInput? = unwrap(this).getRequestBody()?.let(TaskInput::wrap)
/**
* JSONPath expression to indicate where to inject the state's output.
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* Default: - Replaces the entire input with the result (JSON path '$')
*/
override fun resultPath(): String? = unwrap(this).getResultPath()
/**
* The JSON that will replace the state's raw result and become the effective result before
* ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* Default: - None
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector)
*/
override fun resultSelector(): Map = unwrap(this).getResultSelector() ?: emptyMap()
/**
* Optional name for this state.
*
* Default: - The construct ID will be used as state name
*/
override fun stateName(): String? = unwrap(this).getStateName()
/**
* Timeout for the task.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*/
override fun taskTimeout(): Timeout? = unwrap(this).getTaskTimeout()?.let(Timeout::wrap)
/**
* (deprecated) Timeout for the task.
*
* Default: - None
*
* @deprecated use `taskTimeout`
*/
@Deprecated(message = "deprecated in CDK")
override fun timeout(): Duration? = unwrap(this).getTimeout()?.let(Duration::wrap)
}
public companion object {
public operator fun invoke(block: Builder.() -> Unit = {}): EksCallProps {
val builderImpl = BuilderImpl()
return Wrapper(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps):
EksCallProps = CdkObjectWrappers.wrap(cdkObject) as? EksCallProps ?: Wrapper(cdkObject)
internal fun unwrap(wrapped: EksCallProps):
software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps = (wrapped as
CdkObject).cdkObject as software.amazon.awscdk.services.stepfunctions.tasks.EksCallProps
}
}