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

com.pulumi.googlenative.healthcare.v1beta1.kotlin.Consent.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.healthcare.v1beta1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.healthcare.v1beta1.kotlin.outputs.GoogleCloudHealthcareV1beta1ConsentPolicyResponse
import com.pulumi.googlenative.healthcare.v1beta1.kotlin.outputs.GoogleCloudHealthcareV1beta1ConsentPolicyResponse.Companion.toKotlin
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

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

    public var args: ConsentArgs = ConsentArgs()

    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 ConsentArgsBuilder.() -> Unit) {
        val builder = ConsentArgsBuilder()
        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(): Consent {
        val builtJavaResource =
            com.pulumi.googlenative.healthcare.v1beta1.Consent(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return Consent(builtJavaResource)
    }
}

/**
 * Creates a new Consent in the parent consent store.
 */
public class Consent internal constructor(
    override val javaResource: com.pulumi.googlenative.healthcare.v1beta1.Consent,
) : KotlinCustomResource(javaResource, ConsentMapper) {
    /**
     * The resource name of the Consent artifact that contains proof of the end user's consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consentArtifacts/{consent_artifact_id}`.
     */
    public val consentArtifact: Output
        get() = javaResource.consentArtifact().applyValue({ args0 -> args0 })

    public val consentStoreId: Output
        get() = javaResource.consentStoreId().applyValue({ args0 -> args0 })

    public val datasetId: Output
        get() = javaResource.datasetId().applyValue({ args0 -> args0 })

    /**
     * Timestamp in UTC of when this Consent is considered expired.
     */
    public val expireTime: Output
        get() = javaResource.expireTime().applyValue({ args0 -> args0 })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Optional. User-supplied key-value pairs used to organize Consent resources. Metadata keys must: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - begin with a letter - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes Metadata values must be: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes No more than 64 metadata entries can be associated with a given consent.
     */
    public val metadata: Output>
        get() = javaResource.metadata().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Resource name of the Consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}`. Cannot be changed after creation.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions.
     */
    public val policies: Output>
        get() = javaResource.policies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            })
        })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The timestamp that the revision was created.
     */
    public val revisionCreateTime: Output
        get() = javaResource.revisionCreateTime().applyValue({ args0 -> args0 })

    /**
     * The revision ID of the Consent. The format is an 8-character hexadecimal string. Refer to a specific revision of a Consent by appending `@{revision_id}` to the Consent's resource name.
     */
    public val revisionId: Output
        get() = javaResource.revisionId().applyValue({ args0 -> args0 })

    /**
     * Indicates the current state of this Consent.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Input only. The time to live for this Consent from when it is created.
     */
    public val ttl: Output
        get() = javaResource.ttl().applyValue({ args0 -> args0 })

    /**
     * User's UUID provided by the client.
     */
    public val userId: Output
        get() = javaResource.userId().applyValue({ args0 -> args0 })
}

public object ConsentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.healthcare.v1beta1.Consent::class == javaResource::class

    override fun map(javaResource: Resource): Consent = Consent(
        javaResource as
            com.pulumi.googlenative.healthcare.v1beta1.Consent,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy