Models
Represents the collection of data models for an API. Supported only for WebSocket APIs. See Create Models and Mapping Templates for Request and Response Mappings
URI
/v2/apis/apiId/models
HTTP methods
GET
Operation ID: GetModels
Gets the Models for an API.
| Name | Type | Required | Description |
|---|---|---|---|
apiId | String | True | The API identifier. |
| Name | Type | Required | Description |
|---|---|---|---|
nextToken | String | False | The next page of elements from this collection. Not valid for the last element of the collection. |
maxResults | String | False | The maximum number of elements to be returned for this resource. |
| Status code | Response model | Description |
|---|---|---|
200 | Models | Success |
400 | BadRequestException | One of the parameters in the request is invalid. |
404 | NotFoundException | The resource specified in the request was not found. |
429 | LimitExceededException | The client is sending more than the allowed number of requests per unit of time. |
POST
Operation ID: CreateModel
Creates a Model for an API.
| Name | Type | Required | Description |
|---|---|---|---|
apiId | String | True | The API identifier. |
| Status code | Response model | Description |
|---|---|---|
201 | Model | The request has succeeded and has resulted in the creation of a resource. |
400 | BadRequestException | One of the parameters in the request is invalid. |
404 | NotFoundException | The resource specified in the request was not found. |
409 | ConflictException | The resource already exists. |
429 | LimitExceededException | The client is sending more than the allowed number of requests per unit of time. |
Schemas
Request bodies
{ "name name": "string", "description description": "string", "schema schema": "string", "contentType contentType": "string" }
Response bodies
{ "items items": [ { "modelId modelId": "string", "name name": "string", "description description": "string", "schema schema": "string", "contentType contentType": "string" } ], "nextToken nextToken": "string" }
{ "modelId modelId": "string", "name name": "string", "description description": "string", "schema schema": "string", "contentType contentType": "string" }
{ "message message": "string" }
{ "message message": "string", "resourceType resourceType": "string" }
{ "message message": "string" }
{ "message message": "string", "limitType limitType": "string" }
Properties
BadRequestException
The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
| Property | Type | Required | Description |
|---|---|---|---|
message | string | False | Describes the error encountered. |
message
Describes the error encountered.
Type: string
Required: False
ConflictException
The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.
| Property | Type | Required | Description |
|---|---|---|---|
message | string | False | Describes the error encountered. |
message
Describes the error encountered.
Type: string
Required: False
CreateModelInput
Represents the input parameters for a CreateModel request.
| Property | Type | Required | Description |
|---|---|---|---|
contentType | string | False | The content-type for the model, for example, "application/json". |
description | string | False | The description of the model. |
name | string | True | The name of the model. Must be alphanumeric. |
schema | string | True | The schema for the model. For application/json models, this should be JSON schema draft 4 model. |
name
The name of the model. Must be alphanumeric.
Type: string
Required: True
description
The description of the model.
Type: string
Required: False
schema
The schema for the model. For application/json models, this should be JSON schema draft 4 model.
Type: string
Required: True
contentType
The content-type for the model, for example, "application/json".
Type: string
Required: False
LimitExceededException
A limit has been exceeded. See the accompanying error message for details.
| Property | Type | Required | Description |
|---|---|---|---|
limitType | string | False | The limit type. |
message | string | False | Describes the error encountered. |
message
Describes the error encountered.
Type: string
Required: False
limitType
The limit type.
Type: string
Required: False
Model
Represents a data model for an API. Supported only for WebSocket APIs. See Create Models and Mapping Templates for Request and Response Mappings
| Property | Type | Required | Description |
|---|---|---|---|
contentType | string | False | The content-type for the model, for example, "application/json". |
description | string | False | The description of the model. |
modelId | string | False | The model identifier. |
name | string | True | The name of the model. Must be alphanumeric. |
schema | string | False | The schema for the model. For application/json models, this should be JSON schema draft 4 model. |
modelId
The model identifier.
Type: string
Required: False
name
The name of the model. Must be alphanumeric.
Type: string
Required: True
description
The description of the model.
Type: string
Required: False
schema
The schema for the model. For application/json models, this should be JSON schema draft 4 model.
Type: string
Required: False
contentType
The content-type for the model, for example, "application/json".
Type: string
Required: False
Models
Represents a collection of data models. See Create Models and Mapping Templates for Request and Response Mappings
| Property | Type | Required | Description |
|---|---|---|---|
items | Array of type Model | False | The elements from this collection. |
nextToken | string | False | The next page of elements from this collection. Not valid for the last element of the collection. |
items
The elements from this collection.
Type: Array of type Model
Required: False
nextToken
The next page of elements from this collection. Not valid for the last element of the collection.
Type: string
Required: False
NotFoundException
The resource specified in the request was not found. See the message field for more information.
| Property | Type | Required | Description |
|---|---|---|---|
message | string | False | Describes the error encountered. |
resourceType | string | False | The resource type. |
message
Describes the error encountered.
Type: string
Required: False
resourceType
The resource type.
Type: string
Required: False