io.cloudshiftdev.awscdk.services.appmesh.CfnVirtualRouterProps.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.appmesh
import io.cloudshiftdev.awscdk.CfnTag
import io.cloudshiftdev.awscdk.IResolvable
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.Any
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Properties for defining a `CfnVirtualRouter`.
*
* 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.appmesh.*;
* CfnVirtualRouterProps cfnVirtualRouterProps = CfnVirtualRouterProps.builder()
* .meshName("meshName")
* .spec(VirtualRouterSpecProperty.builder()
* .listeners(List.of(VirtualRouterListenerProperty.builder()
* .portMapping(PortMappingProperty.builder()
* .port(123)
* .protocol("protocol")
* .build())
* .build()))
* .build())
* // the properties below are optional
* .meshOwner("meshOwner")
* .tags(List.of(CfnTag.builder()
* .key("key")
* .value("value")
* .build()))
* .virtualRouterName("virtualRouterName")
* .build();
* ```
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html)
*/
public interface CfnVirtualRouterProps {
/**
* The name of the service mesh to create the virtual router in.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-meshname)
*/
public fun meshName(): String
/**
* The AWS IAM account ID of the service mesh owner.
*
* If the account ID is not your own, then the account that you specify must share the mesh with
* your account before you can create the resource in the service mesh. For more information about
* mesh sharing, see [Working with shared
* meshes](https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html) .
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-meshowner)
*/
public fun meshOwner(): String? = unwrap(this).getMeshOwner()
/**
* The virtual router specification to apply.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-spec)
*/
public fun spec(): Any
/**
* Optional metadata that you can apply to the virtual router to assist with categorization and
* organization.
*
* Each tag consists of a key and an optional value, both of which you define. Tag keys can have a
* maximum character length of 128 characters, and tag values can have a maximum length of 256
* characters.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-tags)
*/
public fun tags(): List = unwrap(this).getTags()?.map(CfnTag::wrap) ?: emptyList()
/**
* The name to use for the virtual router.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-virtualroutername)
*/
public fun virtualRouterName(): String? = unwrap(this).getVirtualRouterName()
/**
* A builder for [CfnVirtualRouterProps]
*/
@CdkDslMarker
public interface Builder {
/**
* @param meshName The name of the service mesh to create the virtual router in.
*/
public fun meshName(meshName: String)
/**
* @param meshOwner The AWS IAM account ID of the service mesh owner.
* If the account ID is not your own, then the account that you specify must share the mesh with
* your account before you can create the resource in the service mesh. For more information about
* mesh sharing, see [Working with shared
* meshes](https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html) .
*/
public fun meshOwner(meshOwner: String)
/**
* @param spec The virtual router specification to apply.
*/
public fun spec(spec: IResolvable)
/**
* @param spec The virtual router specification to apply.
*/
public fun spec(spec: CfnVirtualRouter.VirtualRouterSpecProperty)
/**
* @param spec The virtual router specification to apply.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("38688338386ed44de1571840a3ff881e54800adcdcd1ef0dd036e8834cee97f6")
public fun spec(spec: CfnVirtualRouter.VirtualRouterSpecProperty.Builder.() -> Unit)
/**
* @param tags Optional metadata that you can apply to the virtual router to assist with
* categorization and organization.
* Each tag consists of a key and an optional value, both of which you define. Tag keys can have
* a maximum character length of 128 characters, and tag values can have a maximum length of 256
* characters.
*/
public fun tags(tags: List)
/**
* @param tags Optional metadata that you can apply to the virtual router to assist with
* categorization and organization.
* Each tag consists of a key and an optional value, both of which you define. Tag keys can have
* a maximum character length of 128 characters, and tag values can have a maximum length of 256
* characters.
*/
public fun tags(vararg tags: CfnTag)
/**
* @param virtualRouterName The name to use for the virtual router.
*/
public fun virtualRouterName(virtualRouterName: String)
}
private class BuilderImpl : Builder {
private val cdkBuilder: software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps.Builder =
software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps.builder()
/**
* @param meshName The name of the service mesh to create the virtual router in.
*/
override fun meshName(meshName: String) {
cdkBuilder.meshName(meshName)
}
/**
* @param meshOwner The AWS IAM account ID of the service mesh owner.
* If the account ID is not your own, then the account that you specify must share the mesh with
* your account before you can create the resource in the service mesh. For more information about
* mesh sharing, see [Working with shared
* meshes](https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html) .
*/
override fun meshOwner(meshOwner: String) {
cdkBuilder.meshOwner(meshOwner)
}
/**
* @param spec The virtual router specification to apply.
*/
override fun spec(spec: IResolvable) {
cdkBuilder.spec(spec.let(IResolvable.Companion::unwrap))
}
/**
* @param spec The virtual router specification to apply.
*/
override fun spec(spec: CfnVirtualRouter.VirtualRouterSpecProperty) {
cdkBuilder.spec(spec.let(CfnVirtualRouter.VirtualRouterSpecProperty.Companion::unwrap))
}
/**
* @param spec The virtual router specification to apply.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("38688338386ed44de1571840a3ff881e54800adcdcd1ef0dd036e8834cee97f6")
override fun spec(spec: CfnVirtualRouter.VirtualRouterSpecProperty.Builder.() -> Unit): Unit =
spec(CfnVirtualRouter.VirtualRouterSpecProperty(spec))
/**
* @param tags Optional metadata that you can apply to the virtual router to assist with
* categorization and organization.
* Each tag consists of a key and an optional value, both of which you define. Tag keys can have
* a maximum character length of 128 characters, and tag values can have a maximum length of 256
* characters.
*/
override fun tags(tags: List) {
cdkBuilder.tags(tags.map(CfnTag.Companion::unwrap))
}
/**
* @param tags Optional metadata that you can apply to the virtual router to assist with
* categorization and organization.
* Each tag consists of a key and an optional value, both of which you define. Tag keys can have
* a maximum character length of 128 characters, and tag values can have a maximum length of 256
* characters.
*/
override fun tags(vararg tags: CfnTag): Unit = tags(tags.toList())
/**
* @param virtualRouterName The name to use for the virtual router.
*/
override fun virtualRouterName(virtualRouterName: String) {
cdkBuilder.virtualRouterName(virtualRouterName)
}
public fun build(): software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps =
cdkBuilder.build()
}
private class Wrapper(
cdkObject: software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps,
) : CdkObject(cdkObject),
CfnVirtualRouterProps {
/**
* The name of the service mesh to create the virtual router in.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-meshname)
*/
override fun meshName(): String = unwrap(this).getMeshName()
/**
* The AWS IAM account ID of the service mesh owner.
*
* If the account ID is not your own, then the account that you specify must share the mesh with
* your account before you can create the resource in the service mesh. For more information about
* mesh sharing, see [Working with shared
* meshes](https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html) .
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-meshowner)
*/
override fun meshOwner(): String? = unwrap(this).getMeshOwner()
/**
* The virtual router specification to apply.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-spec)
*/
override fun spec(): Any = unwrap(this).getSpec()
/**
* Optional metadata that you can apply to the virtual router to assist with categorization and
* organization.
*
* Each tag consists of a key and an optional value, both of which you define. Tag keys can have
* a maximum character length of 128 characters, and tag values can have a maximum length of 256
* characters.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-tags)
*/
override fun tags(): List = unwrap(this).getTags()?.map(CfnTag::wrap) ?: emptyList()
/**
* The name to use for the virtual router.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appmesh-virtualrouter.html#cfn-appmesh-virtualrouter-virtualroutername)
*/
override fun virtualRouterName(): String? = unwrap(this).getVirtualRouterName()
}
public companion object {
public operator fun invoke(block: Builder.() -> Unit = {}): CfnVirtualRouterProps {
val builderImpl = BuilderImpl()
return Wrapper(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps):
CfnVirtualRouterProps = CdkObjectWrappers.wrap(cdkObject) as? CfnVirtualRouterProps ?:
Wrapper(cdkObject)
internal fun unwrap(wrapped: CfnVirtualRouterProps):
software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps = (wrapped as
CdkObject).cdkObject as software.amazon.awscdk.services.appmesh.CfnVirtualRouterProps
}
}