Class ModelProps
Inheritance
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.AWS.APIGateway.dll
Syntax (csharp)
public class ModelProps : Object, IModelProps, IModelOptions
Syntax (vb)
Public Class ModelProps
Inherits Object
Implements IModelProps, IModelOptions
Remarks
ExampleMetadata: fixture=_generated
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"
};
Synopsis
Constructors
ModelProps() |
Properties
ContentType | The content type for the model. |
Description | A description that identifies this model. |
ModelName | |
RestApi | The rest API that this model is part of. |
Schema | The schema to use to transform data to one or more output formats. |
Constructors
ModelProps()
public ModelProps()
Properties
ContentType
The content type for the model.
public string ContentType { get; set; }
Property Value
System.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
System.String
Remarks
Default: None
ModelName
public string ModelName { get; set; }
Property Value
System.String
RestApi
The rest API that this model is part of.
public IRestApi RestApi { get; set; }
Property Value
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
Remarks
Specify null ({}) if you don't want to specify a schema.