![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.digitalocean.kotlin.DigitaloceanProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-digitalocean-kotlin Show documentation
Show all versions of pulumi-digitalocean-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.digitalocean.kotlin
import com.pulumi.core.Output
import com.pulumi.digitalocean.Provider
import com.pulumi.kotlin.KotlinProviderResource
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 [DigitaloceanProvider].
*/
@PulumiTagMarker
public class DigitaloceanProviderResourceBuilder internal constructor() {
public var name: String? = null
public var args: ProviderArgs = ProviderArgs()
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 ProviderArgsBuilder.() -> Unit) {
val builder = ProviderArgsBuilder()
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(): DigitaloceanProvider {
val builtJavaResource = Provider(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DigitaloceanProvider(builtJavaResource)
}
}
/**
* The provider type for the digitalocean package. By default, resources use package-wide configuration
* settings, however an explicit `Provider` instance may be created and passed during resource
* construction to achieve fine-grained programmatic control over provider settings. See the
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
*/
public class DigitaloceanProvider internal constructor(
override val javaResource: Provider,
) : KotlinProviderResource(javaResource, DigitaloceanProviderMapper) {
/**
* The URL to use for the DigitalOcean API.
*/
public val apiEndpoint: Output?
get() = javaResource.apiEndpoint().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The access key ID for Spaces API operations.
*/
public val spacesAccessId: Output?
get() = javaResource.spacesAccessId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The URL to use for the DigitalOcean Spaces API.
*/
public val spacesEndpoint: Output?
get() = javaResource.spacesEndpoint().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The secret access key for Spaces API operations.
*/
public val spacesSecretKey: Output?
get() = javaResource.spacesSecretKey().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The token key for API operations.
*/
public val token: Output?
get() = javaResource.token().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object DigitaloceanProviderMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
Provider::class == javaResource::class
override fun map(javaResource: Resource): DigitaloceanProvider = DigitaloceanProvider(
javaResource
as Provider,
)
}
/**
* @see [Provider].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [DigitaloceanProvider].
*/
public suspend fun digitaloceanProvider(
name: String,
block: suspend DigitaloceanProviderResourceBuilder.() -> Unit,
): DigitaloceanProvider {
val builder = DigitaloceanProviderResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Provider].
* @param name The _unique_ name of the resulting resource.
*/
public fun digitaloceanProvider(name: String): DigitaloceanProvider {
val builder = DigitaloceanProviderResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy