StartCodegenJob - AmplifyUIBuilder

StartCodegenJob

Starts a code generation job for a specified Amplify app and backend environment.

Request Syntax

POST /app/appId/environment/environmentName/codegen-jobs?clientToken=clientToken HTTP/1.1 Content-type: application/json { "autoGenerateForms": boolean, "features": { "isNonModelSupported": boolean, "isRelationshipSupported": boolean }, "genericDataSchema": { "dataSourceType": "string", "enums": { "string" : { "values": [ "string" ] } }, "models": { "string" : { "fields": { "string" : { "dataType": "string", "dataTypeValue": "string", "isArray": boolean, "readOnly": boolean, "relationship": { "associatedFields": [ "string" ], "belongsToFieldOnRelatedModel": "string", "canUnlinkAssociatedModel": boolean, "isHasManyIndex": boolean, "relatedJoinFieldName": "string", "relatedJoinTableName": "string", "relatedModelFields": [ "string" ], "relatedModelName": "string", "type": "string" }, "required": boolean } }, "isJoinTable": boolean, "primaryKeys": [ "string" ] } }, "nonModels": { "string" : { "fields": { "string" : { "dataType": "string", "dataTypeValue": "string", "isArray": boolean, "readOnly": boolean, "relationship": { "associatedFields": [ "string" ], "belongsToFieldOnRelatedModel": "string", "canUnlinkAssociatedModel": boolean, "isHasManyIndex": boolean, "relatedJoinFieldName": "string", "relatedJoinTableName": "string", "relatedModelFields": [ "string" ], "relatedModelName": "string", "type": "string" }, "required": boolean } } } } }, "renderConfig": { ... }, "tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.

appId

The unique ID for the Amplify app.

Length Constraints: Minimum length of 1. Maximum length of 20.

Pattern: d[a-z0-9]+

Required: Yes

clientToken

The idempotency token used to ensure that the code generation job request completes only once.

environmentName

The name of the backend environment that is a part of the Amplify app.

Required: Yes

Request Body

The request accepts the following data in JSON format.

autoGenerateForms

Specifies whether to autogenerate forms in the code generation job.

Type: Boolean

Required: No

features

The feature flags for a code generation job.

Type: CodegenFeatureFlags object

Required: No

genericDataSchema

The data schema to use for a code generation job.

Type: CodegenJobGenericDataSchema object

Required: No

renderConfig

The code generation configuration for the codegen job.

Type: CodegenJobRenderConfig object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: Yes

tags

One or more key-value pairs to use when tagging the code generation job data.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: (?!aws:)[a-zA-Z+-=._:/]+

Value Length Constraints: Minimum length of 1. Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "appId": "string", "asset": { "downloadUrl": "string" }, "autoGenerateForms": boolean, "createdAt": "string", "dependencies": [ { "isSemVer": boolean, "name": "string", "reason": "string", "supportedVersion": "string" } ], "environmentName": "string", "features": { "isNonModelSupported": boolean, "isRelationshipSupported": boolean }, "genericDataSchema": { "dataSourceType": "string", "enums": { "string" : { "values": [ "string" ] } }, "models": { "string" : { "fields": { "string" : { "dataType": "string", "dataTypeValue": "string", "isArray": boolean, "readOnly": boolean, "relationship": { "associatedFields": [ "string" ], "belongsToFieldOnRelatedModel": "string", "canUnlinkAssociatedModel": boolean, "isHasManyIndex": boolean, "relatedJoinFieldName": "string", "relatedJoinTableName": "string", "relatedModelFields": [ "string" ], "relatedModelName": "string", "type": "string" }, "required": boolean } }, "isJoinTable": boolean, "primaryKeys": [ "string" ] } }, "nonModels": { "string" : { "fields": { "string" : { "dataType": "string", "dataTypeValue": "string", "isArray": boolean, "readOnly": boolean, "relationship": { "associatedFields": [ "string" ], "belongsToFieldOnRelatedModel": "string", "canUnlinkAssociatedModel": boolean, "isHasManyIndex": boolean, "relatedJoinFieldName": "string", "relatedJoinTableName": "string", "relatedModelFields": [ "string" ], "relatedModelName": "string", "type": "string" }, "required": boolean } } } } }, "id": "string", "modifiedAt": "string", "renderConfig": { ... }, "status": "string", "statusMessage": "string", "tags": { "string" : "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

appId

The ID of the Amplify app associated with the code generation job.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 20.

Pattern: d[a-z0-9]+

asset

The CodegenJobAsset to use for the code generation job.

Type: CodegenJobAsset object

autoGenerateForms

Specifies whether to autogenerate forms in the code generation job.

Type: Boolean

createdAt

The time that the code generation job was created.

Type: Timestamp

dependencies

Lists the dependency packages that may be required for the project code to run.

Type: Array of CodegenDependency objects

environmentName

The name of the backend environment associated with the code generation job.

Type: String

features

Describes the feature flags that you can specify for a code generation job.

Type: CodegenFeatureFlags object

genericDataSchema

Describes the data schema for a code generation job.

Type: CodegenJobGenericDataSchema object

id

The unique ID for the code generation job.

Type: String

modifiedAt

The time that the code generation job was modified.

Type: Timestamp

renderConfig

Describes the configuration information for rendering the UI component associated with the code generation job.

Type: CodegenJobRenderConfig object

Note: This object is a Union. Only one member of this object can be specified or returned.

status

The status of the code generation job.

Type: String

Valid Values: in_progress | failed | succeeded

statusMessage

The customized status message for the code generation job.

Type: String

tags

One or more key-value pairs to use when tagging the code generation job.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: (?!aws:)[a-zA-Z+-=._:/]+

Value Length Constraints: Minimum length of 1. Maximum length of 256.

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerException

An internal error has occurred. Please retry your request.

HTTP Status Code: 500

InvalidParameterException

An invalid or out-of-range value was supplied for the input parameter.

HTTP Status Code: 400

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: