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

com.pulumi.gcp.gemini.kotlin.CodeRepositoryIndex.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.gemini.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 [CodeRepositoryIndex].
 */
@PulumiTagMarker
public class CodeRepositoryIndexResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: CodeRepositoryIndexArgs = CodeRepositoryIndexArgs()

    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 CodeRepositoryIndexArgsBuilder.() -> Unit) {
        val builder = CodeRepositoryIndexArgsBuilder()
        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(): CodeRepositoryIndex {
        val builtJavaResource = com.pulumi.gcp.gemini.CodeRepositoryIndex(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return CodeRepositoryIndex(builtJavaResource)
    }
}

/**
 * ## Example Usage
 * ### Gemini Code Repository Index Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.gemini.CodeRepositoryIndex("example", {
 *     location: "us-central1",
 *     codeRepositoryIndexId: "",
 *     kmsKey: "projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.gemini.CodeRepositoryIndex("example",
 *     location="us-central1",
 *     code_repository_index_id="",
 *     kms_key="projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.Gemini.CodeRepositoryIndex("example", new()
 *     {
 *         Location = "us-central1",
 *         CodeRepositoryIndexId = "",
 *         KmsKey = "projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/gemini"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := gemini.NewCodeRepositoryIndex(ctx, "example", &gemini.CodeRepositoryIndexArgs{
 * 			Location:              pulumi.String("us-central1"),
 * 			CodeRepositoryIndexId: pulumi.String(""),
 * 			KmsKey:                pulumi.String("projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.gemini.CodeRepositoryIndex;
 * import com.pulumi.gcp.gemini.CodeRepositoryIndexArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new CodeRepositoryIndex("example", CodeRepositoryIndexArgs.builder()
 *             .location("us-central1")
 *             .codeRepositoryIndexId("")
 *             .kmsKey("projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:gemini:CodeRepositoryIndex
 *     properties:
 *       location: us-central1
 *       codeRepositoryIndexId: ""
 *       kmsKey: projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample
 * ```
 * 
 * ## Import
 * CodeRepositoryIndex can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}`
 * * `{{project}}/{{location}}/{{code_repository_index_id}}`
 * * `{{location}}/{{code_repository_index_id}}`
 * When using the `pulumi import` command, CodeRepositoryIndex can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:gemini/codeRepositoryIndex:CodeRepositoryIndex default projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:gemini/codeRepositoryIndex:CodeRepositoryIndex default {{project}}/{{location}}/{{code_repository_index_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:gemini/codeRepositoryIndex:CodeRepositoryIndex default {{location}}/{{code_repository_index_id}}
 * ```
 */
public class CodeRepositoryIndex internal constructor(
    override val javaResource: com.pulumi.gcp.gemini.CodeRepositoryIndex,
) : KotlinCustomResource(javaResource, CodeRepositoryIndexMapper) {
    /**
     * Required. Id of the Code Repository Index.
     * - - -
     */
    public val codeRepositoryIndexId: Output
        get() = javaResource.codeRepositoryIndexId().applyValue({ args0 -> args0 })

    /**
     * Output only. Create time stamp.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Optional. Immutable. Customer-managed encryption key name, in the format
     * projects/*/locations/*/keyRings/*/cryptoKeys/*.
     * */*/*/*/
     */
    public val kmsKey: Output?
        get() = javaResource.kmsKey().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Optional. Labels as key value pairs.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The location of the Code Repository Index, for example `us-central1`.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Immutable. Identifier. Name of Code Repository Index.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Output only. Code Repository Index instance State.
     * Possible values:
     * STATE_UNSPECIFIED
     * CREATING
     * ACTIVE
     * DELETING
     * SUSPENDED
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Output only. Update time stamp.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object CodeRepositoryIndexMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.gemini.CodeRepositoryIndex::class == javaResource::class

    override fun map(javaResource: Resource): CodeRepositoryIndex = CodeRepositoryIndex(
        javaResource
            as com.pulumi.gcp.gemini.CodeRepositoryIndex,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy