* upgrade cadl-ranch version

* fix regeneration
This commit is contained in:
Chenjie Shi 2023-05-08 11:23:53 +08:00 коммит произвёл GitHub
Родитель e1e305fe68
Коммит 11b392acc9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 49 добавлений и 22 удалений

Просмотреть файл

@ -56,7 +56,7 @@
},
"devDependencies": {
"@azure-tools/cadl-ranch-expect": "~0.3.0",
"@azure-tools/cadl-ranch-specs": "~0.14.6",
"@azure-tools/cadl-ranch-specs": "~0.14.8",
"@types/js-yaml": "~4.0.5",
"@types/mocha": "~10.0.1",
"@types/node": "^18.16.3",

Просмотреть файл

@ -214,15 +214,15 @@ class InternalClientOperationsMixin(InternalClientMixinABC):
return deserialized # type: ignore
@distributed_trace_async
async def _internal_only(self, *, name: str, **kwargs: Any) -> _models.PublicModel:
async def _internal_only(self, *, name: str, **kwargs: Any) -> _models._models.InternalModel:
"""internal_only.
:keyword name: Required.
:paramtype name: str
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: PublicModel. The PublicModel is compatible with MutableMapping
:rtype: ~_specs_.azure.clientgenerator.core.internal.models.PublicModel
:return: InternalModel. The InternalModel is compatible with MutableMapping
:rtype: ~_specs_.azure.clientgenerator.core.internal.models.InternalModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
@ -236,7 +236,7 @@ class InternalClientOperationsMixin(InternalClientMixinABC):
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[_models.PublicModel] = kwargs.pop("cls", None)
cls: ClsType[_models._models.InternalModel] = kwargs.pop("cls", None) # pylint: disable=protected-access
request = build_internal_internal_only_request(
name=name,
@ -259,7 +259,9 @@ class InternalClientOperationsMixin(InternalClientMixinABC):
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.PublicModel, response.json())
deserialized = _deserialize(
_models._models.InternalModel, response.json() # pylint: disable=protected-access
)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore

Просмотреть файл

@ -13,6 +13,19 @@ from .. import _model_base
from .._model_base import rest_field
class InternalModel(_model_base.Model):
"""This is a model only used by internal operation. It should be generated but not exported.
All required parameters must be populated in order to send to Azure.
:ivar name: Required.
:vartype name: str
"""
name: str = rest_field()
"""Required."""
class PublicModel(_model_base.Model):
"""This is a model only used by public operation. It should be generated and exported.

Просмотреть файл

@ -285,15 +285,15 @@ class InternalClientOperationsMixin(InternalClientMixinABC):
return deserialized # type: ignore
@distributed_trace
def _internal_only(self, *, name: str, **kwargs: Any) -> _models.PublicModel:
def _internal_only(self, *, name: str, **kwargs: Any) -> _models._models.InternalModel:
"""internal_only.
:keyword name: Required.
:paramtype name: str
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: PublicModel. The PublicModel is compatible with MutableMapping
:rtype: ~_specs_.azure.clientgenerator.core.internal.models.PublicModel
:return: InternalModel. The InternalModel is compatible with MutableMapping
:rtype: ~_specs_.azure.clientgenerator.core.internal.models.InternalModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
@ -307,7 +307,7 @@ class InternalClientOperationsMixin(InternalClientMixinABC):
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[_models.PublicModel] = kwargs.pop("cls", None)
cls: ClsType[_models._models.InternalModel] = kwargs.pop("cls", None) # pylint: disable=protected-access
request = build_internal_internal_only_request(
name=name,
@ -330,7 +330,9 @@ class InternalClientOperationsMixin(InternalClientMixinABC):
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.PublicModel, response.json())
deserialized = _deserialize(
_models._models.InternalModel, response.json() # pylint: disable=protected-access
)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore

Просмотреть файл

@ -20,8 +20,8 @@ async def test_get(client: TraitsClient):
result, header = await client.smoke_test(
id=1,
foo="123",
if_match="valid",
if_none_match="invalid",
if_match="\"valid\"",
if_none_match="\"invalid\"",
if_unmodified_since=datetime(
year=2022, month=8, day=26, hour=14, minute=38, second=0
),

Просмотреть файл

@ -19,8 +19,8 @@ def test_get(client: TraitsClient):
result, header = client.smoke_test(
id=1,
foo="123",
if_match="valid",
if_none_match="invalid",
if_match="\"valid\"",
if_none_match="\"invalid\"",
if_unmodified_since=datetime(
year=2022, month=8, day=26, hour=14, minute=38, second=0
),

Просмотреть файл

@ -70,8 +70,8 @@ importers:
specifier: ~0.3.0
version: 0.3.0(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)(@typespec/versioning@0.43.0)
'@azure-tools/cadl-ranch-specs':
specifier: ~0.14.6
version: 0.14.6(@azure-tools/cadl-ranch-expect@0.3.0)(@azure-tools/typespec-azure-core@0.29.0)(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)(@typespec/versioning@0.43.0)
specifier: ~0.14.8
version: 0.14.8(@azure-tools/cadl-ranch-expect@0.3.0)(@azure-tools/typespec-azure-core@0.29.0)(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)(@typespec/versioning@0.43.0)
'@types/js-yaml':
specifier: ~4.0.5
version: 4.0.5
@ -165,8 +165,8 @@ packages:
'@typespec/versioning': 0.43.0
dev: true
/@azure-tools/cadl-ranch-specs@0.14.6(@azure-tools/cadl-ranch-expect@0.3.0)(@azure-tools/typespec-azure-core@0.29.0)(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)(@typespec/versioning@0.43.0):
resolution: {integrity: sha512-MYih6mF80tUB2YSBzeGcoo05ihNZpEql/r/oX2eDVdZoyMo1898EgsXq8Bf5ZFCtVkrIwI7XVoyluIXvrliO+A==}
/@azure-tools/cadl-ranch-specs@0.14.8(@azure-tools/cadl-ranch-expect@0.3.0)(@azure-tools/typespec-azure-core@0.29.0)(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)(@typespec/versioning@0.43.0):
resolution: {integrity: sha512-u09ZQ7G30d++Ted4FsRI6WqhzyzeQVXGTQZZvvlXXv981hD77eMY1pGRxseE7tvFLCDFnZycEbXGIkhM0VlT1g==}
engines: {node: '>=16.0.0'}
peerDependencies:
'@azure-tools/cadl-ranch-expect': ~0.3.0
@ -176,7 +176,7 @@ packages:
'@typespec/rest': ~0.43.0
'@typespec/versioning': ~0.43.0
dependencies:
'@azure-tools/cadl-ranch': 0.4.9(@typespec/versioning@0.43.0)
'@azure-tools/cadl-ranch': 0.4.11(@typespec/versioning@0.43.0)
'@azure-tools/cadl-ranch-api': 0.2.5
'@azure-tools/cadl-ranch-expect': 0.3.0(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)(@typespec/versioning@0.43.0)
'@azure-tools/typespec-azure-core': 0.29.0(@typespec/compiler@0.43.0)(@typespec/http@0.43.1)(@typespec/rest@0.43.0)
@ -190,8 +190,8 @@ packages:
- supports-color
dev: true
/@azure-tools/cadl-ranch@0.4.9(@typespec/versioning@0.43.0):
resolution: {integrity: sha512-TcVJcWOnmkq72IzYRZxQ0lkahG4Qo1w8165dJPRbZAZU8yaMC5v4lqjU1nAZn8HMJSNHizKi61vAkXK7LQPJ2Q==}
/@azure-tools/cadl-ranch@0.4.11(@typespec/versioning@0.43.0):
resolution: {integrity: sha512-Wbw9MsfeqZLifB8eeADkDvW9lD5SxvcPQXiC6c6N8HH4POTi93bmTPiyx995EVB0Q3Py0tNDMq0KBmRdsOHjyQ==}
engines: {node: '>=16.0.0'}
hasBin: true
dependencies:
@ -209,6 +209,7 @@ packages:
express: 4.18.2
express-promise-router: 4.1.1(express@4.18.2)
glob: 10.2.2
jackspeak: 2.1.1
js-yaml: 4.1.0
morgan: 1.10.0
node-fetch: 3.3.1
@ -3077,6 +3078,15 @@ packages:
'@pkgjs/parseargs': 0.11.0
dev: true
/jackspeak@2.1.1:
resolution: {integrity: sha512-juf9stUEwUaILepraGOWIJTLwg48bUnBmRqd2ln2Os1sW987zeoj/hzhbvRB95oMuS2ZTpjULmdwHNX4rzZIZw==}
engines: {node: '>=14'}
dependencies:
cliui: 8.0.1
optionalDependencies:
'@pkgjs/parseargs': 0.11.0
dev: true
/js-sdsl@4.1.4:
resolution: {integrity: sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==}
dev: true