Update the API generation code and code generation sample