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

com.pulumi.awsnative.resourceexplorer2.kotlin.View.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.resourceexplorer2.kotlin

import com.pulumi.awsnative.resourceexplorer2.kotlin.outputs.ViewIncludedProperty
import com.pulumi.awsnative.resourceexplorer2.kotlin.outputs.ViewSearchFilter
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 kotlin.collections.Map
import com.pulumi.awsnative.resourceexplorer2.kotlin.outputs.ViewIncludedProperty.Companion.toKotlin as viewIncludedPropertyToKotlin
import com.pulumi.awsnative.resourceexplorer2.kotlin.outputs.ViewSearchFilter.Companion.toKotlin as viewSearchFilterToKotlin

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

    public var args: ViewArgs = ViewArgs()

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

/**
 * Definition of AWS::ResourceExplorer2::View Resource Type
 */
public class View internal constructor(
    override val javaResource: com.pulumi.awsnative.resourceexplorer2.View,
) : KotlinCustomResource(javaResource, ViewMapper) {
    /**
     * An array of strings that include search keywords, prefixes, and operators that filter the results that are returned for queries made using this view. When you use this view in a [Search](https://docs.aws.amazon.com/resource-explorer/latest/apireference/API_Search.html) operation, the filter string is combined with the search's `QueryString` parameter using a logical `AND` operator.
     * For information about the supported syntax, see [Search query reference for Resource Explorer](https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html) in the *AWS Resource Explorer User Guide* .
     * > This query string in the context of this operation supports only [filter prefixes](https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters) with optional [operators](https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators) . It doesn't support free-form text. For example, the string `region:us* service:ec2 -tag:stage=prod` includes all Amazon EC2 resources in any AWS Region that begin with the letters `us` and are *not* tagged with a key `Stage` that has the value `prod` .
     */
    public val filters: Output?
        get() = javaResource.filters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    viewSearchFilterToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * A list of fields that provide additional information about the view.
     */
    public val includedProperties: Output>?
        get() = javaResource.includedProperties().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        viewIncludedPropertyToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The root ARN of the account, an organizational unit (OU), or an organization ARN. If left empty, the default is account.
     */
    public val scope: Output?
        get() = javaResource.scope().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Tag key and value pairs that are attached to the view.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The ARN of the new view. For example:
     * `arn:aws:resource-explorer-2:us-east-1:123456789012:view/MyView/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222`
     */
    public val viewArn: Output
        get() = javaResource.viewArn().applyValue({ args0 -> args0 })

    /**
     * The name of the new view.
     */
    public val viewName: Output
        get() = javaResource.viewName().applyValue({ args0 -> args0 })
}

public object ViewMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.resourceexplorer2.View::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy