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

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

package com.pulumi.gcp.bigqueryanalyticshub.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: DataExchangeArgs = DataExchangeArgs()

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

/**
 * A Bigquery Analytics Hub data exchange
 * To get more information about DataExchange, see:
 * * [API documentation](https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/bigquery/docs/analytics-hub-introduction)
 * ## Example Usage
 * ### Bigquery Analyticshub Data Exchange Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const dataExchange = new gcp.bigqueryanalyticshub.DataExchange("data_exchange", {
 *     location: "US",
 *     dataExchangeId: "my_data_exchange",
 *     displayName: "my_data_exchange",
 *     description: "example data exchange",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * data_exchange = gcp.bigqueryanalyticshub.DataExchange("data_exchange",
 *     location="US",
 *     data_exchange_id="my_data_exchange",
 *     display_name="my_data_exchange",
 *     description="example data exchange")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var dataExchange = new Gcp.BigQueryAnalyticsHub.DataExchange("data_exchange", new()
 *     {
 *         Location = "US",
 *         DataExchangeId = "my_data_exchange",
 *         DisplayName = "my_data_exchange",
 *         Description = "example data exchange",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigqueryanalyticshub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := bigqueryanalyticshub.NewDataExchange(ctx, "data_exchange", &bigqueryanalyticshub.DataExchangeArgs{
 * 			Location:       pulumi.String("US"),
 * 			DataExchangeId: pulumi.String("my_data_exchange"),
 * 			DisplayName:    pulumi.String("my_data_exchange"),
 * 			Description:    pulumi.String("example data exchange"),
 * 		})
 * 		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.bigqueryanalyticshub.DataExchange;
 * import com.pulumi.gcp.bigqueryanalyticshub.DataExchangeArgs;
 * 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 dataExchange = new DataExchange("dataExchange", DataExchangeArgs.builder()
 *             .location("US")
 *             .dataExchangeId("my_data_exchange")
 *             .displayName("my_data_exchange")
 *             .description("example data exchange")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   dataExchange:
 *     type: gcp:bigqueryanalyticshub:DataExchange
 *     name: data_exchange
 *     properties:
 *       location: US
 *       dataExchangeId: my_data_exchange
 *       displayName: my_data_exchange
 *       description: example data exchange
 * ```
 * 
 * ## Import
 * DataExchange can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}`
 * * `{{project}}/{{location}}/{{data_exchange_id}}`
 * * `{{location}}/{{data_exchange_id}}`
 * * `{{data_exchange_id}}`
 * When using the `pulumi import` command, DataExchange can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/dataExchange:DataExchange default projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/dataExchange:DataExchange default {{project}}/{{location}}/{{data_exchange_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/dataExchange:DataExchange default {{location}}/{{data_exchange_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/dataExchange:DataExchange default {{data_exchange_id}}
 * ```
 */
public class DataExchange internal constructor(
    override val javaResource: com.pulumi.gcp.bigqueryanalyticshub.DataExchange,
) : KotlinCustomResource(javaResource, DataExchangeMapper) {
    /**
     * The ID of the data exchange. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces.
     */
    public val dataExchangeId: Output
        get() = javaResource.dataExchangeId().applyValue({ args0 -> args0 })

    /**
     * Description of the data exchange.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Human-readable display name of the data exchange. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), and must not start or end with spaces.
     * - - -
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Documentation describing the data exchange.
     */
    public val documentation: Output?
        get() = javaResource.documentation().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Base64 encoded image representing the data exchange.
     */
    public val icon: Output?
        get() = javaResource.icon().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Number of listings contained in the data exchange.
     */
    public val listingCount: Output
        get() = javaResource.listingCount().applyValue({ args0 -> args0 })

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

    /**
     * The resource name of the data exchange, for example:
     * "projects/myproject/locations/US/dataExchanges/123"
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Email or URL of the primary point of contact of the data exchange.
     */
    public val primaryContact: Output?
        get() = javaResource.primaryContact().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * 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 })
}

public object DataExchangeMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.bigqueryanalyticshub.DataExchange::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy