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

com.pulumi.googlenative.metastore.v1alpha.kotlin.Federation.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.metastore.v1alpha.kotlin

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.Map

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

    public var args: FederationArgs = FederationArgs()

    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 FederationArgsBuilder.() -> Unit) {
        val builder = FederationArgsBuilder()
        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(): Federation {
        val builtJavaResource =
            com.pulumi.googlenative.metastore.v1alpha.Federation(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return Federation(builtJavaResource)
    }
}

/**
 * Creates a metastore federation in a project and location.
 */
public class Federation internal constructor(
    override val javaResource: com.pulumi.googlenative.metastore.v1alpha.Federation,
) : KotlinCustomResource(javaResource, FederationMapper) {
    /**
     * A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
     */
    public val backendMetastores: Output>
        get() = javaResource.backendMetastores().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The time when the metastore federation was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The federation endpoint.
     */
    public val endpointUri: Output
        get() = javaResource.endpointUri().applyValue({ args0 -> args0 })

    /**
     * Required. The ID of the metastore federation, which is used as the final component of the metastore federation's name.This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
     */
    public val federationId: Output
        get() = javaResource.federationId().applyValue({ args0 -> args0 })

    /**
     * User-defined labels for the metastore federation.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

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

    /**
     * Immutable. The relative resource name of the federation, of the form: projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

    /**
     * Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
     */
    public val requestId: Output?
        get() = javaResource.requestId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * Additional information about the current state of the metastore federation, if available.
     */
    public val stateMessage: Output
        get() = javaResource.stateMessage().applyValue({ args0 -> args0 })

    /**
     * The globally unique resource identifier of the metastore federation.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * The time when the metastore federation was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

    /**
     * Immutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.
     */
    public val version: Output
        get() = javaResource.version().applyValue({ args0 -> args0 })
}

public object FederationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.metastore.v1alpha.Federation::class == javaResource::class

    override fun map(javaResource: Resource): Federation = Federation(
        javaResource as
            com.pulumi.googlenative.metastore.v1alpha.Federation,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy