![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.verifiedpermissions.kotlin.Policy.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.verifiedpermissions.kotlin
import com.pulumi.awsnative.verifiedpermissions.kotlin.enums.PolicyType
import com.pulumi.awsnative.verifiedpermissions.kotlin.enums.PolicyType.Companion.toKotlin
import com.pulumi.awsnative.verifiedpermissions.kotlin.outputs.PolicyDefinition0Properties
import com.pulumi.awsnative.verifiedpermissions.kotlin.outputs.PolicyDefinition1Properties
import com.pulumi.core.Either
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
/**
* Builder for [Policy].
*/
@PulumiTagMarker
public class PolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: PolicyArgs = PolicyArgs()
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 PolicyArgsBuilder.() -> Unit) {
val builder = PolicyArgsBuilder()
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(): Policy {
val builtJavaResource = com.pulumi.awsnative.verifiedpermissions.Policy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Policy(builtJavaResource)
}
}
/**
* Definition of AWS::VerifiedPermissions::Policy Resource Type
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class Policy internal constructor(
override val javaResource: com.pulumi.awsnative.verifiedpermissions.Policy,
) : KotlinCustomResource(javaResource, PolicyMapper) {
/**
* Specifies the policy type and content to use for the new or updated policy. The definition structure must include either a `Static` or a `TemplateLinked` element.
*/
public val definition: Output>
get() = javaResource.definition().applyValue({ args0 ->
args0.transform(
{ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.verifiedpermissions.kotlin.outputs.PolicyDefinition0Properties.Companion.toKotlin(args0)
})
},
{ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.verifiedpermissions.kotlin.outputs.PolicyDefinition1Properties.Companion.toKotlin(args0)
})
},
)
})
/**
* The unique ID of the new or updated policy.
*/
public val policyId: Output
get() = javaResource.policyId().applyValue({ args0 -> args0 })
/**
* Specifies the `PolicyStoreId` of the policy store you want to store the policy in.
*/
public val policyStoreId: Output
get() = javaResource.policyStoreId().applyValue({ args0 -> args0 })
/**
* The type of the policy. This is one of the following values:
* - Static
* - TemplateLinked
*/
public val policyType: Output
get() = javaResource.policyType().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
}
public object PolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.verifiedpermissions.Policy::class == javaResource::class
override fun map(javaResource: Resource): Policy = Policy(
javaResource as
com.pulumi.awsnative.verifiedpermissions.Policy,
)
}
/**
* @see [Policy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Policy].
*/
public suspend fun policy(name: String, block: suspend PolicyResourceBuilder.() -> Unit): Policy {
val builder = PolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Policy].
* @param name The _unique_ name of the resulting resource.
*/
public fun policy(name: String): Policy {
val builder = PolicyResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy