com.pulumi.awsnative.organizations.kotlin.Organization.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.organizations.kotlin
import com.pulumi.awsnative.organizations.kotlin.enums.OrganizationFeatureSet
import com.pulumi.awsnative.organizations.kotlin.enums.OrganizationFeatureSet.Companion.toKotlin
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 [Organization].
*/
@PulumiTagMarker
public class OrganizationResourceBuilder internal constructor() {
public var name: String? = null
public var args: OrganizationArgs = OrganizationArgs()
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 OrganizationArgsBuilder.() -> Unit) {
val builder = OrganizationArgsBuilder()
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(): Organization {
val builtJavaResource = com.pulumi.awsnative.organizations.Organization(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Organization(builtJavaResource)
}
}
/**
* Resource schema for AWS::Organizations::Organization
*/
public class Organization internal constructor(
override val javaResource: com.pulumi.awsnative.organizations.Organization,
) : KotlinCustomResource(javaResource, OrganizationMapper) {
/**
* The Amazon Resource Name (ARN) of an organization.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The unique identifier (ID) of an organization.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* Specifies the feature set supported by the new organization. Each feature set supports different levels of functionality.
*/
public val featureSet: Output?
get() = javaResource.featureSet().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
toKotlin(args0)
})
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.
*/
public val managementAccountArn: Output
get() = javaResource.managementAccountArn().applyValue({ args0 -> args0 })
/**
* The email address that is associated with the AWS account that is designated as the management account for the organization.
*/
public val managementAccountEmail: Output
get() = javaResource.managementAccountEmail().applyValue({ args0 -> args0 })
/**
* The unique identifier (ID) of the management account of an organization.
*/
public val managementAccountId: Output
get() = javaResource.managementAccountId().applyValue({ args0 -> args0 })
/**
* The unique identifier (ID) for the root.
*/
public val rootId: Output
get() = javaResource.rootId().applyValue({ args0 -> args0 })
}
public object OrganizationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.organizations.Organization::class == javaResource::class
override fun map(javaResource: Resource): Organization = Organization(
javaResource as
com.pulumi.awsnative.organizations.Organization,
)
}
/**
* @see [Organization].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Organization].
*/
public suspend fun organization(
name: String,
block: suspend OrganizationResourceBuilder.() -> Unit,
): Organization {
val builder = OrganizationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Organization].
* @param name The _unique_ name of the resulting resource.
*/
public fun organization(name: String): Organization {
val builder = OrganizationResourceBuilder()
builder.name(name)
return builder.build()
}