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

com.pulumi.gcp.apigee.kotlin.Api.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.

There is a newer version: 8.20.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.apigee.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.apigee.kotlin.outputs.ApiMetaData
import com.pulumi.gcp.apigee.kotlin.outputs.ApiMetaData.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: ApiArgs = ApiArgs()

    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 ApiArgsBuilder.() -> Unit) {
        val builder = ApiArgsBuilder()
        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(): Api {
        val builtJavaResource = com.pulumi.gcp.apigee.Api(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Api(builtJavaResource)
    }
}

/**
 * To get more information about API proxies see, see:
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.apis)
 * * How-to Guides
 *   * [API proxies](https://cloud.google.com/apigee/docs/resources)
 * ## Import
 * An API proxy can be imported using any of these accepted formats:
 * * `{{org_id}}/apis/{{name}}`
 * * `{{org_id}}/{{name}}`
 * When using the `pulumi import` command, API proxy can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:apigee/api:Api default {{org_id}}/apis/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:apigee/api:Api default {{org_id}}/{{name}}
 * ```
 */
public class Api internal constructor(
    override val javaResource: com.pulumi.gcp.apigee.Api,
) : KotlinCustomResource(javaResource, ApiMapper) {
    /**
     * Path to the config zip bundle.
     * - - -
     */
    public val configBundle: Output
        get() = javaResource.configBundle().applyValue({ args0 -> args0 })

    public val detectMd5hash: Output?
        get() = javaResource.detectMd5hash().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The id of the most recently created revision for this API proxy.
     */
    public val latestRevisionId: Output
        get() = javaResource.latestRevisionId().applyValue({ args0 -> args0 })

    /**
     * (Computed) Base 64 MD5 hash of the uploaded data. It is speculative as remote does not return hash of the bundle. Remote changes are detected using returned last_modified timestamp.
     */
    public val md5hash: Output
        get() = javaResource.md5hash().applyValue({ args0 -> args0 })

    /**
     * Metadata describing the API proxy.
     * Structure is documented below.
     */
    public val metaDatas: Output>
        get() = javaResource.metaDatas().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            })
        })

    /**
     * The ID of the API proxy.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The Apigee Organization name associated with the Apigee instance.
     */
    public val orgId: Output
        get() = javaResource.orgId().applyValue({ args0 -> args0 })

    /**
     * A list of revisions of this API proxy.
     */
    public val revisions: Output>
        get() = javaResource.revisions().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

public object ApiMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.apigee.Api::class == javaResource::class

    override fun map(javaResource: Resource): Api = Api(javaResource as com.pulumi.gcp.apigee.Api)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy