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

com.pulumi.awsnative.pinpoint.kotlin.InAppTemplate.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.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.pinpoint.kotlin

import com.pulumi.awsnative.pinpoint.kotlin.enums.InAppTemplateLayout
import com.pulumi.awsnative.pinpoint.kotlin.outputs.InAppTemplateInAppMessageContent
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.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.pinpoint.kotlin.enums.InAppTemplateLayout.Companion.toKotlin as inAppTemplateLayoutToKotlin
import com.pulumi.awsnative.pinpoint.kotlin.outputs.InAppTemplateInAppMessageContent.Companion.toKotlin as inAppTemplateInAppMessageContentToKotlin

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

    public var args: InAppTemplateArgs = InAppTemplateArgs()

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

/**
 * Resource Type definition for AWS::Pinpoint::InAppTemplate
 */
public class InAppTemplate internal constructor(
    override val javaResource: com.pulumi.awsnative.pinpoint.InAppTemplate,
) : KotlinCustomResource(javaResource, InAppTemplateMapper) {
    /**
     * The Amazon Resource Name (ARN) of the message template.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * An object that contains information about the content of an in-app message, including its title and body text, text colors, background colors, images, buttons, and behaviors.
     */
    public val content: Output>?
        get() = javaResource.content().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> inAppTemplateInAppMessageContentToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Custom data, in the form of key-value pairs, that is included in an in-app messaging payload.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Pinpoint::InAppTemplate` for more information about the expected schema for this property.
     */
    public val customConfig: Output?
        get() = javaResource.customConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A string that determines the appearance of the in-app message. You can specify one of the following:
     * - `BOTTOM_BANNER` – a message that appears as a banner at the bottom of the page.
     * - `TOP_BANNER` – a message that appears as a banner at the top of the page.
     * - `OVERLAYS` – a message that covers entire screen.
     * - `MOBILE_FEED` – a message that appears in a window in front of the page.
     * - `MIDDLE_BANNER` – a message that appears as a banner in the middle of the page.
     * - `CAROUSEL` – a scrollable layout of up to five unique messages.
     */
    public val layout: Output?
        get() = javaResource.layout().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    inAppTemplateLayoutToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * 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) .
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Pinpoint::InAppTemplate` for more information about the expected schema for this property.
     */
    public val tags: Output?
        get() = javaResource.tags().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * An optional description of the in-app template.
     */
    public val templateDescription: Output?
        get() = javaResource.templateDescription().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the in-app message template.
     */
    public val templateName: Output
        get() = javaResource.templateName().applyValue({ args0 -> args0 })
}

public object InAppTemplateMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.pinpoint.InAppTemplate::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy