AmplifyUIBuilder / Client / start_codegen_job

start_codegen_job#

AmplifyUIBuilder.Client.start_codegen_job(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.start_codegen_job(
    appId='string',
    environmentName='string',
    clientToken='string',
    codegenJobToCreate={
        'renderConfig': {
            'react': {
                'module': 'es2020'|'esnext',
                'target': 'es2015'|'es2020',
                'script': 'jsx'|'tsx'|'js',
                'renderTypeDeclarations': True|False,
                'inlineSourceMap': True|False,
                'apiConfiguration': {
                    'graphQLConfig': {
                        'typesFilePath': 'string',
                        'queriesFilePath': 'string',
                        'mutationsFilePath': 'string',
                        'subscriptionsFilePath': 'string',
                        'fragmentsFilePath': 'string'
                    },
                    'dataStoreConfig': {}
                    ,
                    'noApiConfig': {}

                },
                'dependencies': {
                    'string': 'string'
                }
            }
        },
        'genericDataSchema': {
            'dataSourceType': 'DataStore',
            'models': {
                'string': {
                    'fields': {
                        'string': {
                            'dataType': 'ID'|'String'|'Int'|'Float'|'AWSDate'|'AWSTime'|'AWSDateTime'|'AWSTimestamp'|'AWSEmail'|'AWSURL'|'AWSIPAddress'|'Boolean'|'AWSJSON'|'AWSPhone'|'Enum'|'Model'|'NonModel',
                            'dataTypeValue': 'string',
                            'required': True|False,
                            'readOnly': True|False,
                            'isArray': True|False,
                            'relationship': {
                                'type': 'HAS_MANY'|'HAS_ONE'|'BELONGS_TO',
                                'relatedModelName': 'string',
                                'relatedModelFields': [
                                    'string',
                                ],
                                'canUnlinkAssociatedModel': True|False,
                                'relatedJoinFieldName': 'string',
                                'relatedJoinTableName': 'string',
                                'belongsToFieldOnRelatedModel': 'string',
                                'associatedFields': [
                                    'string',
                                ],
                                'isHasManyIndex': True|False
                            }
                        }
                    },
                    'isJoinTable': True|False,
                    'primaryKeys': [
                        'string',
                    ]
                }
            },
            'enums': {
                'string': {
                    'values': [
                        'string',
                    ]
                }
            },
            'nonModels': {
                'string': {
                    'fields': {
                        'string': {
                            'dataType': 'ID'|'String'|'Int'|'Float'|'AWSDate'|'AWSTime'|'AWSDateTime'|'AWSTimestamp'|'AWSEmail'|'AWSURL'|'AWSIPAddress'|'Boolean'|'AWSJSON'|'AWSPhone'|'Enum'|'Model'|'NonModel',
                            'dataTypeValue': 'string',
                            'required': True|False,
                            'readOnly': True|False,
                            'isArray': True|False,
                            'relationship': {
                                'type': 'HAS_MANY'|'HAS_ONE'|'BELONGS_TO',
                                'relatedModelName': 'string',
                                'relatedModelFields': [
                                    'string',
                                ],
                                'canUnlinkAssociatedModel': True|False,
                                'relatedJoinFieldName': 'string',
                                'relatedJoinTableName': 'string',
                                'belongsToFieldOnRelatedModel': 'string',
                                'associatedFields': [
                                    'string',
                                ],
                                'isHasManyIndex': True|False
                            }
                        }
                    }
                }
            }
        },
        'autoGenerateForms': True|False,
        'features': {
            'isRelationshipSupported': True|False,
            'isNonModelSupported': True|False
        },
        'tags': {
            'string': 'string'
        }
    }
)
Parameters:
  • appId (string) –

    [REQUIRED]

    The unique ID for the Amplify app.

  • environmentName (string) –

    [REQUIRED]

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

  • clientToken (string) –

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

    This field is autopopulated if not provided.

  • codegenJobToCreate (dict) –

    [REQUIRED]

    The code generation job resource configuration.

    • renderConfig (dict) – [REQUIRED]

      The code generation configuration for the codegen job.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: react.

      • react (dict) –

        The name of the ReactStartCodegenJobData object.

        • module (string) –

          The JavaScript module type.

        • target (string) –

          The ECMAScript specification to use.

        • script (string) –

          The file type to use for a JavaScript project.

        • renderTypeDeclarations (boolean) –

          Specifies whether the code generation job should render type declaration files.

        • inlineSourceMap (boolean) –

          Specifies whether the code generation job should render inline source maps.

        • apiConfiguration (dict) –

          The API configuration for the code generation job.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: graphQLConfig, dataStoreConfig, noApiConfig.

          • graphQLConfig (dict) –

            The configuration for an application using GraphQL APIs.

            • typesFilePath (string) – [REQUIRED]

              The path to the GraphQL types file, relative to the component output directory.

            • queriesFilePath (string) – [REQUIRED]

              The path to the GraphQL queries file, relative to the component output directory.

            • mutationsFilePath (string) – [REQUIRED]

              The path to the GraphQL mutations file, relative to the component output directory.

            • subscriptionsFilePath (string) – [REQUIRED]

              The path to the GraphQL subscriptions file, relative to the component output directory.

            • fragmentsFilePath (string) – [REQUIRED]

              The path to the GraphQL fragments file, relative to the component output directory.

          • dataStoreConfig (dict) –

            The configuration for an application using DataStore APIs.

          • noApiConfig (dict) –

            The configuration for an application with no API being used.

        • dependencies (dict) –

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

          • (string) –

            • (string) –

    • genericDataSchema (dict) –

      The data schema to use for a code generation job.

      • dataSourceType (string) – [REQUIRED]

        The type of the data source for the schema. Currently, the only valid value is an Amplify DataStore.

      • models (dict) – [REQUIRED]

        The name of a CodegenGenericDataModel.

        • (string) –

          • (dict) –

            Describes a model in a generic data schema.

            • fields (dict) – [REQUIRED]

              The fields in the generic data model.

              • (string) –

                • (dict) –

                  Describes a field in a generic data schema.

                  • dataType (string) – [REQUIRED]

                    The data type for the generic data field.

                  • dataTypeValue (string) – [REQUIRED]

                    The value of the data type for the generic data field.

                  • required (boolean) – [REQUIRED]

                    Specifies whether the generic data field is required.

                  • readOnly (boolean) – [REQUIRED]

                    Specifies whether the generic data field is read-only.

                  • isArray (boolean) – [REQUIRED]

                    Specifies whether the generic data field is an array.

                  • relationship (dict) –

                    The relationship of the generic data schema.

                    • type (string) – [REQUIRED]

                      The data relationship type.

                    • relatedModelName (string) – [REQUIRED]

                      The name of the related model in the data relationship.

                    • relatedModelFields (list) –

                      The related model fields in the data relationship.

                      • (string) –

                    • canUnlinkAssociatedModel (boolean) –

                      Specifies whether the relationship can unlink the associated model.

                    • relatedJoinFieldName (string) –

                      The name of the related join field in the data relationship.

                    • relatedJoinTableName (string) –

                      The name of the related join table in the data relationship.

                    • belongsToFieldOnRelatedModel (string) –

                      The value of the belongsTo field on the related data model.

                    • associatedFields (list) –

                      The associated fields of the data relationship.

                      • (string) –

                    • isHasManyIndex (boolean) –

                      Specifies whether the @index directive is supported for a hasMany data relationship.

            • isJoinTable (boolean) –

              Specifies whether the generic data model is a join table.

            • primaryKeys (list) – [REQUIRED]

              The primary keys of the generic data model.

              • (string) –

      • enums (dict) – [REQUIRED]

        The name of a CodegenGenericDataEnum.

        • (string) –

          • (dict) –

            Describes the enums in a generic data schema.

            • values (list) – [REQUIRED]

              The list of enum values in the generic data schema.

              • (string) –

      • nonModels (dict) – [REQUIRED]

        The name of a CodegenGenericDataNonModel.

        • (string) –

          • (dict) –

            Describes a non-model in a generic data schema.

            • fields (dict) – [REQUIRED]

              The fields in a generic data schema non model.

              • (string) –

                • (dict) –

                  Describes a field in a generic data schema.

                  • dataType (string) – [REQUIRED]

                    The data type for the generic data field.

                  • dataTypeValue (string) – [REQUIRED]

                    The value of the data type for the generic data field.

                  • required (boolean) – [REQUIRED]

                    Specifies whether the generic data field is required.

                  • readOnly (boolean) – [REQUIRED]

                    Specifies whether the generic data field is read-only.

                  • isArray (boolean) – [REQUIRED]

                    Specifies whether the generic data field is an array.

                  • relationship (dict) –

                    The relationship of the generic data schema.

                    • type (string) – [REQUIRED]

                      The data relationship type.

                    • relatedModelName (string) – [REQUIRED]

                      The name of the related model in the data relationship.

                    • relatedModelFields (list) –

                      The related model fields in the data relationship.

                      • (string) –

                    • canUnlinkAssociatedModel (boolean) –

                      Specifies whether the relationship can unlink the associated model.

                    • relatedJoinFieldName (string) –

                      The name of the related join field in the data relationship.

                    • relatedJoinTableName (string) –

                      The name of the related join table in the data relationship.

                    • belongsToFieldOnRelatedModel (string) –

                      The value of the belongsTo field on the related data model.

                    • associatedFields (list) –

                      The associated fields of the data relationship.

                      • (string) –

                    • isHasManyIndex (boolean) –

                      Specifies whether the @index directive is supported for a hasMany data relationship.

    • autoGenerateForms (boolean) –

      Specifies whether to autogenerate forms in the code generation job.

    • features (dict) –

      The feature flags for a code generation job.

      • isRelationshipSupported (boolean) –

        Specifes whether a code generation job supports data relationships.

      • isNonModelSupported (boolean) –

        Specifies whether a code generation job supports non models.

    • tags (dict) –

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

      • (string) –

        • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'entity': {
        'id': 'string',
        'appId': 'string',
        'environmentName': 'string',
        'renderConfig': {
            'react': {
                'module': 'es2020'|'esnext',
                'target': 'es2015'|'es2020',
                'script': 'jsx'|'tsx'|'js',
                'renderTypeDeclarations': True|False,
                'inlineSourceMap': True|False,
                'apiConfiguration': {
                    'graphQLConfig': {
                        'typesFilePath': 'string',
                        'queriesFilePath': 'string',
                        'mutationsFilePath': 'string',
                        'subscriptionsFilePath': 'string',
                        'fragmentsFilePath': 'string'
                    },
                    'dataStoreConfig': {},
                    'noApiConfig': {}
                },
                'dependencies': {
                    'string': 'string'
                }
            }
        },
        'genericDataSchema': {
            'dataSourceType': 'DataStore',
            'models': {
                'string': {
                    'fields': {
                        'string': {
                            'dataType': 'ID'|'String'|'Int'|'Float'|'AWSDate'|'AWSTime'|'AWSDateTime'|'AWSTimestamp'|'AWSEmail'|'AWSURL'|'AWSIPAddress'|'Boolean'|'AWSJSON'|'AWSPhone'|'Enum'|'Model'|'NonModel',
                            'dataTypeValue': 'string',
                            'required': True|False,
                            'readOnly': True|False,
                            'isArray': True|False,
                            'relationship': {
                                'type': 'HAS_MANY'|'HAS_ONE'|'BELONGS_TO',
                                'relatedModelName': 'string',
                                'relatedModelFields': [
                                    'string',
                                ],
                                'canUnlinkAssociatedModel': True|False,
                                'relatedJoinFieldName': 'string',
                                'relatedJoinTableName': 'string',
                                'belongsToFieldOnRelatedModel': 'string',
                                'associatedFields': [
                                    'string',
                                ],
                                'isHasManyIndex': True|False
                            }
                        }
                    },
                    'isJoinTable': True|False,
                    'primaryKeys': [
                        'string',
                    ]
                }
            },
            'enums': {
                'string': {
                    'values': [
                        'string',
                    ]
                }
            },
            'nonModels': {
                'string': {
                    'fields': {
                        'string': {
                            'dataType': 'ID'|'String'|'Int'|'Float'|'AWSDate'|'AWSTime'|'AWSDateTime'|'AWSTimestamp'|'AWSEmail'|'AWSURL'|'AWSIPAddress'|'Boolean'|'AWSJSON'|'AWSPhone'|'Enum'|'Model'|'NonModel',
                            'dataTypeValue': 'string',
                            'required': True|False,
                            'readOnly': True|False,
                            'isArray': True|False,
                            'relationship': {
                                'type': 'HAS_MANY'|'HAS_ONE'|'BELONGS_TO',
                                'relatedModelName': 'string',
                                'relatedModelFields': [
                                    'string',
                                ],
                                'canUnlinkAssociatedModel': True|False,
                                'relatedJoinFieldName': 'string',
                                'relatedJoinTableName': 'string',
                                'belongsToFieldOnRelatedModel': 'string',
                                'associatedFields': [
                                    'string',
                                ],
                                'isHasManyIndex': True|False
                            }
                        }
                    }
                }
            }
        },
        'autoGenerateForms': True|False,
        'features': {
            'isRelationshipSupported': True|False,
            'isNonModelSupported': True|False
        },
        'status': 'in_progress'|'failed'|'succeeded',
        'statusMessage': 'string',
        'asset': {
            'downloadUrl': 'string'
        },
        'tags': {
            'string': 'string'
        },
        'createdAt': datetime(2015, 1, 1),
        'modifiedAt': datetime(2015, 1, 1),
        'dependencies': [
            {
                'name': 'string',
                'supportedVersion': 'string',
                'isSemVer': True|False,
                'reason': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • entity (dict) –

      The code generation job for a UI component that is associated with an Amplify app.

      • id (string) –

        The unique ID for the code generation job.

      • appId (string) –

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

      • environmentName (string) –

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

      • renderConfig (dict) –

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

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: react. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • react (dict) –

          The name of the ReactStartCodegenJobData object.

          • module (string) –

            The JavaScript module type.

          • target (string) –

            The ECMAScript specification to use.

          • script (string) –

            The file type to use for a JavaScript project.

          • renderTypeDeclarations (boolean) –

            Specifies whether the code generation job should render type declaration files.

          • inlineSourceMap (boolean) –

            Specifies whether the code generation job should render inline source maps.

          • apiConfiguration (dict) –

            The API configuration for the code generation job.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: graphQLConfig, dataStoreConfig, noApiConfig. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            
            • graphQLConfig (dict) –

              The configuration for an application using GraphQL APIs.

              • typesFilePath (string) –

                The path to the GraphQL types file, relative to the component output directory.

              • queriesFilePath (string) –

                The path to the GraphQL queries file, relative to the component output directory.

              • mutationsFilePath (string) –

                The path to the GraphQL mutations file, relative to the component output directory.

              • subscriptionsFilePath (string) –

                The path to the GraphQL subscriptions file, relative to the component output directory.

              • fragmentsFilePath (string) –

                The path to the GraphQL fragments file, relative to the component output directory.

            • dataStoreConfig (dict) –

              The configuration for an application using DataStore APIs.

            • noApiConfig (dict) –

              The configuration for an application with no API being used.

          • dependencies (dict) –

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

            • (string) –

              • (string) –

      • genericDataSchema (dict) –

        Describes the data schema for a code generation job.

        • dataSourceType (string) –

          The type of the data source for the schema. Currently, the only valid value is an Amplify DataStore.

        • models (dict) –

          The name of a CodegenGenericDataModel.

          • (string) –

            • (dict) –

              Describes a model in a generic data schema.

              • fields (dict) –

                The fields in the generic data model.

                • (string) –

                  • (dict) –

                    Describes a field in a generic data schema.

                    • dataType (string) –

                      The data type for the generic data field.

                    • dataTypeValue (string) –

                      The value of the data type for the generic data field.

                    • required (boolean) –

                      Specifies whether the generic data field is required.

                    • readOnly (boolean) –

                      Specifies whether the generic data field is read-only.

                    • isArray (boolean) –

                      Specifies whether the generic data field is an array.

                    • relationship (dict) –

                      The relationship of the generic data schema.

                      • type (string) –

                        The data relationship type.

                      • relatedModelName (string) –

                        The name of the related model in the data relationship.

                      • relatedModelFields (list) –

                        The related model fields in the data relationship.

                        • (string) –

                      • canUnlinkAssociatedModel (boolean) –

                        Specifies whether the relationship can unlink the associated model.

                      • relatedJoinFieldName (string) –

                        The name of the related join field in the data relationship.

                      • relatedJoinTableName (string) –

                        The name of the related join table in the data relationship.

                      • belongsToFieldOnRelatedModel (string) –

                        The value of the belongsTo field on the related data model.

                      • associatedFields (list) –

                        The associated fields of the data relationship.

                        • (string) –

                      • isHasManyIndex (boolean) –

                        Specifies whether the @index directive is supported for a hasMany data relationship.

              • isJoinTable (boolean) –

                Specifies whether the generic data model is a join table.

              • primaryKeys (list) –

                The primary keys of the generic data model.

                • (string) –

        • enums (dict) –

          The name of a CodegenGenericDataEnum.

          • (string) –

            • (dict) –

              Describes the enums in a generic data schema.

              • values (list) –

                The list of enum values in the generic data schema.

                • (string) –

        • nonModels (dict) –

          The name of a CodegenGenericDataNonModel.

          • (string) –

            • (dict) –

              Describes a non-model in a generic data schema.

              • fields (dict) –

                The fields in a generic data schema non model.

                • (string) –

                  • (dict) –

                    Describes a field in a generic data schema.

                    • dataType (string) –

                      The data type for the generic data field.

                    • dataTypeValue (string) –

                      The value of the data type for the generic data field.

                    • required (boolean) –

                      Specifies whether the generic data field is required.

                    • readOnly (boolean) –

                      Specifies whether the generic data field is read-only.

                    • isArray (boolean) –

                      Specifies whether the generic data field is an array.

                    • relationship (dict) –

                      The relationship of the generic data schema.

                      • type (string) –

                        The data relationship type.

                      • relatedModelName (string) –

                        The name of the related model in the data relationship.

                      • relatedModelFields (list) –

                        The related model fields in the data relationship.

                        • (string) –

                      • canUnlinkAssociatedModel (boolean) –

                        Specifies whether the relationship can unlink the associated model.

                      • relatedJoinFieldName (string) –

                        The name of the related join field in the data relationship.

                      • relatedJoinTableName (string) –

                        The name of the related join table in the data relationship.

                      • belongsToFieldOnRelatedModel (string) –

                        The value of the belongsTo field on the related data model.

                      • associatedFields (list) –

                        The associated fields of the data relationship.

                        • (string) –

                      • isHasManyIndex (boolean) –

                        Specifies whether the @index directive is supported for a hasMany data relationship.

      • autoGenerateForms (boolean) –

        Specifies whether to autogenerate forms in the code generation job.

      • features (dict) –

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

        • isRelationshipSupported (boolean) –

          Specifes whether a code generation job supports data relationships.

        • isNonModelSupported (boolean) –

          Specifies whether a code generation job supports non models.

      • status (string) –

        The status of the code generation job.

      • statusMessage (string) –

        The customized status message for the code generation job.

      • asset (dict) –

        The CodegenJobAsset to use for the code generation job.

        • downloadUrl (string) –

          The URL to use to access the asset.

      • tags (dict) –

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

        • (string) –

          • (string) –

      • createdAt (datetime) –

        The time that the code generation job was created.

      • modifiedAt (datetime) –

        The time that the code generation job was modified.

      • dependencies (list) –

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

        • (dict) –

          Dependency package that may be required for the project code to run.

          • name (string) –

            Name of the dependency package.

          • supportedVersion (string) –

            Indicates the version of the supported dependency package.

          • isSemVer (boolean) –

            Determines if the dependency package is using Semantic versioning. If set to true, it indicates that the dependency package uses Semantic versioning.

          • reason (string) –

            Indicates the reason to include the dependency package in your project code.

Exceptions

  • AmplifyUIBuilder.Client.exceptions.InternalServerException

  • AmplifyUIBuilder.Client.exceptions.InvalidParameterException

  • AmplifyUIBuilder.Client.exceptions.ThrottlingException