io.cloudshiftdev.awscdk.services.appsync.DataSourceOptions.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.appsync
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.String
import kotlin.Unit
/**
* Optional configuration for data sources.
*
* 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.appsync.*;
* DataSourceOptions dataSourceOptions = DataSourceOptions.builder()
* .description("description")
* .name("name")
* .build();
* ```
*/
public interface DataSourceOptions {
/**
* The description of the data source.
*
* Default: - No description
*/
public fun description(): String? = unwrap(this).getDescription()
/**
* The name of the data source, overrides the id given by cdk.
*
* Default: - generated by cdk given the id
*/
public fun name(): String? = unwrap(this).getName()
/**
* A builder for [DataSourceOptions]
*/
@CdkDslMarker
public interface Builder {
/**
* @param description The description of the data source.
*/
public fun description(description: String)
/**
* @param name The name of the data source, overrides the id given by cdk.
*/
public fun name(name: String)
}
private class BuilderImpl : Builder {
private val cdkBuilder: software.amazon.awscdk.services.appsync.DataSourceOptions.Builder =
software.amazon.awscdk.services.appsync.DataSourceOptions.builder()
/**
* @param description The description of the data source.
*/
override fun description(description: String) {
cdkBuilder.description(description)
}
/**
* @param name The name of the data source, overrides the id given by cdk.
*/
override fun name(name: String) {
cdkBuilder.name(name)
}
public fun build(): software.amazon.awscdk.services.appsync.DataSourceOptions =
cdkBuilder.build()
}
private class Wrapper(
cdkObject: software.amazon.awscdk.services.appsync.DataSourceOptions,
) : CdkObject(cdkObject),
DataSourceOptions {
/**
* The description of the data source.
*
* Default: - No description
*/
override fun description(): String? = unwrap(this).getDescription()
/**
* The name of the data source, overrides the id given by cdk.
*
* Default: - generated by cdk given the id
*/
override fun name(): String? = unwrap(this).getName()
}
public companion object {
public operator fun invoke(block: Builder.() -> Unit = {}): DataSourceOptions {
val builderImpl = BuilderImpl()
return Wrapper(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.appsync.DataSourceOptions):
DataSourceOptions = CdkObjectWrappers.wrap(cdkObject) as? DataSourceOptions ?:
Wrapper(cdkObject)
internal fun unwrap(wrapped: DataSourceOptions):
software.amazon.awscdk.services.appsync.DataSourceOptions = (wrapped as CdkObject).cdkObject
as software.amazon.awscdk.services.appsync.DataSourceOptions
}
}