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

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

package com.pulumi.gcp.healthcare.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.healthcare.kotlin.outputs.WorkspaceSettings
import com.pulumi.gcp.healthcare.kotlin.outputs.WorkspaceSettings.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.Map

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

    public var args: WorkspaceArgs = WorkspaceArgs()

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

/**
 * A Data Mapper workspace is used to configure Data Mapper access, permissions and data sources for mapping clinical patient data to the FHIR standard.
 * To get more information about Workspace, see:
 * * [API documentation](https://cloud.google.com/healthcare-api/healthcare-data-engine/docs/reference/rest/v1/projects.locations.datasets.dataMapperWorkspaces)
 * * How-to Guides
 *     * [Create and manage Data Mapper workspaces ](https://cloud.google.com/healthcare-api/healthcare-data-engine/docs/manage-workspaces)
 * ## Example Usage
 * ### Healthcare Workspace Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const dataset = new gcp.healthcare.Dataset("dataset", {
 *     name: "example-dataset",
 *     location: "us-central1",
 * });
 * const _default = new gcp.healthcare.Workspace("default", {
 *     name: "example-dm-workspace",
 *     dataset: dataset.id,
 *     settings: {
 *         dataProjectIds: ["example-data-source-project-id"],
 *     },
 *     labels: {
 *         label1: "labelvalue1",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * dataset = gcp.healthcare.Dataset("dataset",
 *     name="example-dataset",
 *     location="us-central1")
 * default = gcp.healthcare.Workspace("default",
 *     name="example-dm-workspace",
 *     dataset=dataset.id,
 *     settings={
 *         "data_project_ids": ["example-data-source-project-id"],
 *     },
 *     labels={
 *         "label1": "labelvalue1",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var dataset = new Gcp.Healthcare.Dataset("dataset", new()
 *     {
 *         Name = "example-dataset",
 *         Location = "us-central1",
 *     });
 *     var @default = new Gcp.Healthcare.Workspace("default", new()
 *     {
 *         Name = "example-dm-workspace",
 *         Dataset = dataset.Id,
 *         Settings = new Gcp.Healthcare.Inputs.WorkspaceSettingsArgs
 *         {
 *             DataProjectIds = new[]
 *             {
 *                 "example-data-source-project-id",
 *             },
 *         },
 *         Labels =
 *         {
 *             { "label1", "labelvalue1" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/healthcare"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		dataset, err := healthcare.NewDataset(ctx, "dataset", &healthcare.DatasetArgs{
 * 			Name:     pulumi.String("example-dataset"),
 * 			Location: pulumi.String("us-central1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = healthcare.NewWorkspace(ctx, "default", &healthcare.WorkspaceArgs{
 * 			Name:    pulumi.String("example-dm-workspace"),
 * 			Dataset: dataset.ID(),
 * 			Settings: &healthcare.WorkspaceSettingsArgs{
 * 				DataProjectIds: pulumi.StringArray{
 * 					pulumi.String("example-data-source-project-id"),
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"label1": pulumi.String("labelvalue1"),
 * 			},
 * 		})
 * 		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.healthcare.Dataset;
 * import com.pulumi.gcp.healthcare.DatasetArgs;
 * import com.pulumi.gcp.healthcare.Workspace;
 * import com.pulumi.gcp.healthcare.WorkspaceArgs;
 * import com.pulumi.gcp.healthcare.inputs.WorkspaceSettingsArgs;
 * 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 dataset = new Dataset("dataset", DatasetArgs.builder()
 *             .name("example-dataset")
 *             .location("us-central1")
 *             .build());
 *         var default_ = new Workspace("default", WorkspaceArgs.builder()
 *             .name("example-dm-workspace")
 *             .dataset(dataset.id())
 *             .settings(WorkspaceSettingsArgs.builder()
 *                 .dataProjectIds("example-data-source-project-id")
 *                 .build())
 *             .labels(Map.of("label1", "labelvalue1"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:healthcare:Workspace
 *     properties:
 *       name: example-dm-workspace
 *       dataset: ${dataset.id}
 *       settings:
 *         dataProjectIds:
 *           - example-data-source-project-id
 *       labels:
 *         label1: labelvalue1
 *   dataset:
 *     type: gcp:healthcare:Dataset
 *     properties:
 *       name: example-dataset
 *       location: us-central1
 * ```
 * 
 * ## Import
 * Workspace can be imported using any of these accepted formats:
 * * `{{dataset}}/dataMapperWorkspaces/{{name}}`
 * When using the `pulumi import` command, Workspace can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:healthcare/workspace:Workspace default {{dataset}}/dataMapperWorkspaces/{{name}}
 * ```
 */
public class Workspace internal constructor(
    override val javaResource: com.pulumi.gcp.healthcare.Workspace,
) : KotlinCustomResource(javaResource, WorkspaceMapper) {
    /**
     * Identifies the dataset addressed by this request. Must be in the format
     * 'projects/{project}/locations/{location}/datasets/{dataset}'
     */
    public val dataset: Output
        get() = javaResource.dataset().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()
        })

    /**
     * The user labels. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg",
     * "count": "3" } **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 name of the workspace, in the format 'projects/{projectId}/locations/{location}/datasets/{datasetId}/dataMapperWorkspaces/{workspaceId}'
     */
    public val name: Output
        get() = javaResource.name().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()
        })

    /**
     * Settings associated with this workspace.
     * Structure is documented below.
     */
    public val settings: Output
        get() = javaResource.settings().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
}

public object WorkspaceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.healthcare.Workspace::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy