Skip to content
v2.277.0

CfnModelProps Struct ​

Properties for defining a CfnModel.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';

declare const schema: any;
const cfnModelProps: apigateway.CfnModelProps = {
  restApiId: 'restApiId',

  // the properties below are optional
  contentType: 'contentType',
  description: 'description',
  name: 'name',
  schema: schema,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigateway as apigateway

# schema: Any

cfn_model_props = apigateway.CfnModelProps(
    rest_api_id="restApiId",

    # the properties below are optional
    content_type="contentType",
    description="description",
    name="name",
    schema=schema
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;

Object schema;

CfnModelProps cfnModelProps = CfnModelProps.builder()
        .restApiId("restApiId")

        // the properties below are optional
        .contentType("contentType")
        .description("description")
        .name("name")
        .schema(schema)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;

var schema;

var cfnModelProps = new CfnModelProps {
    RestApiId = "restApiId",

    // the properties below are optional
    ContentType = "contentType",
    Description = "description",
    Name = "name",
    Schema = schema
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var schema interface{}

cfnModelProps := &CfnModelProps{
	RestApiId: jsii.String("restApiId"),

	// the properties below are optional
	ContentType: jsii.String("contentType"),
	Description: jsii.String("description"),
	Name: jsii.String("name"),
	Schema: schema,
}

Properties ​

contentTypeoptionalstringcontent_typeoptionalstrcontentTypeoptionalStringContentTypeoptionalstringContentTypeoptional*string#
The content-type for the model.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description of the model.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
A name for the model.
notes

If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the model name. For more information, see Name Type .

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.

restApiIdstring | IRestApiRefrest_api_idtyping.Union[str, IRestApiRef]restApiIdStringRestApiIdstringRestApiIdinterface{}required#
The string identifier of the associated RestApi.
schemaoptionalanyschemaoptionalAnyschemaoptionalObjectSchemaoptionalobjectSchemaoptionalinterface{}#
The schema for the model.
notes

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.