All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.location.kotlin.Tracker.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.location.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.location.kotlin.enums.TrackerPositionFiltering
import com.pulumi.awsnative.location.kotlin.enums.TrackerPricingPlan
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.location.kotlin.enums.TrackerPositionFiltering.Companion.toKotlin as trackerPositionFilteringToKotlin
import com.pulumi.awsnative.location.kotlin.enums.TrackerPricingPlan.Companion.toKotlin as trackerPricingPlanToKotlin

/**
 * Builder for [Tracker].
 */
@PulumiTagMarker
public class TrackerResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: TrackerArgs = TrackerArgs()

    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 TrackerArgsBuilder.() -> Unit) {
        val builder = TrackerArgsBuilder()
        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(): Tracker {
        val builtJavaResource = com.pulumi.awsnative.location.Tracker(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Tracker(builtJavaResource)
    }
}

/**
 * Definition of AWS::Location::Tracker Resource Type
 */
public class Tracker internal constructor(
    override val javaResource: com.pulumi.awsnative.location.Tracker,
) : KotlinCustomResource(javaResource, TrackerMapper) {
    /**
     * The Amazon Resource Name (ARN) for the tracker resource. Used when you need to specify a resource across all AWS .
     * - Format example: `arn:aws:geo:region:account-id:tracker/ExampleTracker`
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The timestamp for when the tracker resource was created in [ISO 8601](https://docs.aws.amazon.com/https://www.iso.org/iso-8601-date-and-time-format.html) format: `YYYY-MM-DDThh:mm:ss.sssZ` .
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * An optional description for the tracker resource.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val eventBridgeEnabled: Output?
        get() = javaResource.eventBridgeEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val kmsKeyEnableGeospatialQueries: Output?
        get() = javaResource.kmsKeyEnableGeospatialQueries().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A key identifier for an [AWS KMS customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) . Enter a key ID, key ARN, alias name, or alias ARN.
     */
    public val kmsKeyId: Output?
        get() = javaResource.kmsKeyId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specifies the position filtering for the tracker resource.
     * Valid values:
     * - `TimeBased` - Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID.
     * - `DistanceBased` - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this area are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map.
     * - `AccuracyBased` - If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This can reduce the effects of GPS noise when displaying device trajectories on a map, and can help control your costs by reducing the number of geofence evaluations.
     * This field is optional. If not specified, the default value is `TimeBased` .
     */
    public val positionFiltering: Output?
        get() = javaResource.positionFiltering().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> trackerPositionFilteringToKotlin(args0) })
            }).orElse(null)
        })

    public val pricingPlan: Output?
        get() = javaResource.pricingPlan().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    trackerPricingPlanToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * This shape is deprecated since 2022-02-01: Deprecated. No longer allowed.
     */
    public val pricingPlanDataSource: Output?
        get() = javaResource.pricingPlanDataSource().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * An array of key-value pairs to apply to this resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Synonym for `Arn` . The Amazon Resource Name (ARN) for the tracker resource. Used when you need to specify a resource across all AWS .
     * - Format example: `arn:aws:geo:region:account-id:tracker/ExampleTracker`
     */
    public val trackerArn: Output
        get() = javaResource.trackerArn().applyValue({ args0 -> args0 })

    /**
     * The name for the tracker resource.
     * Requirements:
     * - Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).
     * - Must be a unique tracker resource name.
     * - No spaces allowed. For example, `ExampleTracker` .
     */
    public val trackerName: Output
        get() = javaResource.trackerName().applyValue({ args0 -> args0 })

    /**
     * The timestamp for when the tracker resource was last updated in [ISO 8601](https://docs.aws.amazon.com/https://www.iso.org/iso-8601-date-and-time-format.html) format: `YYYY-MM-DDThh:mm:ss.sssZ` .
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object TrackerMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.location.Tracker::class == javaResource::class

    override fun map(javaResource: Resource): Tracker = Tracker(
        javaResource as
            com.pulumi.awsnative.location.Tracker,
    )
}

/**
 * @see [Tracker].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Tracker].
 */
public suspend fun tracker(name: String, block: suspend TrackerResourceBuilder.() -> Unit): Tracker {
    val builder = TrackerResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Tracker].
 * @param name The _unique_ name of the resulting resource.
 */
public fun tracker(name: String): Tracker {
    val builder = TrackerResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy