set -e
pip3 install -r $LOCATION/requirements.txt

python3 \
    -m sgqlc.introspection \
    --exclude-deprecated \
    --exclude-description \
    -H "Authorization: Bearer $TOKEN" \
    https://$CLUSTER.cognitedata.com/api/v1/projects/$PROJECT/schema/api/$DM_NAME/$DM_VERSION/graphql \
    $LOCATION/schema.json
python3 \
    -m sgqlc.codegen schema $LOCATION/schema.json $LOCATION/schema.py

echo "WE ARE GOOOOOOOOOD"
