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

com.pulumi.googlenative.vmmigration.v1.kotlin.UtilizationReport.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.vmmigration.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.vmmigration.v1.kotlin.outputs.StatusResponse
import com.pulumi.googlenative.vmmigration.v1.kotlin.outputs.VmUtilizationInfoResponse
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
import com.pulumi.googlenative.vmmigration.v1.kotlin.outputs.StatusResponse.Companion.toKotlin as statusResponseToKotlin
import com.pulumi.googlenative.vmmigration.v1.kotlin.outputs.VmUtilizationInfoResponse.Companion.toKotlin as vmUtilizationInfoResponseToKotlin

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

    public var args: UtilizationReportArgs = UtilizationReportArgs()

    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 UtilizationReportArgsBuilder.() -> Unit) {
        val builder = UtilizationReportArgsBuilder()
        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(): UtilizationReport {
        val builtJavaResource =
            com.pulumi.googlenative.vmmigration.v1.UtilizationReport(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return UtilizationReport(builtJavaResource)
    }
}

/**
 * Creates a new UtilizationReport.
 * Auto-naming is currently not supported for this resource.
 */
public class UtilizationReport internal constructor(
    override val javaResource: com.pulumi.googlenative.vmmigration.v1.UtilizationReport,
) : KotlinCustomResource(javaResource, UtilizationReportMapper) {
    /**
     * The time the report was created (this refers to the time of the request, not the time the report creation completed).
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The report display name, as assigned by the user.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Provides details on the state of the report in case of an error.
     */
    public val error: Output
        get() = javaResource.error().applyValue({ args0 ->
            args0.let({ args0 ->
                statusResponseToKotlin(args0)
            })
        })

    /**
     * The point in time when the time frame ends. Notice that the time frame is counted backwards. For instance if the "frame_end_time" value is 2021/01/20 and the time frame is WEEK then the report covers the week between 2021/01/20 and 2021/01/14.
     */
    public val frameEndTime: Output
        get() = javaResource.frameEndTime().applyValue({ args0 -> args0 })

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

    /**
     * The report unique name.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

    /**
     * A 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. The server will guarantee that for at least 60 minutes since the first request. 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 sourceId: Output
        get() = javaResource.sourceId().applyValue({ args0 -> args0 })

    /**
     * Current state of the report.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * The time the state was last set.
     */
    public val stateTime: Output
        get() = javaResource.stateTime().applyValue({ args0 -> args0 })

    /**
     * Time frame of the report.
     */
    public val timeFrame: Output
        get() = javaResource.timeFrame().applyValue({ args0 -> args0 })

    /**
     * Required. The ID to use for the report, which will become the final component of the reports's resource name. This value maximum length is 63 characters, and valid characters are /a-z-/. It must start with an english letter and must not end with a hyphen.
     */
    public val utilizationReportId: Output
        get() = javaResource.utilizationReportId().applyValue({ args0 -> args0 })

    /**
     * Total number of VMs included in the report.
     */
    public val vmCount: Output
        get() = javaResource.vmCount().applyValue({ args0 -> args0 })

    /**
     * List of utilization information per VM. When sent as part of the request, the "vm_id" field is used in order to specify which VMs to include in the report. In that case all other fields are ignored.
     */
    public val vms: Output>
        get() = javaResource.vms().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    vmUtilizationInfoResponseToKotlin(args0)
                })
            })
        })
}

public object UtilizationReportMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.vmmigration.v1.UtilizationReport::class == javaResource::class

    override fun map(javaResource: Resource): UtilizationReport = UtilizationReport(
        javaResource as
            com.pulumi.googlenative.vmmigration.v1.UtilizationReport,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy