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

com.pulumi.googlenative.compute.beta.kotlin.License.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.compute.beta.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.compute.beta.kotlin.outputs.LicenseResourceRequirementsResponse
import com.pulumi.googlenative.compute.beta.kotlin.outputs.LicenseResourceRequirementsResponse.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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: LicenseArgs = LicenseArgs()

    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 LicenseArgsBuilder.() -> Unit) {
        val builder = LicenseArgsBuilder()
        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(): License {
        val builtJavaResource = com.pulumi.googlenative.compute.beta.License(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return License(builtJavaResource)
    }
}

/**
 * Create a License resource in the specified project. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
 */
public class License internal constructor(
    override val javaResource: com.pulumi.googlenative.compute.beta.License,
) : KotlinCustomResource(javaResource, LicenseMapper) {
    /**
     * Deprecated. This field no longer reflects whether a license charges a usage fee.
     */
    @Deprecated(
        message = """
  [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee.
  """,
    )
    public val chargesUseFee: Output
        get() = javaResource.chargesUseFee().applyValue({ args0 -> args0 })

    /**
     * Creation timestamp in RFC3339 text format.
     */
    public val creationTimestamp: Output
        get() = javaResource.creationTimestamp().applyValue({ args0 -> args0 })

    /**
     * An optional textual description of the resource; provided by the client when the resource is created.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * Type of resource. Always compute#license for licenses.
     */
    public val kind: Output
        get() = javaResource.kind().applyValue({ args0 -> args0 })

    /**
     * The unique code used to attach this license to images, snapshots, and disks.
     */
    public val licenseCode: Output
        get() = javaResource.licenseCode().applyValue({ args0 -> args0 })

    /**
     * Name of the resource. The name must be 1-63 characters long and comply with RFC1035.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
     */
    public val requestId: Output?
        get() = javaResource.requestId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    public val resourceRequirements: Output
        get() = javaResource.resourceRequirements().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })

    /**
     * Server-defined URL for the resource.
     */
    public val selfLink: Output
        get() = javaResource.selfLink().applyValue({ args0 -> args0 })

    /**
     * If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk.
     */
    public val transferable: Output
        get() = javaResource.transferable().applyValue({ args0 -> args0 })
}

public object LicenseMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.compute.beta.License::class == javaResource::class

    override fun map(javaResource: Resource): License = License(
        javaResource as
            com.pulumi.googlenative.compute.beta.License,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy