@autorest/python 6.4.14 → 6.4.15
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.
|
@@ -36,6 +36,7 @@ from .parameter import (
|
|
|
36
36
|
)
|
|
37
37
|
from .parameter_list import ParameterList
|
|
38
38
|
from .model_type import ModelType
|
|
39
|
+
from .base import BaseType
|
|
39
40
|
from .request_builder import OverloadedRequestBuilder, RequestBuilder
|
|
40
41
|
|
|
41
42
|
if TYPE_CHECKING:
|
|
@@ -49,6 +50,10 @@ ResponseType = TypeVar(
|
|
|
49
50
|
)
|
|
50
51
|
|
|
51
52
|
|
|
53
|
+
def is_internal(target: Optional[BaseType]) -> bool:
|
|
54
|
+
return isinstance(target, ModelType) and target.base == "dpg" and target.internal
|
|
55
|
+
|
|
56
|
+
|
|
52
57
|
class OperationBase( # pylint: disable=too-many-public-methods
|
|
53
58
|
Generic[ResponseType], BaseBuilder[ParameterList]
|
|
54
59
|
):
|
|
@@ -130,6 +135,13 @@ class OperationBase( # pylint: disable=too-many-public-methods
|
|
|
130
135
|
if self.response_type_annotation(async_mode=False) == "None":
|
|
131
136
|
# doesn't matter if it's async or not
|
|
132
137
|
retval = add_to_pylint_disable(retval, "inconsistent-return-statements")
|
|
138
|
+
try:
|
|
139
|
+
if any(is_internal(r.type) for r in self.responses) or is_internal(
|
|
140
|
+
self.parameters.body_parameter.type
|
|
141
|
+
):
|
|
142
|
+
retval = add_to_pylint_disable(retval, "protected-access")
|
|
143
|
+
except ValueError:
|
|
144
|
+
pass
|
|
133
145
|
return retval
|
|
134
146
|
|
|
135
147
|
def cls_type_annotation(self, *, async_mode: bool) -> str:
|
|
@@ -40,7 +40,11 @@ class RequestBuilderBodyParameter(BodyParameter):
|
|
|
40
40
|
|
|
41
41
|
@property
|
|
42
42
|
def in_method_signature(self) -> bool:
|
|
43
|
-
return
|
|
43
|
+
return (
|
|
44
|
+
super().in_method_signature
|
|
45
|
+
and not self.is_partial_body
|
|
46
|
+
and self.code_model.options["models_mode"] != "dpg"
|
|
47
|
+
)
|
|
44
48
|
|
|
45
49
|
@property
|
|
46
50
|
def method_location(self) -> ParameterMethodLocation:
|