
com.pulumi.googlenative.cloudresourcemanager.v2beta1.kotlin.Folder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-google-native-kotlin Show documentation
Show all versions of pulumi-google-native-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.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.googlenative.cloudresourcemanager.v2beta1.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 [Folder].
*/
@PulumiTagMarker
public class FolderResourceBuilder internal constructor() {
public var name: String? = null
public var args: FolderArgs = FolderArgs()
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 FolderArgsBuilder.() -> Unit) {
val builder = FolderArgsBuilder()
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(): Folder {
val builtJavaResource =
com.pulumi.googlenative.cloudresourcemanager.v2beta1.Folder(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Folder(builtJavaResource)
}
}
/**
* Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field will be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's display_name must be distinct from all other Folders that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 10. Note, the full active + deleted Folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders. + The addition of the Folder must not cause the total number of Folders under its parent to exceed 300. If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent.
* Auto-naming is currently not supported for this resource.
*/
public class Folder internal constructor(
override val javaResource: com.pulumi.googlenative.cloudresourcemanager.v2beta1.Folder,
) : KotlinCustomResource(javaResource, FolderMapper) {
/**
* Timestamp when the Folder was created. Assigned by the server.
*/
public val createTime: Output
get() = javaResource.createTime().applyValue({ args0 -> args0 })
/**
* The folder's display name. A folder's display name must be unique amongst its siblings, e.g. no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. This is captured by the regular expression: `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`.
*/
public val displayName: Output
get() = javaResource.displayName().applyValue({ args0 -> args0 })
/**
* The lifecycle state of the folder. Updates to the lifecycle_state must be performed via DeleteFolder and UndeleteFolder.
*/
public val lifecycleState: Output
get() = javaResource.lifecycleState().applyValue({ args0 -> args0 })
/**
* The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234".
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Required. The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
*/
public val parent: Output
get() = javaResource.parent().applyValue({ args0 -> args0 })
}
public object FolderMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.googlenative.cloudresourcemanager.v2beta1.Folder::class == javaResource::class
override fun map(javaResource: Resource): Folder = Folder(
javaResource as
com.pulumi.googlenative.cloudresourcemanager.v2beta1.Folder,
)
}
/**
* @see [Folder].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Folder].
*/
public suspend fun folder(name: String, block: suspend FolderResourceBuilder.() -> Unit): Folder {
val builder = FolderResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Folder].
* @param name The _unique_ name of the resulting resource.
*/
public fun folder(name: String): Folder {
val builder = FolderResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy