com.pulumi.awsnative.codeartifact.kotlin.Repository.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.codeartifact.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin
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.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [Repository].
*/
@PulumiTagMarker
public class RepositoryResourceBuilder internal constructor() {
public var name: String? = null
public var args: RepositoryArgs = RepositoryArgs()
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 RepositoryArgsBuilder.() -> Unit) {
val builder = RepositoryArgsBuilder()
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(): Repository {
val builtJavaResource = com.pulumi.awsnative.codeartifact.Repository(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Repository(builtJavaResource)
}
}
/**
* The resource schema to create a CodeArtifact repository.
*/
public class Repository internal constructor(
override val javaResource: com.pulumi.awsnative.codeartifact.Repository,
) : KotlinCustomResource(javaResource, RepositoryMapper) {
/**
* The ARN of the repository.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* A text description of the repository.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the domain that contains the repository.
*/
public val domainName: Output
get() = javaResource.domainName().applyValue({ args0 -> args0 })
/**
* The 12-digit account ID of the AWS account that owns the domain.
*/
public val domainOwner: Output
get() = javaResource.domainOwner().applyValue({ args0 -> args0 })
/**
* A list of external connections associated with the repository.
*/
public val externalConnections: Output>?
get() = javaResource.externalConnections().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The name of the repository. This is used for GetAtt
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The access control resource policy on the provided repository.
* Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::CodeArtifact::Repository` for more information about the expected schema for this property.
*/
public val permissionsPolicyDocument: Output?
get() = javaResource.permissionsPolicyDocument().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the repository.
*/
public val repositoryName: Output
get() = javaResource.repositoryName().applyValue({ args0 -> args0 })
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* A list of upstream repositories associated with the repository.
*/
public val upstreams: Output>?
get() = javaResource.upstreams().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
}
public object RepositoryMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.codeartifact.Repository::class == javaResource::class
override fun map(javaResource: Resource): Repository = Repository(
javaResource as
com.pulumi.awsnative.codeartifact.Repository,
)
}
/**
* @see [Repository].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Repository].
*/
public suspend fun repository(name: String, block: suspend RepositoryResourceBuilder.() -> Unit): Repository {
val builder = RepositoryResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Repository].
* @param name The _unique_ name of the resulting resource.
*/
public fun repository(name: String): Repository {
val builder = RepositoryResourceBuilder()
builder.name(name)
return builder.build()
}