@autorest/python 6.5.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,19 +73,29 @@ class ARMChallengeAuthenticationPolicyType(BearerTokenCredentialPolicyType):
73
73
 
74
74
  class AzureKeyCredentialPolicyType(_CredentialPolicyBaseType):
75
75
  def __init__(
76
- self, yaml_data: Dict[str, Any], code_model: "CodeModel", key: str
76
+ self,
77
+ yaml_data: Dict[str, Any],
78
+ code_model: "CodeModel",
79
+ key: str,
80
+ scheme: Optional[str] = None,
77
81
  ) -> None:
78
82
  super().__init__(yaml_data, code_model)
79
83
  self.key = key
84
+ self.scheme = scheme
80
85
 
81
86
  def call(self, async_mode: bool) -> str:
82
- return f'policies.AzureKeyCredentialPolicy(self.credential, "{self.key}", **kwargs)'
87
+ params = f'"{self.key}", '
88
+ if self.scheme:
89
+ params += f'prefix="{self.scheme}", '
90
+ return f"policies.AzureKeyCredentialPolicy(self.credential, {params}**kwargs)"
83
91
 
84
92
  @classmethod
85
93
  def from_yaml(
86
94
  cls, yaml_data: Dict[str, Any], code_model: "CodeModel"
87
95
  ) -> "AzureKeyCredentialPolicyType":
88
- return cls(yaml_data, code_model, yaml_data["key"])
96
+ return cls(
97
+ yaml_data, code_model, yaml_data["key"], yaml_data.get("scheme", None)
98
+ )
89
99
 
90
100
 
91
101
  CredentialPolicyType = TypeVar(
@@ -90,7 +90,7 @@ setup(
90
90
  {% if azure_arm %}
91
91
  "azure-mgmt-core<2.0.0,>=1.3.2",
92
92
  {% else %}
93
- "azure-core<2.0.0,>=1.24.0",
93
+ "azure-core<2.0.0,>=1.27.0",
94
94
  {% endif %}
95
95
  {% if code_model.need_typing_extensions %}
96
96
  "typing-extensions>=4.3.0; python_version<'3.8.0'",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "main": "index.js",
6
6
  "repository": {