feat(python): add environment_class_name config option #10712
+31
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
environment_class_nameconfiguration option to the Python SDK generator, allowing users to customize the name of the generated environment class/enum.Link to Devin run: https://app.devin.ai/sessions/90c5ae81ff4f4096a1666828e339ac2e
Requested by: [email protected] (@aditya-arolkar-swe)
Changes Made
Python Generator (v4.39.0)
environment_class_nameoptional config field toSDKCustomConfigEnvironmentsEnumDeclarationReferencerto accept and use custom environment class nameSdkGeneratorContextImplto compute default as{ClientName}Environmentand allow override via configenvironment_class_nameis not specified, continues to use{ClientName}Environment(e.g.,AcmeEnvironment)generators/python/sdk/versions.ymlJava Generator
environment-class-nameconfig option). These may need to be removed based on requirements.Usage Example
Testing
Review Checklist
Critical items to verify:
{ClientName}Environment) is preserved when config is not specifiedImplementation details:
SdkGeneratorContextImplasf"{exported_client_class_name}Environment"custom_config.environment_class_name or default_env_class_nameEnvironmentsEnumDeclarationReferencernow receives the final computed name directly