com.pulumi.gcp.bigquery.kotlin.BiReservation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.bigquery.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.bigquery.kotlin.outputs.BiReservationPreferredTable
import com.pulumi.gcp.bigquery.kotlin.outputs.BiReservationPreferredTable.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [BiReservation].
*/
@PulumiTagMarker
public class BiReservationResourceBuilder internal constructor() {
public var name: String? = null
public var args: BiReservationArgs = BiReservationArgs()
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 BiReservationArgsBuilder.() -> Unit) {
val builder = BiReservationArgsBuilder()
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(): BiReservation {
val builtJavaResource = com.pulumi.gcp.bigquery.BiReservation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return BiReservation(builtJavaResource)
}
}
/**
* Represents a BI Reservation.
* To get more information about BiReservation, see:
* * [API documentation](https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/BiReservation)
* * How-to Guides
* * [Introduction to Reservations](https://cloud.google.com/bigquery/docs/reservations-intro)
* ## Example Usage
* ### Bigquery Reservation Bi Reservation Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const reservation = new gcp.bigquery.BiReservation("reservation", {
* location: "us-west2",
* size: 3000000000,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* reservation = gcp.bigquery.BiReservation("reservation",
* location="us-west2",
* size=3000000000)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var reservation = new Gcp.BigQuery.BiReservation("reservation", new()
* {
* Location = "us-west2",
* Size = 3000000000,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquery"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := bigquery.NewBiReservation(ctx, "reservation", &bigquery.BiReservationArgs{
* Location: pulumi.String("us-west2"),
* Size: pulumi.Int(3000000000),
* })
* 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.bigquery.BiReservation;
* import com.pulumi.gcp.bigquery.BiReservationArgs;
* 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 reservation = new BiReservation("reservation", BiReservationArgs.builder()
* .location("us-west2")
* .size("3000000000")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* reservation:
* type: gcp:bigquery:BiReservation
* properties:
* location: us-west2
* size: '3000000000'
* ```
*
* ## Import
* BiReservation can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/biReservation`
* * `{{project}}/{{location}}`
* * `{{location}}`
* When using the `pulumi import` command, BiReservation can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:bigquery/biReservation:BiReservation default projects/{{project}}/locations/{{location}}/biReservation
* ```
* ```sh
* $ pulumi import gcp:bigquery/biReservation:BiReservation default {{project}}/{{location}}
* ```
* ```sh
* $ pulumi import gcp:bigquery/biReservation:BiReservation default {{location}}
* ```
*/
public class BiReservation internal constructor(
override val javaResource: com.pulumi.gcp.bigquery.BiReservation,
) : KotlinCustomResource(javaResource, BiReservationMapper) {
/**
* LOCATION_DESCRIPTION
* - - -
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The resource name of the singleton BI reservation. Reservation names have the form `projects/{projectId}/locations/{locationId}/biReservation`.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Preferred tables to use BI capacity for.
* Structure is documented below.
*/
public val preferredTables: Output>?
get() = javaResource.preferredTables().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> toKotlin(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 })
/**
* Size of a reservation, in bytes.
*/
public val size: Output?
get() = javaResource.size().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The last update timestamp of a reservation.
* A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
*/
public val updateTime: Output
get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}
public object BiReservationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.bigquery.BiReservation::class == javaResource::class
override fun map(javaResource: Resource): BiReservation = BiReservation(
javaResource as
com.pulumi.gcp.bigquery.BiReservation,
)
}
/**
* @see [BiReservation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [BiReservation].
*/
public suspend fun biReservation(
name: String,
block: suspend BiReservationResourceBuilder.() -> Unit,
): BiReservation {
val builder = BiReservationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [BiReservation].
* @param name The _unique_ name of the resulting resource.
*/
public fun biReservation(name: String): BiReservation {
val builder = BiReservationResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy