forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mulitapi combiner] combine models in multiapi sdk (Azure#28718)
- Loading branch information
1 parent
9c908dd
commit 10a4783
Showing
6 changed files
with
166 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tools/azure-sdk-tools/packaging_tools/templates/multiapi_combiner/enums.py.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{ imports }} | ||
|
||
{% for enum in code_model.enums %} | ||
{{ enum.source_code }} | ||
{% endfor %} |
5 changes: 5 additions & 0 deletions
5
tools/azure-sdk-tools/packaging_tools/templates/multiapi_combiner/models.py.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{ imports }} | ||
|
||
{% for model in code_model.models.values() %} | ||
{{ model.source_code }} | ||
{% endfor %} |
37 changes: 37 additions & 0 deletions
37
tools/azure-sdk-tools/packaging_tools/templates/multiapi_combiner/models_init.py.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
{% if code_model.models %} | ||
from ._models import ( | ||
{% for model in code_model.models.keys() %} | ||
{{ model }}, | ||
{% endfor %} | ||
) | ||
{% endif %} | ||
|
||
{% if code_model.enums %} | ||
from ._enums import ( | ||
{% for enum in code_model.enums %} | ||
{{ enum.name }}, | ||
{% endfor %} | ||
) | ||
{% endif %} | ||
|
||
from ._patch import __all__ as _patch_all | ||
from ._patch import * # pylint: disable=unused-wildcard-import | ||
from ._patch import patch_sdk as _patch_sdk | ||
|
||
__all__ = [ | ||
{% for model in code_model.models.keys() %} | ||
"{{ model }}", | ||
{% endfor %} | ||
{% for enum in code_model.enums %} | ||
"{{ enum.name }}", | ||
{% endfor %} | ||
] | ||
__all__.extend([p for p in _patch_all if p not in __all__]) | ||
_patch_sdk() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters