com.pulumi.awsnative.devicefarm.kotlin.DevicePool.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.devicefarm.kotlin
import com.pulumi.awsnative.devicefarm.kotlin.outputs.DevicePoolRule
import com.pulumi.awsnative.kotlin.outputs.Tag
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.devicefarm.kotlin.outputs.DevicePoolRule.Companion.toKotlin as devicePoolRuleToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [DevicePool].
*/
@PulumiTagMarker
public class DevicePoolResourceBuilder internal constructor() {
public var name: String? = null
public var args: DevicePoolArgs = DevicePoolArgs()
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 DevicePoolArgsBuilder.() -> Unit) {
val builder = DevicePoolArgsBuilder()
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(): DevicePool {
val builtJavaResource = com.pulumi.awsnative.devicefarm.DevicePool(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DevicePool(builtJavaResource)
}
}
/**
* AWS::DeviceFarm::DevicePool creates a new Device Pool for a given DF Project
*/
public class DevicePool internal constructor(
override val javaResource: com.pulumi.awsnative.devicefarm.DevicePool,
) : KotlinCustomResource(javaResource, DevicePoolMapper) {
/**
* The Amazon Resource Name (ARN) of the device pool. See [Amazon resource names](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General Reference guide* .
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The device pool's description.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and meet the criteria that you assign for the `rules` parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter.
* By specifying the maximum number of devices, you can control the costs that you incur by running tests.
*/
public val maxDevices: Output?
get() = javaResource.maxDevices().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The device pool's name.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The ARN of the project for the device pool.
*/
public val projectArn: Output
get() = javaResource.projectArn().applyValue({ args0 -> args0 })
/**
* The device pool's rules.
*/
public val rules: Output>
get() = javaResource.rules().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
devicePoolRuleToKotlin(args0)
})
})
})
/**
* An array of key-value pairs to apply to this resource.
* For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) in the *guide* .
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object DevicePoolMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.devicefarm.DevicePool::class == javaResource::class
override fun map(javaResource: Resource): DevicePool = DevicePool(
javaResource as
com.pulumi.awsnative.devicefarm.DevicePool,
)
}
/**
* @see [DevicePool].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [DevicePool].
*/
public suspend fun devicePool(name: String, block: suspend DevicePoolResourceBuilder.() -> Unit): DevicePool {
val builder = DevicePoolResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [DevicePool].
* @param name The _unique_ name of the resulting resource.
*/
public fun devicePool(name: String): DevicePool {
val builder = DevicePoolResourceBuilder()
builder.name(name)
return builder.build()
}