com.pulumi.awsnative.connect.kotlin.PhoneNumber.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.connect.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.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
import kotlin.collections.List
/**
* Builder for [PhoneNumber].
*/
@PulumiTagMarker
public class PhoneNumberResourceBuilder internal constructor() {
public var name: String? = null
public var args: PhoneNumberArgs = PhoneNumberArgs()
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 PhoneNumberArgsBuilder.() -> Unit) {
val builder = PhoneNumberArgsBuilder()
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(): PhoneNumber {
val builtJavaResource = com.pulumi.awsnative.connect.PhoneNumber(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return PhoneNumber(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Connect::PhoneNumber
*/
public class PhoneNumber internal constructor(
override val javaResource: com.pulumi.awsnative.connect.PhoneNumber,
) : KotlinCustomResource(javaResource, PhoneNumberMapper) {
/**
* The phone number e164 address.
*/
public val address: Output
get() = javaResource.address().applyValue({ args0 -> args0 })
/**
* The phone number country code.
*/
public val countryCode: Output?
get() = javaResource.countryCode().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The description of the phone number.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The phone number ARN
*/
public val phoneNumberArn: Output
get() = javaResource.phoneNumberArn().applyValue({ args0 -> args0 })
/**
* The phone number prefix.
*/
public val prefix: Output?
get() = javaResource.prefix().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The source phone number arn.
*/
public val sourcePhoneNumberArn: Output?
get() = javaResource.sourcePhoneNumberArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* One or more tags.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The ARN of the target the phone number is claimed to.
*/
public val targetArn: Output
get() = javaResource.targetArn().applyValue({ args0 -> args0 })
/**
* The phone number type
*/
public val type: Output?
get() = javaResource.type().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object PhoneNumberMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.connect.PhoneNumber::class == javaResource::class
override fun map(javaResource: Resource): PhoneNumber = PhoneNumber(
javaResource as
com.pulumi.awsnative.connect.PhoneNumber,
)
}
/**
* @see [PhoneNumber].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [PhoneNumber].
*/
public suspend fun phoneNumber(name: String, block: suspend PhoneNumberResourceBuilder.() -> Unit): PhoneNumber {
val builder = PhoneNumberResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [PhoneNumber].
* @param name The _unique_ name of the resulting resource.
*/
public fun phoneNumber(name: String): PhoneNumber {
val builder = PhoneNumberResourceBuilder()
builder.name(name)
return builder.build()
}