io.cloudshiftdev.awscdk.services.apigateway.CfnModel.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.apigateway
import io.cloudshiftdev.awscdk.CfnResource
import io.cloudshiftdev.awscdk.IInspectable
import io.cloudshiftdev.awscdk.TreeInspector
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import kotlin.Any
import kotlin.String
import kotlin.Unit
import io.cloudshiftdev.constructs.Construct as CloudshiftdevConstructsConstruct
import software.constructs.Construct as SoftwareConstructsConstruct
/**
* The `AWS::ApiGateway::Model` resource defines the structure of a request or response payload for
* an API method.
*
* 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.apigateway.*;
* Object schema;
* CfnModel cfnModel = CfnModel.Builder.create(this, "MyCfnModel")
* .restApiId("restApiId")
* // the properties below are optional
* .contentType("contentType")
* .description("description")
* .name("name")
* .schema(schema)
* .build();
* ```
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html)
*/
public open class CfnModel(
cdkObject: software.amazon.awscdk.services.apigateway.CfnModel,
) : CfnResource(cdkObject),
IInspectable {
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: CfnModelProps,
) :
this(software.amazon.awscdk.services.apigateway.CfnModel(scope.let(CloudshiftdevConstructsConstruct.Companion::unwrap),
id, props.let(CfnModelProps.Companion::unwrap))
)
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: CfnModelProps.Builder.() -> Unit,
) : this(scope, id, CfnModelProps(props)
)
/**
* The content-type for the model.
*/
public open fun contentType(): String? = unwrap(this).getContentType()
/**
* The content-type for the model.
*/
public open fun contentType(`value`: String) {
unwrap(this).setContentType(`value`)
}
/**
* The description of the model.
*/
public open fun description(): String? = unwrap(this).getDescription()
/**
* The description of the model.
*/
public open fun description(`value`: String) {
unwrap(this).setDescription(`value`)
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector tree inspector to collect and process attributes.
*/
public override fun inspect(inspector: TreeInspector) {
unwrap(this).inspect(inspector.let(TreeInspector.Companion::unwrap))
}
/**
* A name for the model.
*/
public open fun name(): String? = unwrap(this).getName()
/**
* A name for the model.
*/
public open fun name(`value`: String) {
unwrap(this).setName(`value`)
}
/**
* The string identifier of the associated RestApi.
*/
public open fun restApiId(): String = unwrap(this).getRestApiId()
/**
* The string identifier of the associated RestApi.
*/
public open fun restApiId(`value`: String) {
unwrap(this).setRestApiId(`value`)
}
/**
* The schema for the model.
*/
public open fun schema(): Any? = unwrap(this).getSchema()
/**
* The schema for the model.
*/
public open fun schema(`value`: Any) {
unwrap(this).setSchema(`value`)
}
/**
* A fluent builder for [io.cloudshiftdev.awscdk.services.apigateway.CfnModel].
*/
@CdkDslMarker
public interface Builder {
/**
* The content-type for the model.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-contenttype)
* @param contentType The content-type for the model.
*/
public fun contentType(contentType: String)
/**
* The description of the model.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-description)
* @param description The description of the model.
*/
public fun description(description: String)
/**
* A name for the model.
*
* If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that
* ID for the model name. For more information, see [Name
* Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .
*
*
* If you specify a name, you cannot perform updates that require replacement of this resource.
* You can perform updates that require no or some interruption. If you must replace the resource,
* specify a new name.
*
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-name)
* @param name A name for the model.
*/
public fun name(name: String)
/**
* The string identifier of the associated RestApi.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-restapiid)
* @param restApiId The string identifier of the associated RestApi.
*/
public fun restApiId(restApiId: String)
/**
* The schema for the model.
*
* For `application/json` models, this should be JSON schema draft 4 model. Do not include "* /"
* characters in the description of any properties because such "* /" characters may be interpreted
* as the closing marker for comments in some languages, such as Java or JavaScript, causing the
* installation of your API's SDK generated by API Gateway to fail.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-schema)
* @param schema The schema for the model.
*/
public fun schema(schema: Any)
}
private class BuilderImpl(
scope: SoftwareConstructsConstruct,
id: String,
) : Builder {
private val cdkBuilder: software.amazon.awscdk.services.apigateway.CfnModel.Builder =
software.amazon.awscdk.services.apigateway.CfnModel.Builder.create(scope, id)
/**
* The content-type for the model.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-contenttype)
* @param contentType The content-type for the model.
*/
override fun contentType(contentType: String) {
cdkBuilder.contentType(contentType)
}
/**
* The description of the model.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-description)
* @param description The description of the model.
*/
override fun description(description: String) {
cdkBuilder.description(description)
}
/**
* A name for the model.
*
* If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that
* ID for the model name. For more information, see [Name
* Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .
*
*
* If you specify a name, you cannot perform updates that require replacement of this resource.
* You can perform updates that require no or some interruption. If you must replace the resource,
* specify a new name.
*
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-name)
* @param name A name for the model.
*/
override fun name(name: String) {
cdkBuilder.name(name)
}
/**
* The string identifier of the associated RestApi.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-restapiid)
* @param restApiId The string identifier of the associated RestApi.
*/
override fun restApiId(restApiId: String) {
cdkBuilder.restApiId(restApiId)
}
/**
* The schema for the model.
*
* For `application/json` models, this should be JSON schema draft 4 model. Do not include "* /"
* characters in the description of any properties because such "* /" characters may be interpreted
* as the closing marker for comments in some languages, such as Java or JavaScript, causing the
* installation of your API's SDK generated by API Gateway to fail.
*
* [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-model.html#cfn-apigateway-model-schema)
* @param schema The schema for the model.
*/
override fun schema(schema: Any) {
cdkBuilder.schema(schema)
}
public fun build(): software.amazon.awscdk.services.apigateway.CfnModel = cdkBuilder.build()
}
public companion object {
public val CFN_RESOURCE_TYPE_NAME: String =
software.amazon.awscdk.services.apigateway.CfnModel.CFN_RESOURCE_TYPE_NAME
public operator fun invoke(
scope: CloudshiftdevConstructsConstruct,
id: String,
block: Builder.() -> Unit = {},
): CfnModel {
val builderImpl = BuilderImpl(CloudshiftdevConstructsConstruct.unwrap(scope), id)
return CfnModel(builderImpl.apply(block).build())
}
internal fun wrap(cdkObject: software.amazon.awscdk.services.apigateway.CfnModel): CfnModel =
CfnModel(cdkObject)
internal fun unwrap(wrapped: CfnModel): software.amazon.awscdk.services.apigateway.CfnModel =
wrapped.cdkObject as software.amazon.awscdk.services.apigateway.CfnModel
}
}