Table of Contents

Class ModelProps

Namespace
Amazon.CDK.AWS.APIGateway
Assembly
Amazon.CDK.AWS.APIGateway.dll
public class ModelProps : IModelProps, IModelOptions
Inheritance
ModelProps
Implements
Inherited Members

Examples

// 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 default_;
            var enum_;
            JsonSchema jsonSchema_;
            RestApi restApi;

            var modelProps = new ModelProps {
                RestApi = restApi,
                Schema = new JsonSchema {
                    AdditionalItems = new [] { jsonSchema_ },
                    AdditionalProperties = false,
                    AllOf = new [] { jsonSchema_ },
                    AnyOf = new [] { jsonSchema_ },
                    Contains = jsonSchema_,
                    Default = default_,
                    Definitions = new Dictionary<string, JsonSchema> {
                        { "definitionsKey", jsonSchema_ }
                    },
                    Dependencies = new Dictionary<string, object> {
                        { "dependenciesKey", new [] { "dependencies" } }
                    },
                    Description = "description",
                    Enum = new [] { enum_ },
                    ExclusiveMaximum = false,
                    ExclusiveMinimum = false,
                    Format = "format",
                    Id = "id",
                    Items = jsonSchema_,
                    Maximum = 123,
                    MaxItems = 123,
                    MaxLength = 123,
                    MaxProperties = 123,
                    Minimum = 123,
                    MinItems = 123,
                    MinLength = 123,
                    MinProperties = 123,
                    MultipleOf = 123,
                    Not = jsonSchema_,
                    OneOf = new [] { jsonSchema_ },
                    Pattern = "pattern",
                    PatternProperties = new Dictionary<string, JsonSchema> {
                        { "patternPropertiesKey", jsonSchema_ }
                    },
                    Properties = new Dictionary<string, JsonSchema> {
                        { "propertiesKey", jsonSchema_ }
                    },
                    PropertyNames = jsonSchema_,
                    Ref = "ref",
                    Required = new [] { "required" },
                    Schema = JsonSchemaVersion.DRAFT4,
                    Title = "title",
                    Type = JsonSchemaType.NULL,
                    UniqueItems = false
                },

                // the properties below are optional
                ContentType = "contentType",
                Description = "description",
                ModelName = "modelName"
            };

Remarks

ExampleMetadata: fixture=_generated

Constructors

ModelProps()

public ModelProps()

Properties

ContentType

The content type for the model.

public string? ContentType { get; set; }

Property Value

string

Remarks

You can also force a content type in the request or response model mapping.

Default: 'application/json'

Description

A description that identifies this model.

public string? Description { get; set; }

Property Value

string

Remarks

Default: None

ModelName

public string? ModelName { get; set; }

Property Value

string

RestApi

The rest API that this model is part of.

public IRestApi RestApi { get; set; }

Property Value

IRestApi

Remarks

The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating it's hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.

Schema

The schema to use to transform data to one or more output formats.

public IJsonSchema Schema { get; set; }

Property Value

IJsonSchema

Remarks

Specify null ({}) if you don't want to specify a schema.