Skip to content

Generate Consumption Files

POST
/api/v1/codegen/consumption/files
curl --request POST \
--url https://example.com/api/v1/codegen/consumption/files \
--header 'Content-Type: application/json' \
--data '{ "flow_name": "example", "resource_id": "example", "type": "consumption", "entity_type": "fact", "source_tables": [ "example" ], "target_name": "example", "trigger_type": "batch", "schedule": { "cron": "example", "timezone": "UTC" }, "etl_sql": "example", "unmatched_sql": "example", "recheck_sql": "example", "sequence_by": "_commit_timestamp", "scd_type": 1, "business_date_column": "example", "emit_surrogate_key": true, "target_schema": { "description": "example", "columns": [ { "name": "example", "type": "example", "description": "", "pk": false, "not_null": false, "pii": false, "glossary_terms": [ "example" ] } ], "foreign_keys": [ { "column": "example", "parent_table": "example", "parent_column": "example" } ] }, "cluster_by": [ "example" ], "cluster_by_auto": true, "table_properties": { "additionalProperty": "example" } }'

Generate Consumption layer artifacts and return as multipart/form-data.

Returns all files as separate parts in a single multipart response. Perfect for demos - browser receives all files at once.

X-Environment-Id
Any of:
string
Media typeapplication/json
ConsumptionFlowInput

Input model for Consumption layer code generation.

object
flow_name
required
Flow Name
string
resource_id
Any of:
string
type
Type
string
default: consumption
Allowed value: consumption
entity_type
required
Entity Type
string
Allowed values: fact dim
source_tables
required
Source Tables
Array<string>
target_name
required
Target Name
string
trigger_type
required
Trigger Type
string
Allowed values: batch live on_table_update none
schedule
Any of:
ScheduleConfig

Schedule configuration for jobs.

object
cron
required
Cron
string
timezone
Timezone
string
default: UTC
etl_sql
required
Etl Sql
string
unmatched_sql
Any of:
string
recheck_sql
Any of:
string
sequence_by
Any of:
string
scd_type
Scd Type
integer
default: 1
Allowed values: 1 2
business_date_column
Any of:
string
emit_surrogate_key
Any of:
boolean
target_schema
required
TableSchema

Table schema definition.

object
description
required
Description
string
columns
required
Columns
Array<object>
ColumnSchema

Column definition for table schemas.

object
name
required
Name
string
type
required
Type
string
description
Any of:
string
pk
Pk
boolean
not_null
Not Null
boolean
pii
Pii
boolean
glossary_terms
Glossary Terms
Array<string>
foreign_keys
Foreign Keys
Array<object>
ForeignKey

Foreign key definition.

object
column
required
Column
string
parent_table
required
Parent Table
string
parent_column
required
Parent Column
string
cluster_by
Any of:
Array<string>
cluster_by_auto
Any of:
boolean
table_properties
Any of:
object
key
additional properties
string

Multiple files as multipart response

Examplegenerated
example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}