Skip to content

update imports to import from corehttp when generating with --unbranding=true #2175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iscai-msft opened this issue Oct 13, 2023 · 0 comments · Fixed by #2209
Closed

update imports to import from corehttp when generating with --unbranding=true #2175

iscai-msft opened this issue Oct 13, 2023 · 0 comments · Fixed by #2209
Assignees
Labels
unbranding Effort to also generate non-Azure SDKs

Comments

@iscai-msft
Copy link
Contributor

iscai-msft commented Oct 13, 2023

We want to update all of the imports for an unbranded SDK to import from corehttp instead of from azure.core. The cleanest way to do this will be just updating the import type in autorest.codegen.models.imports.py. Here, if we are unbranded, and we see an import for azure.core, we just change it to an import from corehttp. The names (besides AzureKeyCredential) are all the same, so this should automatically work once we update the imports serializer

I believe the only caveat to this is we have changed the name of AzureKeyCredential to ServiceKeyCredential in gencore. Therefore, we should update our autorest.codegen.models.AzureKeyCredentialType and autorest.codegen.models.AzureKeyCredentialPolicyType to be called autorest.codegen.models.KeyCredentialType and autorest.codegen.models.KeyCredentialPolicyType, and have a property self.name on it, which will be ServiceKeyCredential if --unbranding==true, otherwise, ServiceKeyCredential.

@iscai-msft iscai-msft added the unbranding Effort to also generate non-Azure SDKs label Oct 13, 2023
@msyyc msyyc self-assigned this Oct 16, 2023
@iscai-msft iscai-msft changed the title update imports to import from gencore when generating with --unbranding=true update imports to import from corehttp when generating with --unbranding=true Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unbranding Effort to also generate non-Azure SDKs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants