@autorest/python 5.12.2 → 5.12.3

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.
package/ChangeLog.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ### 2022-01-13 - 5.12.3
4
+
5
+ | Library | Min Version
6
+ | --------------- | -------
7
+ |`@autorest/core` | `3.6.2`
8
+ |`@autorest/modelerfour` | `4.19.1`
9
+ |`azure-core` dep of generated code | `1.20.1`
10
+ |`msrest` dep of generated code | `0.6.21`
11
+ |`azure-mgmt-core` dep of generated code (If generating mgmt plane code) | `1.3.0`
12
+
13
+ **Bug Fixes**
14
+
15
+ - Unify multiapi constant behavior with single API version #1119
16
+ - Clean up docstrings by removing descriptions for client constants on methods and request builders #1119
17
+
3
18
  ### 2022-01-11 - 5.12.2
4
19
 
5
20
  | Library | Min Version
@@ -177,8 +177,6 @@ class Parameter(BaseModel): # pylint: disable=too-many-instance-attributes, too
177
177
  return not(
178
178
  # don't put accept in signature
179
179
  self.rest_api_name == "Accept"
180
- # if i'm multiapi, don't add constants
181
- or (self.code_model.options["multiapi"] and self.constant)
182
180
  # If i'm not in the method code, no point in being in signature
183
181
  or not self.in_method_code
184
182
  # If I'm grouped, my grouper will be on signature, not me
@@ -302,8 +300,6 @@ class Parameter(BaseModel): # pylint: disable=too-many-instance-attributes, too
302
300
  @property
303
301
  def is_kwarg(self) -> bool:
304
302
  # this means "am I in **kwargs?"
305
- if self.code_model.options["multiapi"]:
306
- return self.rest_api_name == "Content-Type"
307
303
  return self.rest_api_name == "Content-Type" or (self.constant and self.rest_api_name != "Accept")
308
304
 
309
305
  @property
@@ -313,7 +309,9 @@ class Parameter(BaseModel): # pylint: disable=too-many-instance-attributes, too
313
309
 
314
310
  @property
315
311
  def is_hidden(self) -> bool:
316
- return self.serialized_name in _HIDDEN_KWARGS
312
+ return self.serialized_name in _HIDDEN_KWARGS or (
313
+ self.yaml_data["implementation"] == "Client" and self.constant
314
+ )
317
315
 
318
316
  @property
319
317
  def is_positional(self) -> bool:
@@ -18,8 +18,6 @@ class RequestBuilderParameter(ParameterOnlyPathAndBodyPositional):
18
18
  return not(
19
19
  # don't put accept in method signature
20
20
  self.rest_api_name == "Accept"
21
- # if i'm multiapi, don't add constants
22
- or (self.code_model.options["multiapi"] and self.constant)
23
21
  # If i'm not in the method code, no point in being in signature
24
22
  or not self.in_method_code
25
23
  # If I'm a flattened property of a body, don't want me, want the body param
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "global_parameters": {
20
20
  "sync": {
21
- {% for gp in sync_global_parameters.config_method %}
21
+ {% for gp in sync_global_parameters.config_method | rejectattr("serialized_name", "equalto", "api_version") %}
22
22
  {{ gp.serialized_name | tojson }}: {
23
23
  "signature": {{ gp.method_signature(is_python3_file=False) | tojson }},
24
24
  "description": {{ gp.description | tojson }},
@@ -28,7 +28,7 @@
28
28
  {% endfor %}
29
29
  },
30
30
  "async": {
31
- {% for gp in async_global_parameters.config_method %}
31
+ {% for gp in async_global_parameters.config_method | rejectattr("serialized_name", "equalto", "api_version") %}
32
32
  {{ gp.serialized_name | tojson }}: {
33
33
  "signature": {{ (gp.method_signature(is_python3_file=True)) | tojson }},
34
34
  "description": {{ gp.description | tojson }},
@@ -42,7 +42,7 @@
42
42
  {{ gp.serialized_name | tojson }}: {{ gp.constant_declaration | tojson }}{{ "," if not loop.last else "" }}
43
43
  {% endfor %}
44
44
  },
45
- "call": {{ code_model.global_parameters.config_method | map(attribute="serialized_name") | join(', ') | tojson }},
45
+ "call": {{ code_model.global_parameters.config_method | rejectattr("serialized_name", "equalto", "api_version") | map(attribute="serialized_name") | join(', ') | tojson }},
46
46
  "service_client_specific": {
47
47
  "sync": {
48
48
  "api_version": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "5.12.2",
3
+ "version": "5.12.3",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "scripts": {
6
6
  "prepare": "node run-python3.js prepare.py",