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

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

    public var args: DocumentAiProcessorArgs = DocumentAiProcessorArgs()

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

/**
 * The first-class citizen for Document AI. Each processor defines how to extract structural information from a document.
 * To get more information about Processor, see:
 * * [API documentation](https://cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/document-ai/docs/overview)
 * ## Example Usage
 * ### Documentai Processor
 * 
 * ```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",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * processor = gcp.essentialcontacts.DocumentAiProcessor("processor",
 *     location="us",
 *     display_name="test-processor",
 *     type="OCR_PROCESSOR")
 * ```
 * ```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",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"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 {
 * 		_, 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
 * 		}
 * 		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 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());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   processor:
 *     type: gcp:essentialcontacts:DocumentAiProcessor
 *     properties:
 *       location: us
 *       displayName: test-processor
 *       type: OCR_PROCESSOR
 * ```
 * 
 * ## Import
 * Processor can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/processors/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, Processor can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:essentialcontacts/documentAiProcessor:DocumentAiProcessor default projects/{{project}}/locations/{{location}}/processors/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:essentialcontacts/documentAiProcessor:DocumentAiProcessor default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:essentialcontacts/documentAiProcessor:DocumentAiProcessor default {{location}}/{{name}}
 * ```
 */
public class DocumentAiProcessor internal constructor(
    override val javaResource: com.pulumi.gcp.essentialcontacts.DocumentAiProcessor,
) : KotlinCustomResource(javaResource, DocumentAiProcessorMapper) {
    /**
     * The display name. Must be unique.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * The KMS key used for encryption/decryption in CMEK scenarios. See https://cloud.google.com/security-key-management.
     */
    public val kmsKeyName: Output?
        get() = javaResource.kmsKeyName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The resource name of the processor.
     */
    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 type of processor. For possible types see the [official list](https://cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations/fetchProcessorTypes#google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes)
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy