com.pulumi.awsnative.transfer.kotlin.Workflow.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.transfer.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.transfer.kotlin.outputs.WorkflowStep
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.transfer.kotlin.outputs.WorkflowStep.Companion.toKotlin as workflowStepToKotlin
/**
* Builder for [Workflow].
*/
@PulumiTagMarker
public class WorkflowResourceBuilder internal constructor() {
public var name: String? = null
public var args: WorkflowArgs = WorkflowArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend WorkflowArgsBuilder.() -> Unit) {
val builder = WorkflowArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Workflow {
val builtJavaResource = com.pulumi.awsnative.transfer.Workflow(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Workflow(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Transfer::Workflow
*/
public class Workflow internal constructor(
override val javaResource: com.pulumi.awsnative.transfer.Workflow,
) : KotlinCustomResource(javaResource, WorkflowMapper) {
/**
* Specifies the unique Amazon Resource Name (ARN) for the workflow.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* A textual description for the workflow.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the steps (actions) to take if any errors are encountered during execution of the workflow.
*/
public val onExceptionSteps: Output>?
get() = javaResource.onExceptionSteps().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> workflowStepToKotlin(args0) }) })
}).orElse(null)
})
/**
* Specifies the details for the steps that are in the specified workflow.
*/
public val steps: Output>
get() = javaResource.steps().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
workflowStepToKotlin(args0)
})
})
})
/**
* Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* A unique identifier for the workflow.
*/
public val workflowId: Output
get() = javaResource.workflowId().applyValue({ args0 -> args0 })
}
public object WorkflowMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.transfer.Workflow::class == javaResource::class
override fun map(javaResource: Resource): Workflow = Workflow(
javaResource as
com.pulumi.awsnative.transfer.Workflow,
)
}
/**
* @see [Workflow].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Workflow].
*/
public suspend fun workflow(name: String, block: suspend WorkflowResourceBuilder.() -> Unit): Workflow {
val builder = WorkflowResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Workflow].
* @param name The _unique_ name of the resulting resource.
*/
public fun workflow(name: String): Workflow {
val builder = WorkflowResourceBuilder()
builder.name(name)
return builder.build()
}