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

com.pulumi.gcp.essentialcontacts.kotlin.DocumentAiProcessorDefaultVersion.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.essentialcontacts.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

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

    public var args: DocumentAiProcessorDefaultVersionArgs = DocumentAiProcessorDefaultVersionArgs()

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

/**
 * The default version for the processor. Deleting this resource is a no-op, and does not unset the default version.
 * ## Example Usage
 * ### Documentai Default Version
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const processor = new gcp.essentialcontacts.DocumentAiProcessor("processor", {
 *     location: "us",
 *     displayName: "test-processor",
 *     type: "OCR_PROCESSOR",
 * });
 * const processorDocumentAiProcessorDefaultVersion = new gcp.essentialcontacts.DocumentAiProcessorDefaultVersion("processor", {
 *     processor: processor.id,
 *     version: pulumi.interpolate`${processor.id}/processorVersions/stable`,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * processor = gcp.essentialcontacts.DocumentAiProcessor("processor",
 *     location="us",
 *     display_name="test-processor",
 *     type="OCR_PROCESSOR")
 * processor_document_ai_processor_default_version = gcp.essentialcontacts.DocumentAiProcessorDefaultVersion("processor",
 *     processor=processor.id,
 *     version=processor.id.apply(lambda id: f"{id}/processorVersions/stable"))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var processor = new Gcp.EssentialContacts.DocumentAiProcessor("processor", new()
 *     {
 *         Location = "us",
 *         DisplayName = "test-processor",
 *         Type = "OCR_PROCESSOR",
 *     });
 *     var processorDocumentAiProcessorDefaultVersion = new Gcp.EssentialContacts.DocumentAiProcessorDefaultVersion("processor", new()
 *     {
 *         Processor = processor.Id,
 *         Version = processor.Id.Apply(id => $"{id}/processorVersions/stable"),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/essentialcontacts"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		processor, err := essentialcontacts.NewDocumentAiProcessor(ctx, "processor", &essentialcontacts.DocumentAiProcessorArgs{
 * 			Location:    pulumi.String("us"),
 * 			DisplayName: pulumi.String("test-processor"),
 * 			Type:        pulumi.String("OCR_PROCESSOR"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = essentialcontacts.NewDocumentAiProcessorDefaultVersion(ctx, "processor", &essentialcontacts.DocumentAiProcessorDefaultVersionArgs{
 * 			Processor: processor.ID(),
 * 			Version: processor.ID().ApplyT(func(id string) (string, error) {
 * 				return fmt.Sprintf("%v/processorVersions/stable", id), nil
 * 			}).(pulumi.StringOutput),
 * 		})
 * 		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.essentialcontacts.DocumentAiProcessor;
 * import com.pulumi.gcp.essentialcontacts.DocumentAiProcessorArgs;
 * import com.pulumi.gcp.essentialcontacts.DocumentAiProcessorDefaultVersion;
 * import com.pulumi.gcp.essentialcontacts.DocumentAiProcessorDefaultVersionArgs;
 * 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 processor = new DocumentAiProcessor("processor", DocumentAiProcessorArgs.builder()
 *             .location("us")
 *             .displayName("test-processor")
 *             .type("OCR_PROCESSOR")
 *             .build());
 *         var processorDocumentAiProcessorDefaultVersion = new DocumentAiProcessorDefaultVersion("processorDocumentAiProcessorDefaultVersion", DocumentAiProcessorDefaultVersionArgs.builder()
 *             .processor(processor.id())
 *             .version(processor.id().applyValue(id -> String.format("%s/processorVersions/stable", id)))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   processor:
 *     type: gcp:essentialcontacts:DocumentAiProcessor
 *     properties:
 *       location: us
 *       displayName: test-processor
 *       type: OCR_PROCESSOR
 *   processorDocumentAiProcessorDefaultVersion:
 *     type: gcp:essentialcontacts:DocumentAiProcessorDefaultVersion
 *     name: processor
 *     properties:
 *       processor: ${processor.id}
 *       version: ${processor.id}/processorVersions/stable
 * ```
 * 
 * ## Import
 * ProcessorDefaultVersion can be imported using any of these accepted formats:
 * * `{{processor}}`
 * When using the `pulumi import` command, ProcessorDefaultVersion can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:essentialcontacts/documentAiProcessorDefaultVersion:DocumentAiProcessorDefaultVersion default {{processor}}
 * ```
 */
public class DocumentAiProcessorDefaultVersion internal constructor(
    override val javaResource: com.pulumi.gcp.essentialcontacts.DocumentAiProcessorDefaultVersion,
) : KotlinCustomResource(javaResource, DocumentAiProcessorDefaultVersionMapper) {
    /**
     * The processor to set the version on.
     * - - -
     */
    public val processor: Output
        get() = javaResource.processor().applyValue({ args0 -> args0 })

    /**
     * The version to set. Using `stable` or `rc` will cause the API to return the latest version in that release channel.
     * Apply `lifecycle.ignore_changes` to the `version` field to suppress this diff.
     */
    public val version: Output
        get() = javaResource.version().applyValue({ args0 -> args0 })
}

public object DocumentAiProcessorDefaultVersionMapper :
    ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.essentialcontacts.DocumentAiProcessorDefaultVersion::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy