com.pulumi.gcp.notebooks.kotlin.Location.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.notebooks.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 [Location].
*/
@PulumiTagMarker
public class LocationResourceBuilder internal constructor() {
public var name: String? = null
public var args: LocationArgs = LocationArgs()
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 LocationArgsBuilder.() -> Unit) {
val builder = LocationArgsBuilder()
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(): Location {
val builtJavaResource = com.pulumi.gcp.notebooks.Location(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Location(builtJavaResource)
}
}
/**
* Represents a Location resource.
* ## Import
* Location can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, Location can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:notebooks/location:Location default projects/{{project}}/locations/{{name}}
* ```
* ```sh
* $ pulumi import gcp:notebooks/location:Location default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:notebooks/location:Location default {{name}}
* ```
*/
public class Location internal constructor(
override val javaResource: com.pulumi.gcp.notebooks.Location,
) : KotlinCustomResource(javaResource, LocationMapper) {
/**
* Name of the Location resource.
*/
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 URI of the created resource.
*/
public val selfLink: Output
get() = javaResource.selfLink().applyValue({ args0 -> args0 })
}
public object LocationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.notebooks.Location::class == javaResource::class
override fun map(javaResource: Resource): Location = Location(
javaResource as
com.pulumi.gcp.notebooks.Location,
)
}
/**
* @see [Location].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Location].
*/
public suspend fun location(name: String, block: suspend LocationResourceBuilder.() -> Unit): Location {
val builder = LocationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Location].
* @param name The _unique_ name of the resulting resource.
*/
public fun location(name: String): Location {
val builder = LocationResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy