models
Creates, updates, deletes, gets or lists a models resource.
Overview
| Name | models |
| Type | Resource |
| Id | aws.apigatewayv2.models |
Fields
The following fields are returned by SELECT queries:
- get_model
- get_models
| Name | Datatype | Description |
|---|---|---|
content_type | string | A string with a length between [1-256]. |
description | string | A string with a length between [0-1024]. |
model_id | string | The identifier. |
name | string | A string with a length between [1-128]. |
schema | string | A string with a length between [0-32768]. |
| Name | Datatype | Description |
|---|---|---|
content_type | string | A string with a length between [1-256]. |
description | string | A string with a length between [0-1024]. |
model_id | string | The identifier. |
name | string | A string with a length between [1-128]. |
schema | string | A string with a length between [0-32768]. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_model | select | api_id, model_id, region | Gets a Model. | |
get_models | select | api_id, region | maxResults, nextToken | Gets the Models for an API. |
create_model | insert | api_id, region | Creates a Model for an API. | |
update_model | update | api_id, model_id, region | Updates a Model. | |
delete_model | delete | api_id, model_id, region | Deletes a Model. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_id | string | The API identifier. |
model_id | string | The model ID. |
region | string | AWS region (default: us-east-1) |
maxResults | string | The maximum number of elements to be returned for this resource. |
nextToken | string | The next page of elements from this collection. Not valid for the last element of the collection. |
SELECT examples
- get_model
- get_models
Gets a Model.
SELECT
content_type,
description,
model_id,
name,
schema
FROM aws.apigatewayv2.models
WHERE api_id = '{{ api_id }}' -- required
AND model_id = '{{ model_id }}' -- required
AND region = '{{ region }}' -- required
;
Gets the Models for an API.
SELECT
content_type,
description,
model_id,
name,
schema
FROM aws.apigatewayv2.models
WHERE api_id = '{{ api_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_model
- Manifest
Creates a Model for an API.
INSERT INTO aws.apigatewayv2.models (
ContentType,
Description,
Name,
Schema,
api_id,
region
)
SELECT
'{{ ContentType }}',
'{{ Description }}',
'{{ Name }}',
'{{ Schema }}',
'{{ api_id }}',
'{{ region }}'
RETURNING
content_type,
description,
model_id,
name,
schema
;
# Description fields are for documentation purposes
- name: models
props:
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the models resource.
- name: region
value: "{{ region }}"
description: Required parameter for the models resource.
- name: ContentType
value: "{{ ContentType }}"
description: |
A string with a length between [1-256].
- name: Description
value: "{{ Description }}"
description: |
A string with a length between [0-1024].
- name: Name
value: "{{ Name }}"
description: |
A string with a length between [1-128].
- name: Schema
value: "{{ Schema }}"
description: |
A string with a length between [0-32768].
UPDATE examples
- update_model
Updates a Model.
UPDATE aws.apigatewayv2.models
SET
ContentType = '{{ ContentType }}',
Description = '{{ Description }}',
Name = '{{ Name }}',
Schema = '{{ Schema }}'
WHERE
api_id = '{{ api_id }}' --required
AND model_id = '{{ model_id }}' --required
AND region = '{{ region }}' --required
RETURNING
content_type,
description,
model_id,
name,
schema;
DELETE examples
- delete_model
Deletes a Model.
DELETE FROM aws.apigatewayv2.models
WHERE api_id = '{{ api_id }}' --required
AND model_id = '{{ model_id }}' --required
AND region = '{{ region }}' --required
;