io.cloudshiftdev.awscdk.services.ec2.CfnNetworkAclProps.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.ec2
import io.cloudshiftdev.awscdk.CfnTag
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
/**
* Properties for defining a `CfnNetworkAcl`.
*
* Example:
*
* ```
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import io.cloudshiftdev.awscdk.services.ec2.*;
* CfnNetworkAclProps cfnNetworkAclProps = CfnNetworkAclProps.builder()
* .vpcId("vpcId")
* // the properties below are optional
* .tags(List.of(CfnTag.builder()
* .key("key")
* .value("value")
* .build()))
* .build();
* ```
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkacl.html)
*/
public interface CfnNetworkAclProps {
/**
* The tags for the network ACL.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkacl.html#cfn-ec2-networkacl-tags)
*/
public fun tags(): List = unwrap(this).getTags()?.map(CfnTag::wrap) ?: emptyList()
/**
* The ID of the VPC for the network ACL.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkacl.html#cfn-ec2-networkacl-vpcid)
*/
public fun vpcId(): String
/**
* A builder for [CfnNetworkAclProps]
*/
@CdkDslMarker
public interface Builder {
/**
* @param tags The tags for the network ACL.
*/
public fun tags(tags: List)
/**
* @param tags The tags for the network ACL.
*/
public fun tags(vararg tags: CfnTag)
/**
* @param vpcId The ID of the VPC for the network ACL.
*/
public fun vpcId(vpcId: String)
}
private class BuilderImpl : Builder {
private val cdkBuilder: software.amazon.awscdk.services.ec2.CfnNetworkAclProps.Builder =
software.amazon.awscdk.services.ec2.CfnNetworkAclProps.builder()
/**
* @param tags The tags for the network ACL.
*/
override fun tags(tags: List) {
cdkBuilder.tags(tags.map(CfnTag.Companion::unwrap))
}
/**
* @param tags The tags for the network ACL.
*/
override fun tags(vararg tags: CfnTag): Unit = tags(tags.toList())
/**
* @param vpcId The ID of the VPC for the network ACL.
*/
override fun vpcId(vpcId: String) {
cdkBuilder.vpcId(vpcId)
}
public fun build(): software.amazon.awscdk.services.ec2.CfnNetworkAclProps = cdkBuilder.build()
}
private class Wrapper(
cdkObject: software.amazon.awscdk.services.ec2.CfnNetworkAclProps,
) : CdkObject(cdkObject),
CfnNetworkAclProps {
/**
* The tags for the network ACL.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkacl.html#cfn-ec2-networkacl-tags)
*/
override fun tags(): List = unwrap(this).getTags()?.map(CfnTag::wrap) ?: emptyList()
/**
* The ID of the VPC for the network ACL.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkacl.html#cfn-ec2-networkacl-vpcid)
*/
override fun vpcId(): String = unwrap(this).getVpcId()
}
public companion object {
public operator fun invoke(block: Builder.() -> Unit = {}): CfnNetworkAclProps {
val builderImpl = BuilderImpl()
return Wrapper(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.ec2.CfnNetworkAclProps):
CfnNetworkAclProps = CdkObjectWrappers.wrap(cdkObject) as? CfnNetworkAclProps ?:
Wrapper(cdkObject)
internal fun unwrap(wrapped: CfnNetworkAclProps):
software.amazon.awscdk.services.ec2.CfnNetworkAclProps = (wrapped as CdkObject).cdkObject as
software.amazon.awscdk.services.ec2.CfnNetworkAclProps
}
}