@autorest/python 6.8.0 → 6.8.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.
|
@@ -43,7 +43,9 @@ class CombinedType(BaseType):
|
|
|
43
43
|
If list: '[str]'
|
|
44
44
|
If dict: '{str}'
|
|
45
45
|
"""
|
|
46
|
-
|
|
46
|
+
if not all(t for t in self.types if t.type == "constant"):
|
|
47
|
+
raise ValueError("Shouldn't get serialization type of a combinedtype")
|
|
48
|
+
return self.types[0].serialization_type
|
|
47
49
|
|
|
48
50
|
@property
|
|
49
51
|
def client_default_value(self) -> Any:
|
|
@@ -15,6 +15,7 @@ from .request_builder import (
|
|
|
15
15
|
from .imports import ImportType, FileImport, TypingSection
|
|
16
16
|
from .parameter_list import ParameterList
|
|
17
17
|
from .model_type import ModelType
|
|
18
|
+
from .list_type import ListType
|
|
18
19
|
|
|
19
20
|
if TYPE_CHECKING:
|
|
20
21
|
from .code_model import CodeModel
|
|
@@ -63,11 +64,17 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
63
64
|
self.pager_async: str = yaml_data["pagerAsync"]
|
|
64
65
|
|
|
65
66
|
def _get_attr_name(self, wire_name: str) -> str:
|
|
66
|
-
|
|
67
|
+
response_type = self.responses[0].type
|
|
68
|
+
if not response_type:
|
|
69
|
+
raise ValueError(
|
|
70
|
+
f"Can't find a matching property in response for {wire_name}"
|
|
71
|
+
)
|
|
72
|
+
if response_type.type == "list":
|
|
73
|
+
response_type = cast(ListType, response_type).element_type
|
|
67
74
|
try:
|
|
68
75
|
return next(
|
|
69
76
|
p.client_name
|
|
70
|
-
for p in cast(ModelType,
|
|
77
|
+
for p in cast(ModelType, response_type).properties
|
|
71
78
|
if p.wire_name == wire_name
|
|
72
79
|
)
|
|
73
80
|
except StopIteration as exc:
|