Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto PR for https://github.com/microsoft/typespec/pull/5641 #3016

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "~0.6.5",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDQ4NDg3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.6.5.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand All @@ -47,4 +47,4 @@
"requirements.txt",
"generator/"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
"""This is a fake class to support current implementation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -401,7 +401,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -413,7 +413,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
"""This is a fake class to support current implementation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ def _infer_class_models(cls):
return client_models

@classmethod
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> Self:
"""Parse a str using the RestAPI syntax and return a model.

:param str data: A str using RestAPI structure. JSON by default.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
Expand All @@ -402,7 +402,7 @@ def from_dict(
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> ModelType:
) -> Self:
"""Parse a dict using given key extractor return a model.

By default consider key
Expand All @@ -414,7 +414,7 @@ def from_dict(
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:rtype: ModelType
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
Expand Down
Loading
Loading