* bump cadl-ranch 0.37.1

* for multipart HttpPart<{..}> case

* regenerate

* fix multipart case

* format

* changelog

* fix ci

* regenerate

* udpate testcase name
This commit is contained in:
Yuchao Yan 2024-09-09 12:45:26 +08:00 коммит произвёл GitHub
Родитель 1388db949e
Коммит 9cac616e35
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
506 изменённых файлов: 25633 добавлений и 1756 удалений

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

@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@azure-tools/typespec-python"
---
Add support for `HttpPart<{@body body: XXX}>` of multipart

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

@ -31,7 +31,7 @@
"homepage": "https://github.com/Azure/autorest.python#readme",
"devDependencies": {
"@actions/github": "6.0.0",
"@azure-tools/cadl-ranch": "~0.14.2",
"@azure-tools/cadl-ranch": "~0.14.5",
"@chronus/chronus": "^0.10.2",
"@chronus/github": "^0.3.2",
"@typespec/prettier-plugin-typespec": "~0.58.0",

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

@ -232,7 +232,11 @@ class BodyParameter(_ParameterBase):
def is_form_data(self) -> bool:
# hacky, but rn in legacy, there is no formdata model type, it's just a dict
# with all of the entries splatted out
return self.type.is_form_data or bool(self.entries)
return (
self.type.is_form_data
or bool(self.entries)
or ("multipart/form-data" in self.content_types and self.code_model.options["from_typespec"])
)
@property
def is_partial_body(self) -> bool:

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

@ -80,6 +80,12 @@ class TestCase:
self.operation = operation
self.is_async = is_async
@property
def name(self) -> str:
if self.operation_groups[-1].is_mixin:
return self.operation.name
return "_".join([og.property_name for og in self.operation_groups] + [self.operation.name])
@property
def operation_group_prefix(self) -> str:
if self.operation_groups[-1].is_mixin:

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

@ -29,9 +29,9 @@ class {{ test.test_class_name }}({{ test.base_test_class_name }}):
{% endif %}
@recorded_by_proxy{{ async_suffix }}
{% if code_model.options["azure_arm"] %}
{{ async }}def test_{{ testcase.operation.name }}(self, resource_group):
{{ async }}def test_{{ testcase.name }}(self, resource_group):
{% else %}
{{ async }}def test_{{ testcase.operation.name }}(self, {{ prefix_lower }}_endpoint):
{{ async }}def test_{{ testcase.name }}(self, {{ prefix_lower }}_endpoint):
{{ client_var }} = self.{{ test.create_client_name }}(endpoint={{ prefix_lower }}_endpoint)
{% endif %}
{{testcase.response }}{{ client_var }}{{ testcase.operation_group_prefix }}.{{ testcase.operation.name }}(

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

@ -65,8 +65,8 @@
"devDependencies": {
"@azure-tools/typespec-azure-resource-manager": "~0.45.0",
"@azure-tools/typespec-autorest": "~0.45.0",
"@azure-tools/cadl-ranch-expect": "~0.15.1",
"@azure-tools/cadl-ranch-specs": "~0.36.1",
"@azure-tools/cadl-ranch-expect": "~0.15.3",
"@azure-tools/cadl-ranch-specs": "~0.37.1",
"@types/js-yaml": "~4.0.5",
"@types/node": "^18.16.3",
"@types/yargs": "17.0.32",

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

@ -50,9 +50,6 @@ const EMITTER_OPTIONS: Record<string, Record<string, string> | Record<string, st
"type/model/empty": {
"package-name": "typetest-model-empty",
},
"type/model/flatten": {
"package-name": "typetest-model-flatten",
},
"type/model/inheritance/enum-discriminator": {
"package-name": "typetest-model-enumdiscriminator",
},

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

@ -216,7 +216,16 @@ function emitProperty<TServiceOperation extends SdkServiceOperation>(
property: SdkBodyModelPropertyType,
): Record<string, any> {
const isMultipartFileInput = property.multipartOptions?.isFilePart;
const sourceType = isMultipartFileInput ? createMultiPartFileType(property.type) : property.type;
let sourceType: SdkType | MultiPartFileType = property.type;
if (isMultipartFileInput) {
sourceType = createMultiPartFileType(property.type);
} else if (property.type.kind === "model") {
const body = property.type.properties.find((x) => x.kind === "body");
if (body) {
// for `temperature: HttpPart<{@body body: float64, @header contentType: "text/plain"}>`, the real type is float64
sourceType = body.type;
}
}
if (isMultipartFileInput) {
// Python convert all the type of file part to FileType so clear these models' usage so that they won't be generated
addDisableGenerationMap(property.type);

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

@ -14,7 +14,7 @@ from testpreparer import AccessClientTestBase, AccessPreparer
class TestAccessPublicOperationOperations(AccessClientTestBase):
@AccessPreparer()
@recorded_by_proxy
def test_no_decorator_in_public(self, access_endpoint):
def test_public_operation_no_decorator_in_public(self, access_endpoint):
client = self.create_client(endpoint=access_endpoint)
response = client.public_operation.no_decorator_in_public(
name="str",
@ -25,7 +25,7 @@ class TestAccessPublicOperationOperations(AccessClientTestBase):
@AccessPreparer()
@recorded_by_proxy
def test_public_decorator_in_public(self, access_endpoint):
def test_public_operation_public_decorator_in_public(self, access_endpoint):
client = self.create_client(endpoint=access_endpoint)
response = client.public_operation.public_decorator_in_public(
name="str",

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

@ -15,7 +15,7 @@ from testpreparer_async import AccessClientTestBaseAsync
class TestAccessPublicOperationOperationsAsync(AccessClientTestBaseAsync):
@AccessPreparer()
@recorded_by_proxy_async
async def test_no_decorator_in_public(self, access_endpoint):
async def test_public_operation_no_decorator_in_public(self, access_endpoint):
client = self.create_async_client(endpoint=access_endpoint)
response = await client.public_operation.no_decorator_in_public(
name="str",
@ -26,7 +26,7 @@ class TestAccessPublicOperationOperationsAsync(AccessClientTestBaseAsync):
@AccessPreparer()
@recorded_by_proxy_async
async def test_public_decorator_in_public(self, access_endpoint):
async def test_public_operation_public_decorator_in_public(self, access_endpoint):
client = self.create_async_client(endpoint=access_endpoint)
response = await client.public_operation.public_decorator_in_public(
name="str",

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

@ -14,7 +14,7 @@ from testpreparer import AccessClientTestBase, AccessPreparer
class TestAccessSharedModelInOperationOperations(AccessClientTestBase):
@AccessPreparer()
@recorded_by_proxy
def test_public(self, access_endpoint):
def test_shared_model_in_operation_public(self, access_endpoint):
client = self.create_client(endpoint=access_endpoint)
response = client.shared_model_in_operation.public(
name="str",

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

@ -15,7 +15,7 @@ from testpreparer_async import AccessClientTestBaseAsync
class TestAccessSharedModelInOperationOperationsAsync(AccessClientTestBaseAsync):
@AccessPreparer()
@recorded_by_proxy_async
async def test_public(self, access_endpoint):
async def test_shared_model_in_operation_public(self, access_endpoint):
client = self.create_async_client(endpoint=access_endpoint)
response = await client.shared_model_in_operation.public(
name="str",

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

@ -1,8 +1,9 @@
include *.md
include LICENSE
include azure/clientgenerator/core/flattenproperty/py.typed
include specs/azure/clientgenerator/core/flattenproperty/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/clientgenerator/__init__.py
include azure/clientgenerator/core/__init__.py
include specs/__init__.py
include specs/azure/__init__.py
include specs/azure/clientgenerator/__init__.py
include specs/azure/clientgenerator/core/__init__.py

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

@ -1,6 +1,6 @@
# Azure Clientgenerator Core Flattenproperty client library for Python
# Specs Azure Clientgenerator Core Flattenproperty client library for Python
<!-- write necessary description of service -->
## Getting started
@ -8,14 +8,14 @@
### Install the package
```bash
python -m pip install azure-clientgenerator-core-flattenproperty
python -m pip install specs-azure-clientgenerator-core-flattenproperty
```
#### Prequisites
- Python 3.8 or later is required to use this package.
- You need an [Azure subscription][azure_sub] to use this package.
- An existing Azure Clientgenerator Core Flattenproperty instance.
- An existing Specs Azure Clientgenerator Core Flattenproperty instance.
## Contributing

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

@ -1,11 +1,11 @@
{
"CrossLanguagePackageId": "Azure.ClientGenerator.Core.FlattenProperty",
"CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty",
"CrossLanguageDefinitionId": {
"azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.ChildFlattenModel",
"azure.clientgenerator.core.flattenproperty.models.ChildModel": "Azure.ClientGenerator.Core.FlattenProperty.ChildModel",
"azure.clientgenerator.core.flattenproperty.models.FlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.FlattenModel",
"azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.NestedFlattenModel",
"azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_flatten_model": "Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel",
"azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_nested_flatten_model": "Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel"
"specs.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.ChildFlattenModel",
"specs.azure.clientgenerator.core.flattenproperty.models.ChildModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.ChildModel",
"specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.FlattenModel",
"specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.NestedFlattenModel",
"specs.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_flatten_model": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel",
"specs.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_nested_flatten_model": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel"
}
}

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

@ -5,9 +5,9 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.clientgenerator.core.flattenproperty import FlattenPropertyClient
from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer
import functools
from specs.azure.clientgenerator.core.flattenproperty import FlattenPropertyClient
class FlattenPropertyClientTestBase(AzureRecordedTestCase):

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

@ -5,8 +5,8 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.clientgenerator.core.flattenproperty.aio import FlattenPropertyClient
from devtools_testutils import AzureRecordedTestCase
from specs.azure.clientgenerator.core.flattenproperty.aio import FlattenPropertyClient
class FlattenPropertyClientTestBaseAsync(AzureRecordedTestCase):

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

@ -12,8 +12,8 @@ import re
from setuptools import setup, find_packages
PACKAGE_NAME = "azure-clientgenerator-core-flattenproperty"
PACKAGE_PPRINT_NAME = "Azure Clientgenerator Core Flattenproperty"
PACKAGE_NAME = "specs-azure-clientgenerator-core-flattenproperty"
PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Flattenproperty"
# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace("-", "/")
@ -54,14 +54,15 @@ setup(
exclude=[
"tests",
# Exclude packages that will be covered by PEP420 or nspkg
"azure",
"azure.clientgenerator",
"azure.clientgenerator.core",
"specs",
"specs.azure",
"specs.azure.clientgenerator",
"specs.azure.clientgenerator.core",
]
),
include_package_data=True,
package_data={
"azure.clientgenerator.core.flattenproperty": ["py.typed"],
"specs.azure.clientgenerator.core.flattenproperty": ["py.typed"],
},
install_requires=[
"isodate>=0.6.1",

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

@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

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

@ -26,7 +26,7 @@ class FlattenPropertyClientConfiguration: # pylint: disable=too-many-instance-a
def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
self.endpoint = endpoint
kwargs.setdefault("sdk_moniker", "clientgenerator-core-flattenproperty/{}".format(VERSION))
kwargs.setdefault("sdk_moniker", "specs-azure-clientgenerator-core-flattenproperty/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

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

@ -88,12 +88,12 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_flatten_model.
:param input: Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -109,7 +109,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -125,7 +125,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -136,10 +136,10 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_flatten_model.
:param input: Is one of the following types: FlattenModel, JSON, IO[bytes] Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or
IO[bytes]
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -207,12 +207,12 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_nested_flatten_model.
:param input: Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -228,7 +228,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -244,7 +244,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -255,10 +255,10 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_nested_flatten_model.
:param input: Is one of the following types: NestedFlattenModel, JSON, IO[bytes] Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or JSON or
IO[bytes]
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or
JSON or IO[bytes]
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {

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

@ -26,7 +26,7 @@ class FlattenPropertyClientConfiguration: # pylint: disable=too-many-instance-a
def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None:
self.endpoint = endpoint
kwargs.setdefault("sdk_moniker", "clientgenerator-core-flattenproperty/{}".format(VERSION))
kwargs.setdefault("sdk_moniker", "specs-azure-clientgenerator-core-flattenproperty/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

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

@ -52,12 +52,12 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_flatten_model.
:param input: Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -73,7 +73,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -89,7 +89,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -100,10 +100,10 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_flatten_model.
:param input: Is one of the following types: FlattenModel, JSON, IO[bytes] Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or
IO[bytes]
:return: FlattenModel. The FlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@ -171,12 +171,12 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_nested_flatten_model.
:param input: Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -192,7 +192,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -208,7 +208,7 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
Default value is "application/json".
:paramtype content_type: str
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
@ -219,10 +219,10 @@ class FlattenPropertyClientOperationsMixin(FlattenPropertyClientMixinABC):
"""put_nested_flatten_model.
:param input: Is one of the following types: NestedFlattenModel, JSON, IO[bytes] Required.
:type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or JSON or
IO[bytes]
:type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or
JSON or IO[bytes]
:return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping
:rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {

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

@ -24,7 +24,7 @@ class ChildFlattenModel(_model_base.Model):
:ivar summary: Required.
:vartype summary: str
:ivar properties: Required.
:vartype properties: ~azure.clientgenerator.core.flattenproperty.models.ChildModel
:vartype properties: ~specs.azure.clientgenerator.core.flattenproperty.models.ChildModel
"""
summary: str = rest_field()
@ -112,7 +112,7 @@ class FlattenModel(_model_base.Model):
:ivar name: Required.
:vartype name: str
:ivar properties: Required.
:vartype properties: ~azure.clientgenerator.core.flattenproperty.models.ChildModel
:vartype properties: ~specs.azure.clientgenerator.core.flattenproperty.models.ChildModel
"""
name: str = rest_field()
@ -166,7 +166,7 @@ class NestedFlattenModel(_model_base.Model):
:ivar name: Required.
:vartype name: str
:ivar properties: Required.
:vartype properties: ~azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel
:vartype properties: ~specs.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel
"""
name: str = rest_field()

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

@ -14,7 +14,7 @@ from testpreparer import UsageClientTestBase, UsagePreparer
class TestUsageModelInOperationOperations(UsageClientTestBase):
@UsagePreparer()
@recorded_by_proxy
def test_input_to_input_output(self, usage_endpoint):
def test_model_in_operation_input_to_input_output(self, usage_endpoint):
client = self.create_client(endpoint=usage_endpoint)
response = client.model_in_operation.input_to_input_output(
body={"name": "str"},
@ -25,7 +25,7 @@ class TestUsageModelInOperationOperations(UsageClientTestBase):
@UsagePreparer()
@recorded_by_proxy
def test_output_to_input_output(self, usage_endpoint):
def test_model_in_operation_output_to_input_output(self, usage_endpoint):
client = self.create_client(endpoint=usage_endpoint)
response = client.model_in_operation.output_to_input_output()
@ -34,7 +34,7 @@ class TestUsageModelInOperationOperations(UsageClientTestBase):
@UsagePreparer()
@recorded_by_proxy
def test_model_in_read_only_property(self, usage_endpoint):
def test_model_in_operation_model_in_read_only_property(self, usage_endpoint):
client = self.create_client(endpoint=usage_endpoint)
response = client.model_in_operation.model_in_read_only_property(
body={"result": {"name": "str"}},

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

@ -15,7 +15,7 @@ from testpreparer_async import UsageClientTestBaseAsync
class TestUsageModelInOperationOperationsAsync(UsageClientTestBaseAsync):
@UsagePreparer()
@recorded_by_proxy_async
async def test_input_to_input_output(self, usage_endpoint):
async def test_model_in_operation_input_to_input_output(self, usage_endpoint):
client = self.create_async_client(endpoint=usage_endpoint)
response = await client.model_in_operation.input_to_input_output(
body={"name": "str"},
@ -26,7 +26,7 @@ class TestUsageModelInOperationOperationsAsync(UsageClientTestBaseAsync):
@UsagePreparer()
@recorded_by_proxy_async
async def test_output_to_input_output(self, usage_endpoint):
async def test_model_in_operation_output_to_input_output(self, usage_endpoint):
client = self.create_async_client(endpoint=usage_endpoint)
response = await client.model_in_operation.output_to_input_output()
@ -35,7 +35,7 @@ class TestUsageModelInOperationOperationsAsync(UsageClientTestBaseAsync):
@UsagePreparer()
@recorded_by_proxy_async
async def test_model_in_read_only_property(self, usage_endpoint):
async def test_model_in_operation_model_in_read_only_property(self, usage_endpoint):
client = self.create_async_client(endpoint=usage_endpoint)
response = await client.model_in_operation.model_in_read_only_property(
body={"result": {"name": "str"}},

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

@ -2,12 +2,14 @@
"CrossLanguagePackageId": "_Specs_.Azure.Core.Basic",
"CrossLanguageDefinitionId": {
"specs.azure.core.basic.models.User": "_Specs_.Azure.Core.Basic.User",
"specs.azure.core.basic.models.UserList": "_Specs_.Azure.Core.Basic.UserList",
"specs.azure.core.basic.models.UserOrder": "_Specs_.Azure.Core.Basic.UserOrder",
"specs.azure.core.basic.BasicClient.create_or_update": "_Specs_.Azure.Core.Basic.createOrUpdate",
"specs.azure.core.basic.BasicClient.create_or_replace": "_Specs_.Azure.Core.Basic.createOrReplace",
"specs.azure.core.basic.BasicClient.get": "_Specs_.Azure.Core.Basic.get",
"specs.azure.core.basic.BasicClient.list": "_Specs_.Azure.Core.Basic.list",
"specs.azure.core.basic.BasicClient.delete": "_Specs_.Azure.Core.Basic.delete",
"specs.azure.core.basic.BasicClient.export": "_Specs_.Azure.Core.Basic.export"
"specs.azure.core.basic.BasicClient.export": "_Specs_.Azure.Core.Basic.export",
"specs.azure.core.basic.BasicClient.export_all_users": "_Specs_.Azure.Core.Basic.exportAllUsers"
}
}

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

@ -78,3 +78,14 @@ class TestBasic(BasicClientTestBase):
# please add some check logic here by yourself
# ...
@BasicPreparer()
@recorded_by_proxy
def test_export_all_users(self, basic_endpoint):
client = self.create_client(endpoint=basic_endpoint)
response = client.export_all_users(
format="str",
)
# please add some check logic here by yourself
# ...

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

@ -79,3 +79,14 @@ class TestBasicAsync(BasicClientTestBaseAsync):
# please add some check logic here by yourself
# ...
@BasicPreparer()
@recorded_by_proxy_async
async def test_export_all_users(self, basic_endpoint):
client = self.create_async_client(endpoint=basic_endpoint)
response = await client.export_all_users(
format="str",
)
# please add some check logic here by yourself
# ...

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

@ -215,6 +215,26 @@ def build_basic_export_request(id: int, *, format: str, **kwargs: Any) -> HttpRe
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
def build_basic_export_all_users_request(*, format: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = "/azure/core/basic/users:exportallusers"
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
_params["format"] = _SERIALIZER.query("format", format, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
class BasicClientOperationsMixin(BasicClientMixinABC):
@overload
@ -779,3 +799,65 @@ class BasicClientOperationsMixin(BasicClientMixinABC):
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def export_all_users(self, *, format: str, **kwargs: Any) -> _models.UserList:
"""Exports all users.
Exports all users.
:keyword format: The format of the data. Required.
:paramtype format: str
:return: UserList. The UserList is compatible with MutableMapping
:rtype: ~specs.azure.core.basic.models.UserList
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[_models.UserList] = kwargs.pop("cls", None)
_request = build_basic_export_all_users_request(
format=format,
api_version=self._config.api_version,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
if _stream:
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.UserList, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore

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

@ -35,6 +35,7 @@ from ..._operations._operations import (
build_basic_create_or_replace_request,
build_basic_create_or_update_request,
build_basic_delete_request,
build_basic_export_all_users_request,
build_basic_export_request,
build_basic_get_request,
build_basic_list_request,
@ -618,3 +619,65 @@ class BasicClientOperationsMixin(BasicClientMixinABC):
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def export_all_users(self, *, format: str, **kwargs: Any) -> _models.UserList:
"""Exports all users.
Exports all users.
:keyword format: The format of the data. Required.
:paramtype format: str
:return: UserList. The UserList is compatible with MutableMapping
:rtype: ~specs.azure.core.basic.models.UserList
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[_models.UserList] = kwargs.pop("cls", None)
_request = build_basic_export_all_users_request(
format=format,
api_version=self._config.api_version,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
if _stream:
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.UserList, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore

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

@ -7,6 +7,7 @@
# --------------------------------------------------------------------------
from ._models import User
from ._models import UserList
from ._models import UserOrder
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
@ -14,6 +15,7 @@ from ._patch import patch_sdk as _patch_sdk
__all__ = [
"User",
"UserList",
"UserOrder",
]
__all__.extend([p for p in _patch_all if p not in __all__])

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

@ -61,6 +61,35 @@ class User(_model_base.Model):
super().__init__(*args, **kwargs)
class UserList(_model_base.Model):
"""UserList.
:ivar users: Required.
:vartype users: list[~specs.azure.core.basic.models.User]
"""
users: List["_models.User"] = rest_field()
"""Required."""
@overload
def __init__(
self,
*,
users: List["_models.User"],
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class UserOrder(_model_base.Model):
"""UserOrder for testing list with expand.

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

@ -14,7 +14,7 @@ from testpreparer import ModelClientTestBase, ModelPreparer
class TestModelAzureCoreEmbeddingVectorOperations(ModelClientTestBase):
@ModelPreparer()
@recorded_by_proxy
def test_get(self, model_endpoint):
def test_azure_core_embedding_vector_get(self, model_endpoint):
client = self.create_client(endpoint=model_endpoint)
response = client.azure_core_embedding_vector.get()
@ -23,7 +23,7 @@ class TestModelAzureCoreEmbeddingVectorOperations(ModelClientTestBase):
@ModelPreparer()
@recorded_by_proxy
def test_put(self, model_endpoint):
def test_azure_core_embedding_vector_put(self, model_endpoint):
client = self.create_client(endpoint=model_endpoint)
response = client.azure_core_embedding_vector.put(
body=[0],
@ -34,7 +34,7 @@ class TestModelAzureCoreEmbeddingVectorOperations(ModelClientTestBase):
@ModelPreparer()
@recorded_by_proxy
def test_post(self, model_endpoint):
def test_azure_core_embedding_vector_post(self, model_endpoint):
client = self.create_client(endpoint=model_endpoint)
response = client.azure_core_embedding_vector.post(
body={"embedding": [0]},

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

@ -15,7 +15,7 @@ from testpreparer_async import ModelClientTestBaseAsync
class TestModelAzureCoreEmbeddingVectorOperationsAsync(ModelClientTestBaseAsync):
@ModelPreparer()
@recorded_by_proxy_async
async def test_get(self, model_endpoint):
async def test_azure_core_embedding_vector_get(self, model_endpoint):
client = self.create_async_client(endpoint=model_endpoint)
response = await client.azure_core_embedding_vector.get()
@ -24,7 +24,7 @@ class TestModelAzureCoreEmbeddingVectorOperationsAsync(ModelClientTestBaseAsync)
@ModelPreparer()
@recorded_by_proxy_async
async def test_put(self, model_endpoint):
async def test_azure_core_embedding_vector_put(self, model_endpoint):
client = self.create_async_client(endpoint=model_endpoint)
response = await client.azure_core_embedding_vector.put(
body=[0],
@ -35,7 +35,7 @@ class TestModelAzureCoreEmbeddingVectorOperationsAsync(ModelClientTestBaseAsync)
@ModelPreparer()
@recorded_by_proxy_async
async def test_post(self, model_endpoint):
async def test_azure_core_embedding_vector_post(self, model_endpoint):
client = self.create_async_client(endpoint=model_endpoint)
response = await client.azure_core_embedding_vector.post(
body={"embedding": [0]},

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

@ -14,7 +14,7 @@ from testpreparer import PageClientTestBase, PagePreparer
class TestPageTwoModelsAsPageItemOperations(PageClientTestBase):
@PagePreparer()
@recorded_by_proxy
def test_list_first_item(self, page_endpoint):
def test_two_models_as_page_item_list_first_item(self, page_endpoint):
client = self.create_client(endpoint=page_endpoint)
response = client.two_models_as_page_item.list_first_item()
result = [r for r in response]
@ -23,7 +23,7 @@ class TestPageTwoModelsAsPageItemOperations(PageClientTestBase):
@PagePreparer()
@recorded_by_proxy
def test_list_second_item(self, page_endpoint):
def test_two_models_as_page_item_list_second_item(self, page_endpoint):
client = self.create_client(endpoint=page_endpoint)
response = client.two_models_as_page_item.list_second_item()
result = [r for r in response]

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

@ -15,7 +15,7 @@ from testpreparer_async import PageClientTestBaseAsync
class TestPageTwoModelsAsPageItemOperationsAsync(PageClientTestBaseAsync):
@PagePreparer()
@recorded_by_proxy_async
async def test_list_first_item(self, page_endpoint):
async def test_two_models_as_page_item_list_first_item(self, page_endpoint):
client = self.create_async_client(endpoint=page_endpoint)
response = client.two_models_as_page_item.list_first_item()
result = [r async for r in response]
@ -24,7 +24,7 @@ class TestPageTwoModelsAsPageItemOperationsAsync(PageClientTestBaseAsync):
@PagePreparer()
@recorded_by_proxy_async
async def test_list_second_item(self, page_endpoint):
async def test_two_models_as_page_item_list_second_item(self, page_endpoint):
client = self.create_async_client(endpoint=page_endpoint)
response = client.two_models_as_page_item.list_second_item()
result = [r async for r in response]

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

@ -14,7 +14,7 @@ from testpreparer import ScalarClientTestBase, ScalarPreparer
class TestScalarAzureLocationScalarOperations(ScalarClientTestBase):
@ScalarPreparer()
@recorded_by_proxy
def test_get(self, scalar_endpoint):
def test_azure_location_scalar_get(self, scalar_endpoint):
client = self.create_client(endpoint=scalar_endpoint)
response = client.azure_location_scalar.get()
@ -23,7 +23,7 @@ class TestScalarAzureLocationScalarOperations(ScalarClientTestBase):
@ScalarPreparer()
@recorded_by_proxy
def test_put(self, scalar_endpoint):
def test_azure_location_scalar_put(self, scalar_endpoint):
client = self.create_client(endpoint=scalar_endpoint)
response = client.azure_location_scalar.put(
body="str",
@ -35,7 +35,7 @@ class TestScalarAzureLocationScalarOperations(ScalarClientTestBase):
@ScalarPreparer()
@recorded_by_proxy
def test_post(self, scalar_endpoint):
def test_azure_location_scalar_post(self, scalar_endpoint):
client = self.create_client(endpoint=scalar_endpoint)
response = client.azure_location_scalar.post(
body={"location": "str"},
@ -46,7 +46,7 @@ class TestScalarAzureLocationScalarOperations(ScalarClientTestBase):
@ScalarPreparer()
@recorded_by_proxy
def test_header(self, scalar_endpoint):
def test_azure_location_scalar_header(self, scalar_endpoint):
client = self.create_client(endpoint=scalar_endpoint)
response = client.azure_location_scalar.header(
region="str",
@ -57,7 +57,7 @@ class TestScalarAzureLocationScalarOperations(ScalarClientTestBase):
@ScalarPreparer()
@recorded_by_proxy
def test_query(self, scalar_endpoint):
def test_azure_location_scalar_query(self, scalar_endpoint):
client = self.create_client(endpoint=scalar_endpoint)
response = client.azure_location_scalar.query(
region="str",

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

@ -15,7 +15,7 @@ from testpreparer_async import ScalarClientTestBaseAsync
class TestScalarAzureLocationScalarOperationsAsync(ScalarClientTestBaseAsync):
@ScalarPreparer()
@recorded_by_proxy_async
async def test_get(self, scalar_endpoint):
async def test_azure_location_scalar_get(self, scalar_endpoint):
client = self.create_async_client(endpoint=scalar_endpoint)
response = await client.azure_location_scalar.get()
@ -24,7 +24,7 @@ class TestScalarAzureLocationScalarOperationsAsync(ScalarClientTestBaseAsync):
@ScalarPreparer()
@recorded_by_proxy_async
async def test_put(self, scalar_endpoint):
async def test_azure_location_scalar_put(self, scalar_endpoint):
client = self.create_async_client(endpoint=scalar_endpoint)
response = await client.azure_location_scalar.put(
body="str",
@ -36,7 +36,7 @@ class TestScalarAzureLocationScalarOperationsAsync(ScalarClientTestBaseAsync):
@ScalarPreparer()
@recorded_by_proxy_async
async def test_post(self, scalar_endpoint):
async def test_azure_location_scalar_post(self, scalar_endpoint):
client = self.create_async_client(endpoint=scalar_endpoint)
response = await client.azure_location_scalar.post(
body={"location": "str"},
@ -47,7 +47,7 @@ class TestScalarAzureLocationScalarOperationsAsync(ScalarClientTestBaseAsync):
@ScalarPreparer()
@recorded_by_proxy_async
async def test_header(self, scalar_endpoint):
async def test_azure_location_scalar_header(self, scalar_endpoint):
client = self.create_async_client(endpoint=scalar_endpoint)
response = await client.azure_location_scalar.header(
region="str",
@ -58,7 +58,7 @@ class TestScalarAzureLocationScalarOperationsAsync(ScalarClientTestBaseAsync):
@ScalarPreparer()
@recorded_by_proxy_async
async def test_query(self, scalar_endpoint):
async def test_azure_location_scalar_query(self, scalar_endpoint):
client = self.create_async_client(endpoint=scalar_endpoint)
response = await client.azure_location_scalar.query(
region="str",

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

@ -20,7 +20,7 @@ class TestManagedIdentityManagedIdentityTrackedResourcesOperations(AzureMgmtReco
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_get(self, resource_group):
def test_managed_identity_tracked_resources_get(self, resource_group):
response = self.client.managed_identity_tracked_resources.get(
resource_group_name=resource_group.name,
managed_identity_tracked_resource_name="str",
@ -31,7 +31,7 @@ class TestManagedIdentityManagedIdentityTrackedResourcesOperations(AzureMgmtReco
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_create_with_system_assigned(self, resource_group):
def test_managed_identity_tracked_resources_create_with_system_assigned(self, resource_group):
response = self.client.managed_identity_tracked_resources.create_with_system_assigned(
resource_group_name=resource_group.name,
managed_identity_tracked_resource_name="str",
@ -64,7 +64,7 @@ class TestManagedIdentityManagedIdentityTrackedResourcesOperations(AzureMgmtReco
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_update_with_user_assigned_and_system_assigned(self, resource_group):
def test_managed_identity_tracked_resources_update_with_user_assigned_and_system_assigned(self, resource_group):
response = self.client.managed_identity_tracked_resources.update_with_user_assigned_and_system_assigned(
resource_group_name=resource_group.name,
managed_identity_tracked_resource_name="str",

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

@ -21,7 +21,7 @@ class TestManagedIdentityManagedIdentityTrackedResourcesOperationsAsync(AzureMgm
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_get(self, resource_group):
async def test_managed_identity_tracked_resources_get(self, resource_group):
response = await self.client.managed_identity_tracked_resources.get(
resource_group_name=resource_group.name,
managed_identity_tracked_resource_name="str",
@ -32,7 +32,7 @@ class TestManagedIdentityManagedIdentityTrackedResourcesOperationsAsync(AzureMgm
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_create_with_system_assigned(self, resource_group):
async def test_managed_identity_tracked_resources_create_with_system_assigned(self, resource_group):
response = await self.client.managed_identity_tracked_resources.create_with_system_assigned(
resource_group_name=resource_group.name,
managed_identity_tracked_resource_name="str",
@ -65,7 +65,9 @@ class TestManagedIdentityManagedIdentityTrackedResourcesOperationsAsync(AzureMgm
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_update_with_user_assigned_and_system_assigned(self, resource_group):
async def test_managed_identity_tracked_resources_update_with_user_assigned_and_system_assigned(
self, resource_group
):
response = await self.client.managed_identity_tracked_resources.update_with_user_assigned_and_system_assigned(
resource_group_name=resource_group.name,
managed_identity_tracked_resource_name="str",

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

@ -9,8 +9,10 @@
"azure.resourcemanager.models.resources.models.NestedProxyResource": "Azure.ResourceManager.Models.Resources.NestedProxyResource",
"azure.resourcemanager.models.resources.models.NestedProxyResourceProperties": "Azure.ResourceManager.Models.Resources.NestedProxyResourceProperties",
"azure.resourcemanager.models.resources.models.NotificationDetails": "Azure.ResourceManager.Models.Resources.NotificationDetails",
"azure.resourcemanager.models.resources.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
"azure.resourcemanager.models.resources.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
"azure.resourcemanager.models.resources.models.SingletonTrackedResource": "Azure.ResourceManager.Models.Resources.SingletonTrackedResource",
"azure.resourcemanager.models.resources.models.SingletonTrackedResourceProperties": "Azure.ResourceManager.Models.Resources.SingletonTrackedResourceProperties",
"azure.resourcemanager.models.resources.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
"azure.resourcemanager.models.resources.models.TopLevelTrackedResource": "Azure.ResourceManager.Models.Resources.TopLevelTrackedResource",
"azure.resourcemanager.models.resources.models.TopLevelTrackedResourceProperties": "Azure.ResourceManager.Models.Resources.TopLevelTrackedResourceProperties",
"azure.resourcemanager.models.resources.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
@ -26,6 +28,10 @@
"azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.begin_create_or_replace": "Azure.ResourceManager.Models.Resources.NestedProxyResources.createOrReplace",
"azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.begin_update": "Azure.ResourceManager.Models.Resources.NestedProxyResources.update",
"azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.begin_delete": "Azure.ResourceManager.Models.Resources.NestedProxyResources.delete",
"azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.list_by_top_level_tracked_resource": "Azure.ResourceManager.Models.Resources.NestedProxyResources.listByTopLevelTrackedResource"
"azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.list_by_top_level_tracked_resource": "Azure.ResourceManager.Models.Resources.NestedProxyResources.listByTopLevelTrackedResource",
"azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.get_by_resource_group": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.getByResourceGroup",
"azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.begin_create_or_update": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.createOrUpdate",
"azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.update": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.update",
"azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.list_by_resource_group": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.listByResourceGroup"
}
}

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

@ -17,7 +17,11 @@ from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from ._configuration import ResourcesClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import NestedProxyResourcesOperations, TopLevelTrackedResourcesOperations
from .operations import (
NestedProxyResourcesOperations,
SingletonTrackedResourcesOperations,
TopLevelTrackedResourcesOperations,
)
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
@ -33,6 +37,9 @@ class ResourcesClient: # pylint: disable=client-accepts-api-version-keyword
:ivar nested_proxy_resources: NestedProxyResourcesOperations operations
:vartype nested_proxy_resources:
azure.resourcemanager.models.resources.operations.NestedProxyResourcesOperations
:ivar singleton_tracked_resources: SingletonTrackedResourcesOperations operations
:vartype singleton_tracked_resources:
azure.resourcemanager.models.resources.operations.SingletonTrackedResourcesOperations
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
@ -87,6 +94,9 @@ class ResourcesClient: # pylint: disable=client-accepts-api-version-keyword
self.nested_proxy_resources = NestedProxyResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.singleton_tracked_resources = SingletonTrackedResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.

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

@ -17,7 +17,11 @@ from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPol
from .._serialization import Deserializer, Serializer
from ._configuration import ResourcesClientConfiguration
from .operations import NestedProxyResourcesOperations, TopLevelTrackedResourcesOperations
from .operations import (
NestedProxyResourcesOperations,
SingletonTrackedResourcesOperations,
TopLevelTrackedResourcesOperations,
)
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
@ -33,6 +37,9 @@ class ResourcesClient: # pylint: disable=client-accepts-api-version-keyword
:ivar nested_proxy_resources: NestedProxyResourcesOperations operations
:vartype nested_proxy_resources:
azure.resourcemanager.models.resources.aio.operations.NestedProxyResourcesOperations
:ivar singleton_tracked_resources: SingletonTrackedResourcesOperations operations
:vartype singleton_tracked_resources:
azure.resourcemanager.models.resources.aio.operations.SingletonTrackedResourcesOperations
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
@ -87,6 +94,9 @@ class ResourcesClient: # pylint: disable=client-accepts-api-version-keyword
self.nested_proxy_resources = NestedProxyResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.singleton_tracked_resources = SingletonTrackedResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
def send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any

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

@ -8,6 +8,7 @@
from ._operations import TopLevelTrackedResourcesOperations
from ._operations import NestedProxyResourcesOperations
from ._operations import SingletonTrackedResourcesOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
@ -16,6 +17,7 @@ from ._patch import patch_sdk as _patch_sdk
__all__ = [
"TopLevelTrackedResourcesOperations",
"NestedProxyResourcesOperations",
"SingletonTrackedResourcesOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -54,6 +54,10 @@ from ...operations._operations import (
build_nested_proxy_resources_get_request,
build_nested_proxy_resources_list_by_top_level_tracked_resource_request,
build_nested_proxy_resources_update_request,
build_singleton_tracked_resources_create_or_update_request,
build_singleton_tracked_resources_get_by_resource_group_request,
build_singleton_tracked_resources_list_by_resource_group_request,
build_singleton_tracked_resources_update_request,
build_top_level_tracked_resources_action_sync_request,
build_top_level_tracked_resources_create_or_replace_request,
build_top_level_tracked_resources_delete_request,
@ -1892,3 +1896,536 @@ class NestedProxyResourcesOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
class SingletonTrackedResourcesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.resourcemanager.models.resources.aio.ResourcesClient`'s
:attr:`singleton_tracked_resources` attribute.
"""
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
async def get_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.SingletonTrackedResource:
"""Get a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None)
_request = build_singleton_tracked_resources_get_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=self._config.api_version,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
if _stream:
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.SingletonTrackedResource, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
_request = build_singleton_tracked_resources_create_or_update_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
content_type=content_type,
api_version=self._config.api_version,
content=_content,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 201:
response_headers["Azure-AsyncOperation"] = self._deserialize(
"str", response.headers.get("Azure-AsyncOperation")
)
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
deserialized = response.iter_bytes()
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
resource: _models.SingletonTrackedResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Required.
:type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self, resource_group_name: str, resource: JSON, *, content_type: str = "application/json", **kwargs: Any
) -> AsyncLROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Required.
:type resource: JSON
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self, resource_group_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> AsyncLROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Is one of the following types:
SingletonTrackedResource, JSON, IO[bytes] Required.
:type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or JSON
or IO[bytes]
:return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
resource=resource,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = _deserialize(_models.SingletonTrackedResource, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.SingletonTrackedResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.SingletonTrackedResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@overload
async def update(
self,
resource_group_name: str,
properties: _models.SingletonTrackedResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Required.
:type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def update(
self, resource_group_name: str, properties: JSON, *, content_type: str = "application/json", **kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Required.
:type properties: JSON
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def update(
self, resource_group_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Required.
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def update(
self,
resource_group_name: str,
properties: Union[_models.SingletonTrackedResource, JSON, IO[bytes]],
**kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Is one of the following types:
SingletonTrackedResource, JSON, IO[bytes] Required.
:type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or
JSON or IO[bytes]
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_content = None
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
_request = build_singleton_tracked_resources_update_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
content_type=content_type,
api_version=self._config.api_version,
content=_content,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
if _stream:
try:
await response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.SingletonTrackedResource, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.SingletonTrackedResource"]:
"""List SingletonTrackedResource resources by resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:return: An iterator like instance of SingletonTrackedResource
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[List[_models.SingletonTrackedResource]] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_singleton_tracked_resources_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=self._config.api_version,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url(
"self._config.base_url", self._config.base_url, "str", skip_quote=True
),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
path_format_arguments = {
"endpoint": self._serialize.url(
"self._config.base_url", self._config.base_url, "str", skip_quote=True
),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
return _request
async def extract_data(pipeline_response):
deserialized = pipeline_response.http_response.json()
list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized["value"])
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.get("nextLink") or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)

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

@ -14,6 +14,8 @@ from ._models import NestedProxyResourceProperties
from ._models import NotificationDetails
from ._models import ProxyResource
from ._models import Resource
from ._models import SingletonTrackedResource
from ._models import SingletonTrackedResourceProperties
from ._models import SystemData
from ._models import TopLevelTrackedResource
from ._models import TopLevelTrackedResourceProperties
@ -34,6 +36,8 @@ __all__ = [
"NotificationDetails",
"ProxyResource",
"Resource",
"SingletonTrackedResource",
"SingletonTrackedResourceProperties",
"SystemData",
"TopLevelTrackedResource",
"TopLevelTrackedResourceProperties",

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

@ -262,6 +262,143 @@ class NotificationDetails(_model_base.Model):
super().__init__(*args, **kwargs)
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top level resource which
has 'tags' and a 'location'.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.resourcemanager.models.resources.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
"""
tags: Optional[Dict[str, str]] = rest_field()
"""Resource tags."""
location: str = rest_field(visibility=["read", "create"])
"""The geo-location where the resource lives. Required."""
@overload
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class SingletonTrackedResource(TrackedResource):
"""Concrete tracked resource types can be created by aliasing this type using a specific property
type.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.resourcemanager.models.resources.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
:ivar properties: The resource-specific properties for this resource.
:vartype properties:
~azure.resourcemanager.models.resources.models.SingletonTrackedResourceProperties
"""
properties: Optional["_models.SingletonTrackedResourceProperties"] = rest_field()
"""The resource-specific properties for this resource."""
@overload
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
properties: Optional["_models.SingletonTrackedResourceProperties"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class SingletonTrackedResourceProperties(_model_base.Model):
"""Singleton Arm Resource Properties.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
"Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted".
:vartype provisioning_state: str or
~azure.resourcemanager.models.resources.models.ProvisioningState
:ivar description: The description of the resource.
:vartype description: str
"""
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
name="provisioningState", visibility=["read"]
)
"""The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
\"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\"."""
description: Optional[str] = rest_field()
"""The description of the resource."""
@overload
def __init__(
self,
*,
description: Optional[str] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class SystemData(_model_base.Model):
"""Metadata pertaining to creation and last modification of the resource.
@ -320,54 +457,6 @@ class SystemData(_model_base.Model):
super().__init__(*args, **kwargs)
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top level resource which
has 'tags' and a 'location'.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.resourcemanager.models.resources.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
"""
tags: Optional[Dict[str, str]] = rest_field()
"""Resource tags."""
location: str = rest_field(visibility=["read", "create"])
"""The geo-location where the resource lives. Required."""
@overload
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class TopLevelTrackedResource(TrackedResource):
"""Concrete tracked resource types can be created by aliasing this type using a specific property
type.

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

@ -8,6 +8,7 @@
from ._operations import TopLevelTrackedResourcesOperations
from ._operations import NestedProxyResourcesOperations
from ._operations import SingletonTrackedResourcesOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
@ -16,6 +17,7 @@ from ._patch import patch_sdk as _patch_sdk
__all__ = [
"TopLevelTrackedResourcesOperations",
"NestedProxyResourcesOperations",
"SingletonTrackedResourcesOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

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

@ -435,6 +435,120 @@ def build_nested_proxy_resources_list_by_top_level_tracked_resource_request( #
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
def build_singleton_tracked_resources_get_by_resource_group_request( # pylint: disable=name-too-long
resource_group_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default" # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
def build_singleton_tracked_resources_create_or_update_request( # pylint: disable=name-too-long
resource_group_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default" # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
if content_type is not None:
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
def build_singleton_tracked_resources_update_request( # pylint: disable=name-too-long
resource_group_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default" # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
if content_type is not None:
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
def build_singleton_tracked_resources_list_by_resource_group_request( # pylint: disable=name-too-long
resource_group_name: str, subscription_id: str, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources" # pylint: disable=line-too-long
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
}
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
class TopLevelTrackedResourcesOperations:
"""
.. warning::
@ -2255,3 +2369,536 @@ class NestedProxyResourcesOperations:
return pipeline_response
return ItemPaged(get_next, extract_data)
class SingletonTrackedResourcesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.resourcemanager.models.resources.ResourcesClient`'s
:attr:`singleton_tracked_resources` attribute.
"""
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def get_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.SingletonTrackedResource:
"""Get a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None)
_request = build_singleton_tracked_resources_get_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=self._config.api_version,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
if _stream:
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.SingletonTrackedResource, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
_request = build_singleton_tracked_resources_create_or_update_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
content_type=content_type,
api_version=self._config.api_version,
content=_content,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 201:
response_headers["Azure-AsyncOperation"] = self._deserialize(
"str", response.headers.get("Azure-AsyncOperation")
)
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
deserialized = response.iter_bytes()
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
def begin_create_or_update(
self,
resource_group_name: str,
resource: _models.SingletonTrackedResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Required.
:type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_create_or_update(
self, resource_group_name: str, resource: JSON, *, content_type: str = "application/json", **kwargs: Any
) -> LROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Required.
:type resource: JSON
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_create_or_update(
self, resource_group_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> LROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.SingletonTrackedResource]:
"""Create a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param resource: Resource create parameters. Is one of the following types:
SingletonTrackedResource, JSON, IO[bytes] Required.
:type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or JSON
or IO[bytes]
:return: An instance of LROPoller that returns SingletonTrackedResource. The
SingletonTrackedResource is compatible with MutableMapping
:rtype:
~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
resource=resource,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = _deserialize(_models.SingletonTrackedResource, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
if polling is True:
polling_method: PollingMethod = cast(
PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
)
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[_models.SingletonTrackedResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[_models.SingletonTrackedResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@overload
def update(
self,
resource_group_name: str,
properties: _models.SingletonTrackedResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Required.
:type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def update(
self, resource_group_name: str, properties: JSON, *, content_type: str = "application/json", **kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Required.
:type properties: JSON
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def update(
self, resource_group_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Required.
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def update(
self,
resource_group_name: str,
properties: Union[_models.SingletonTrackedResource, JSON, IO[bytes]],
**kwargs: Any
) -> _models.SingletonTrackedResource:
"""Update a SingletonTrackedResource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param properties: The resource properties to be updated. Is one of the following types:
SingletonTrackedResource, JSON, IO[bytes] Required.
:type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or
JSON or IO[bytes]
:return: SingletonTrackedResource. The SingletonTrackedResource is compatible with
MutableMapping
:rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_content = None
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
_request = build_singleton_tracked_resources_update_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
content_type=content_type,
api_version=self._config.api_version,
content=_content,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
if _stream:
try:
response.read() # Load the body in memory and close the socket
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if _stream:
deserialized = response.iter_bytes()
else:
deserialized = _deserialize(_models.SingletonTrackedResource, response.json())
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> Iterable["_models.SingletonTrackedResource"]:
"""List SingletonTrackedResource resources by resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:return: An iterator like instance of SingletonTrackedResource
:rtype:
~azure.core.paging.ItemPaged[~azure.resourcemanager.models.resources.models.SingletonTrackedResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}
cls: ClsType[List[_models.SingletonTrackedResource]] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_singleton_tracked_resources_list_by_resource_group_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=self._config.api_version,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url(
"self._config.base_url", self._config.base_url, "str", skip_quote=True
),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
path_format_arguments = {
"endpoint": self._serialize.url(
"self._config.base_url", self._config.base_url, "str", skip_quote=True
),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)
return _request
def extract_data(pipeline_response):
deserialized = pipeline_response.http_response.json()
list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized["value"])
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.get("nextLink") or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _deserialize(_models.ErrorResponse, response.json())
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)

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

@ -20,7 +20,7 @@ class TestResourcesNestedProxyResourcesOperations(AzureMgmtRecordedTestCase):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_get(self, resource_group):
def test_nested_proxy_resources_get(self, resource_group):
response = self.client.nested_proxy_resources.get(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -32,7 +32,7 @@ class TestResourcesNestedProxyResourcesOperations(AzureMgmtRecordedTestCase):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_begin_create_or_replace(self, resource_group):
def test_nested_proxy_resources_begin_create_or_replace(self, resource_group):
response = self.client.nested_proxy_resources.begin_create_or_replace(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -58,7 +58,7 @@ class TestResourcesNestedProxyResourcesOperations(AzureMgmtRecordedTestCase):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_begin_update(self, resource_group):
def test_nested_proxy_resources_begin_update(self, resource_group):
response = self.client.nested_proxy_resources.begin_update(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -84,7 +84,7 @@ class TestResourcesNestedProxyResourcesOperations(AzureMgmtRecordedTestCase):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_begin_delete(self, resource_group):
def test_nested_proxy_resources_begin_delete(self, resource_group):
response = self.client.nested_proxy_resources.begin_delete(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -96,7 +96,7 @@ class TestResourcesNestedProxyResourcesOperations(AzureMgmtRecordedTestCase):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_list_by_top_level_tracked_resource(self, resource_group):
def test_nested_proxy_resources_list_by_top_level_tracked_resource(self, resource_group):
response = self.client.nested_proxy_resources.list_by_top_level_tracked_resource(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",

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

@ -21,7 +21,7 @@ class TestResourcesNestedProxyResourcesOperationsAsync(AzureMgmtRecordedTestCase
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_get(self, resource_group):
async def test_nested_proxy_resources_get(self, resource_group):
response = await self.client.nested_proxy_resources.get(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -33,7 +33,7 @@ class TestResourcesNestedProxyResourcesOperationsAsync(AzureMgmtRecordedTestCase
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_begin_create_or_replace(self, resource_group):
async def test_nested_proxy_resources_begin_create_or_replace(self, resource_group):
response = await (
await self.client.nested_proxy_resources.begin_create_or_replace(
resource_group_name=resource_group.name,
@ -61,7 +61,7 @@ class TestResourcesNestedProxyResourcesOperationsAsync(AzureMgmtRecordedTestCase
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_begin_update(self, resource_group):
async def test_nested_proxy_resources_begin_update(self, resource_group):
response = await (
await self.client.nested_proxy_resources.begin_update(
resource_group_name=resource_group.name,
@ -89,7 +89,7 @@ class TestResourcesNestedProxyResourcesOperationsAsync(AzureMgmtRecordedTestCase
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_begin_delete(self, resource_group):
async def test_nested_proxy_resources_begin_delete(self, resource_group):
response = await (
await self.client.nested_proxy_resources.begin_delete(
resource_group_name=resource_group.name,
@ -103,7 +103,7 @@ class TestResourcesNestedProxyResourcesOperationsAsync(AzureMgmtRecordedTestCase
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_list_by_top_level_tracked_resource(self, resource_group):
async def test_nested_proxy_resources_list_by_top_level_tracked_resource(self, resource_group):
response = self.client.nested_proxy_resources.list_by_top_level_tracked_resource(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",

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

@ -0,0 +1,91 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.resourcemanager.models.resources import ResourcesClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestResourcesSingletonTrackedResourcesOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(ResourcesClient)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_singleton_tracked_resources_get_by_resource_group(self, resource_group):
response = self.client.singleton_tracked_resources.get_by_resource_group(
resource_group_name=resource_group.name,
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_singleton_tracked_resources_begin_create_or_update(self, resource_group):
response = self.client.singleton_tracked_resources.begin_create_or_update(
resource_group_name=resource_group.name,
resource={
"location": "str",
"id": "str",
"name": "str",
"properties": {"description": "str", "provisioningState": "str"},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"tags": {"str": "str"},
"type": "str",
},
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_singleton_tracked_resources_update(self, resource_group):
response = self.client.singleton_tracked_resources.update(
resource_group_name=resource_group.name,
properties={
"location": "str",
"id": "str",
"name": "str",
"properties": {"description": "str", "provisioningState": "str"},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"tags": {"str": "str"},
"type": "str",
},
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_singleton_tracked_resources_list_by_resource_group(self, resource_group):
response = self.client.singleton_tracked_resources.list_by_resource_group(
resource_group_name=resource_group.name,
)
result = [r for r in response]
# please add some check logic here by yourself
# ...

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

@ -0,0 +1,94 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.resourcemanager.models.resources.aio import ResourcesClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestResourcesSingletonTrackedResourcesOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(ResourcesClient, is_async=True)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_singleton_tracked_resources_get_by_resource_group(self, resource_group):
response = await self.client.singleton_tracked_resources.get_by_resource_group(
resource_group_name=resource_group.name,
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_singleton_tracked_resources_begin_create_or_update(self, resource_group):
response = await (
await self.client.singleton_tracked_resources.begin_create_or_update(
resource_group_name=resource_group.name,
resource={
"location": "str",
"id": "str",
"name": "str",
"properties": {"description": "str", "provisioningState": "str"},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"tags": {"str": "str"},
"type": "str",
},
)
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_singleton_tracked_resources_update(self, resource_group):
response = await self.client.singleton_tracked_resources.update(
resource_group_name=resource_group.name,
properties={
"location": "str",
"id": "str",
"name": "str",
"properties": {"description": "str", "provisioningState": "str"},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"tags": {"str": "str"},
"type": "str",
},
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_singleton_tracked_resources_list_by_resource_group(self, resource_group):
response = self.client.singleton_tracked_resources.list_by_resource_group(
resource_group_name=resource_group.name,
)
result = [r async for r in response]
# please add some check logic here by yourself
# ...

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

@ -20,7 +20,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_get(self, resource_group):
def test_top_level_tracked_resources_get(self, resource_group):
response = self.client.top_level_tracked_resources.get(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -31,7 +31,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_begin_create_or_replace(self, resource_group):
def test_top_level_tracked_resources_begin_create_or_replace(self, resource_group):
response = self.client.top_level_tracked_resources.begin_create_or_replace(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -58,7 +58,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_begin_update(self, resource_group):
def test_top_level_tracked_resources_begin_update(self, resource_group):
response = self.client.top_level_tracked_resources.begin_update(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -85,7 +85,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_begin_delete(self, resource_group):
def test_top_level_tracked_resources_begin_delete(self, resource_group):
response = self.client.top_level_tracked_resources.begin_delete(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -96,7 +96,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_list_by_resource_group(self, resource_group):
def test_top_level_tracked_resources_list_by_resource_group(self, resource_group):
response = self.client.top_level_tracked_resources.list_by_resource_group(
resource_group_name=resource_group.name,
)
@ -106,7 +106,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_list_by_subscription(self, resource_group):
def test_top_level_tracked_resources_list_by_subscription(self, resource_group):
response = self.client.top_level_tracked_resources.list_by_subscription()
result = [r for r in response]
# please add some check logic here by yourself
@ -114,7 +114,7 @@ class TestResourcesTopLevelTrackedResourcesOperations(AzureMgmtRecordedTestCase)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_action_sync(self, resource_group):
def test_top_level_tracked_resources_action_sync(self, resource_group):
response = self.client.top_level_tracked_resources.action_sync(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",

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

@ -21,7 +21,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_get(self, resource_group):
async def test_top_level_tracked_resources_get(self, resource_group):
response = await self.client.top_level_tracked_resources.get(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",
@ -32,7 +32,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_begin_create_or_replace(self, resource_group):
async def test_top_level_tracked_resources_begin_create_or_replace(self, resource_group):
response = await (
await self.client.top_level_tracked_resources.begin_create_or_replace(
resource_group_name=resource_group.name,
@ -61,7 +61,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_begin_update(self, resource_group):
async def test_top_level_tracked_resources_begin_update(self, resource_group):
response = await (
await self.client.top_level_tracked_resources.begin_update(
resource_group_name=resource_group.name,
@ -90,7 +90,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_begin_delete(self, resource_group):
async def test_top_level_tracked_resources_begin_delete(self, resource_group):
response = await (
await self.client.top_level_tracked_resources.begin_delete(
resource_group_name=resource_group.name,
@ -103,7 +103,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_list_by_resource_group(self, resource_group):
async def test_top_level_tracked_resources_list_by_resource_group(self, resource_group):
response = self.client.top_level_tracked_resources.list_by_resource_group(
resource_group_name=resource_group.name,
)
@ -113,7 +113,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_list_by_subscription(self, resource_group):
async def test_top_level_tracked_resources_list_by_subscription(self, resource_group):
response = self.client.top_level_tracked_resources.list_by_subscription()
result = [r async for r in response]
# please add some check logic here by yourself
@ -121,7 +121,7 @@ class TestResourcesTopLevelTrackedResourcesOperationsAsync(AzureMgmtRecordedTest
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_action_sync(self, resource_group):
async def test_top_level_tracked_resources_action_sync(self, resource_group):
response = await self.client.top_level_tracked_resources.action_sync(
resource_group_name=resource_group.name,
top_level_tracked_resource_name="str",

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

@ -14,7 +14,7 @@ from testpreparer import NamingClientTestBase, NamingPreparer
class TestNamingClientModelOperations(NamingClientTestBase):
@NamingPreparer()
@recorded_by_proxy
def test_client(self, naming_endpoint):
def test_client_model_client(self, naming_endpoint):
client = self.create_client(endpoint=naming_endpoint)
response = client.client_model.client(
body={"defaultName": bool},
@ -25,7 +25,7 @@ class TestNamingClientModelOperations(NamingClientTestBase):
@NamingPreparer()
@recorded_by_proxy
def test_language(self, naming_endpoint):
def test_client_model_language(self, naming_endpoint):
client = self.create_client(endpoint=naming_endpoint)
response = client.client_model.language(
body={"defaultName": bool},

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

@ -15,7 +15,7 @@ from testpreparer_async import NamingClientTestBaseAsync
class TestNamingClientModelOperationsAsync(NamingClientTestBaseAsync):
@NamingPreparer()
@recorded_by_proxy_async
async def test_client(self, naming_endpoint):
async def test_client_model_client(self, naming_endpoint):
client = self.create_async_client(endpoint=naming_endpoint)
response = await client.client_model.client(
body={"defaultName": bool},
@ -26,7 +26,7 @@ class TestNamingClientModelOperationsAsync(NamingClientTestBaseAsync):
@NamingPreparer()
@recorded_by_proxy_async
async def test_language(self, naming_endpoint):
async def test_client_model_language(self, naming_endpoint):
client = self.create_async_client(endpoint=naming_endpoint)
response = await client.client_model.language(
body={"defaultName": bool},

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

@ -14,7 +14,7 @@ from testpreparer import NamingClientTestBase, NamingPreparer
class TestNamingUnionEnumOperations(NamingClientTestBase):
@NamingPreparer()
@recorded_by_proxy
def test_union_enum_name(self, naming_endpoint):
def test_union_enum_union_enum_name(self, naming_endpoint):
client = self.create_client(endpoint=naming_endpoint)
response = client.union_enum.union_enum_name(
body="str",
@ -26,7 +26,7 @@ class TestNamingUnionEnumOperations(NamingClientTestBase):
@NamingPreparer()
@recorded_by_proxy
def test_union_enum_member_name(self, naming_endpoint):
def test_union_enum_union_enum_member_name(self, naming_endpoint):
client = self.create_client(endpoint=naming_endpoint)
response = client.union_enum.union_enum_member_name(
body="str",

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

@ -15,7 +15,7 @@ from testpreparer_async import NamingClientTestBaseAsync
class TestNamingUnionEnumOperationsAsync(NamingClientTestBaseAsync):
@NamingPreparer()
@recorded_by_proxy_async
async def test_union_enum_name(self, naming_endpoint):
async def test_union_enum_union_enum_name(self, naming_endpoint):
client = self.create_async_client(endpoint=naming_endpoint)
response = await client.union_enum.union_enum_name(
body="str",
@ -27,7 +27,7 @@ class TestNamingUnionEnumOperationsAsync(NamingClientTestBaseAsync):
@NamingPreparer()
@recorded_by_proxy_async
async def test_union_enum_member_name(self, naming_endpoint):
async def test_union_enum_union_enum_member_name(self, naming_endpoint):
client = self.create_async_client(endpoint=naming_endpoint)
response = await client.union_enum.union_enum_member_name(
body="str",

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

@ -14,7 +14,7 @@ from testpreparer import ServiceClientTestBase, ServicePreparer
class TestServiceBarOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_five(self, service_endpoint):
def test_bar_five(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.bar.five()
@ -23,7 +23,7 @@ class TestServiceBarOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_six(self, service_endpoint):
def test_bar_six(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.bar.six()

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

@ -15,7 +15,7 @@ from testpreparer_async import ServiceClientTestBaseAsync
class TestServiceBarOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_five(self, service_endpoint):
async def test_bar_five(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.bar.five()
@ -24,7 +24,7 @@ class TestServiceBarOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_six(self, service_endpoint):
async def test_bar_six(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.bar.six()

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

@ -14,7 +14,7 @@ from testpreparer import ServiceClientTestBase, ServicePreparer
class TestServiceBazOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_seven(self, service_endpoint):
def test_baz_foo_seven(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.baz.foo.seven()

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

@ -15,7 +15,7 @@ from testpreparer_async import ServiceClientTestBaseAsync
class TestServiceBazOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_seven(self, service_endpoint):
async def test_baz_foo_seven(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.baz.foo.seven()

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

@ -14,7 +14,7 @@ from testpreparer import ServiceClientTestBase, ServicePreparer
class TestServiceFooOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_three(self, service_endpoint):
def test_foo_three(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.foo.three()
@ -23,7 +23,7 @@ class TestServiceFooOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_four(self, service_endpoint):
def test_foo_four(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.foo.four()

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

@ -15,7 +15,7 @@ from testpreparer_async import ServiceClientTestBaseAsync
class TestServiceFooOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_three(self, service_endpoint):
async def test_foo_three(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.foo.three()
@ -24,7 +24,7 @@ class TestServiceFooOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_four(self, service_endpoint):
async def test_foo_four(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.foo.four()

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

@ -14,7 +14,7 @@ from testpreparer import ServiceClientTestBase, ServicePreparer
class TestServiceQuxOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_eight(self, service_endpoint):
def test_qux_eight(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.qux.eight()
@ -23,7 +23,7 @@ class TestServiceQuxOperations(ServiceClientTestBase):
@ServicePreparer()
@recorded_by_proxy
def test_nine(self, service_endpoint):
def test_qux_bar_nine(self, service_endpoint):
client = self.create_client(endpoint=service_endpoint)
response = client.qux.bar.nine()

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

@ -15,7 +15,7 @@ from testpreparer_async import ServiceClientTestBaseAsync
class TestServiceQuxOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_eight(self, service_endpoint):
async def test_qux_eight(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.qux.eight()
@ -24,7 +24,7 @@ class TestServiceQuxOperationsAsync(ServiceClientTestBaseAsync):
@ServicePreparer()
@recorded_by_proxy_async
async def test_nine(self, service_endpoint):
async def test_qux_bar_nine(self, service_endpoint):
client = self.create_async_client(endpoint=service_endpoint)
response = await client.qux.bar.nine()

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

@ -14,7 +14,7 @@ from testpreparer import RenamedOperationClientTestBase, RenamedOperationPrepare
class TestRenamedOperationGroupOperations(RenamedOperationClientTestBase):
@RenamedOperationPreparer()
@recorded_by_proxy
def test_renamed_two(self, renamedoperation_endpoint):
def test_group_renamed_two(self, renamedoperation_endpoint):
client = self.create_client(endpoint=renamedoperation_endpoint)
response = client.group.renamed_two()
@ -23,7 +23,7 @@ class TestRenamedOperationGroupOperations(RenamedOperationClientTestBase):
@RenamedOperationPreparer()
@recorded_by_proxy
def test_renamed_four(self, renamedoperation_endpoint):
def test_group_renamed_four(self, renamedoperation_endpoint):
client = self.create_client(endpoint=renamedoperation_endpoint)
response = client.group.renamed_four()
@ -32,7 +32,7 @@ class TestRenamedOperationGroupOperations(RenamedOperationClientTestBase):
@RenamedOperationPreparer()
@recorded_by_proxy
def test_renamed_six(self, renamedoperation_endpoint):
def test_group_renamed_six(self, renamedoperation_endpoint):
client = self.create_client(endpoint=renamedoperation_endpoint)
response = client.group.renamed_six()

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

@ -15,7 +15,7 @@ from testpreparer_async import RenamedOperationClientTestBaseAsync
class TestRenamedOperationGroupOperationsAsync(RenamedOperationClientTestBaseAsync):
@RenamedOperationPreparer()
@recorded_by_proxy_async
async def test_renamed_two(self, renamedoperation_endpoint):
async def test_group_renamed_two(self, renamedoperation_endpoint):
client = self.create_async_client(endpoint=renamedoperation_endpoint)
response = await client.group.renamed_two()
@ -24,7 +24,7 @@ class TestRenamedOperationGroupOperationsAsync(RenamedOperationClientTestBaseAsy
@RenamedOperationPreparer()
@recorded_by_proxy_async
async def test_renamed_four(self, renamedoperation_endpoint):
async def test_group_renamed_four(self, renamedoperation_endpoint):
client = self.create_async_client(endpoint=renamedoperation_endpoint)
response = await client.group.renamed_four()
@ -33,7 +33,7 @@ class TestRenamedOperationGroupOperationsAsync(RenamedOperationClientTestBaseAsy
@RenamedOperationPreparer()
@recorded_by_proxy_async
async def test_renamed_six(self, renamedoperation_endpoint):
async def test_group_renamed_six(self, renamedoperation_endpoint):
client = self.create_async_client(endpoint=renamedoperation_endpoint)
response = await client.group.renamed_six()

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

@ -14,7 +14,7 @@ from testpreparer import TwoOperationGroupClientTestBase, TwoOperationGroupPrepa
class TestTwoOperationGroupGroup1Operations(TwoOperationGroupClientTestBase):
@TwoOperationGroupPreparer()
@recorded_by_proxy
def test_one(self, twooperationgroup_endpoint):
def test_group1_one(self, twooperationgroup_endpoint):
client = self.create_client(endpoint=twooperationgroup_endpoint)
response = client.group1.one()
@ -23,7 +23,7 @@ class TestTwoOperationGroupGroup1Operations(TwoOperationGroupClientTestBase):
@TwoOperationGroupPreparer()
@recorded_by_proxy
def test_three(self, twooperationgroup_endpoint):
def test_group1_three(self, twooperationgroup_endpoint):
client = self.create_client(endpoint=twooperationgroup_endpoint)
response = client.group1.three()
@ -32,7 +32,7 @@ class TestTwoOperationGroupGroup1Operations(TwoOperationGroupClientTestBase):
@TwoOperationGroupPreparer()
@recorded_by_proxy
def test_four(self, twooperationgroup_endpoint):
def test_group1_four(self, twooperationgroup_endpoint):
client = self.create_client(endpoint=twooperationgroup_endpoint)
response = client.group1.four()

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

@ -15,7 +15,7 @@ from testpreparer_async import TwoOperationGroupClientTestBaseAsync
class TestTwoOperationGroupGroup1OperationsAsync(TwoOperationGroupClientTestBaseAsync):
@TwoOperationGroupPreparer()
@recorded_by_proxy_async
async def test_one(self, twooperationgroup_endpoint):
async def test_group1_one(self, twooperationgroup_endpoint):
client = self.create_async_client(endpoint=twooperationgroup_endpoint)
response = await client.group1.one()
@ -24,7 +24,7 @@ class TestTwoOperationGroupGroup1OperationsAsync(TwoOperationGroupClientTestBase
@TwoOperationGroupPreparer()
@recorded_by_proxy_async
async def test_three(self, twooperationgroup_endpoint):
async def test_group1_three(self, twooperationgroup_endpoint):
client = self.create_async_client(endpoint=twooperationgroup_endpoint)
response = await client.group1.three()
@ -33,7 +33,7 @@ class TestTwoOperationGroupGroup1OperationsAsync(TwoOperationGroupClientTestBase
@TwoOperationGroupPreparer()
@recorded_by_proxy_async
async def test_four(self, twooperationgroup_endpoint):
async def test_group1_four(self, twooperationgroup_endpoint):
client = self.create_async_client(endpoint=twooperationgroup_endpoint)
response = await client.group1.four()

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

@ -14,7 +14,7 @@ from testpreparer import TwoOperationGroupClientTestBase, TwoOperationGroupPrepa
class TestTwoOperationGroupGroup2Operations(TwoOperationGroupClientTestBase):
@TwoOperationGroupPreparer()
@recorded_by_proxy
def test_two(self, twooperationgroup_endpoint):
def test_group2_two(self, twooperationgroup_endpoint):
client = self.create_client(endpoint=twooperationgroup_endpoint)
response = client.group2.two()
@ -23,7 +23,7 @@ class TestTwoOperationGroupGroup2Operations(TwoOperationGroupClientTestBase):
@TwoOperationGroupPreparer()
@recorded_by_proxy
def test_five(self, twooperationgroup_endpoint):
def test_group2_five(self, twooperationgroup_endpoint):
client = self.create_client(endpoint=twooperationgroup_endpoint)
response = client.group2.five()
@ -32,7 +32,7 @@ class TestTwoOperationGroupGroup2Operations(TwoOperationGroupClientTestBase):
@TwoOperationGroupPreparer()
@recorded_by_proxy
def test_six(self, twooperationgroup_endpoint):
def test_group2_six(self, twooperationgroup_endpoint):
client = self.create_client(endpoint=twooperationgroup_endpoint)
response = client.group2.six()

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

@ -15,7 +15,7 @@ from testpreparer_async import TwoOperationGroupClientTestBaseAsync
class TestTwoOperationGroupGroup2OperationsAsync(TwoOperationGroupClientTestBaseAsync):
@TwoOperationGroupPreparer()
@recorded_by_proxy_async
async def test_two(self, twooperationgroup_endpoint):
async def test_group2_two(self, twooperationgroup_endpoint):
client = self.create_async_client(endpoint=twooperationgroup_endpoint)
response = await client.group2.two()
@ -24,7 +24,7 @@ class TestTwoOperationGroupGroup2OperationsAsync(TwoOperationGroupClientTestBase
@TwoOperationGroupPreparer()
@recorded_by_proxy_async
async def test_five(self, twooperationgroup_endpoint):
async def test_group2_five(self, twooperationgroup_endpoint):
client = self.create_async_client(endpoint=twooperationgroup_endpoint)
response = await client.group2.five()
@ -33,7 +33,7 @@ class TestTwoOperationGroupGroup2OperationsAsync(TwoOperationGroupClientTestBase
@TwoOperationGroupPreparer()
@recorded_by_proxy_async
async def test_six(self, twooperationgroup_endpoint):
async def test_group2_six(self, twooperationgroup_endpoint):
client = self.create_async_client(endpoint=twooperationgroup_endpoint)
response = await client.group2.six()

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

@ -14,7 +14,7 @@ from testpreparer import BytesClientTestBase, BytesPreparer
class TestBytesHeaderOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_default(self, bytes_endpoint):
def test_header_default(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.header.default(
value=bytes("bytes", encoding="utf-8"),
@ -25,7 +25,7 @@ class TestBytesHeaderOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64(self, bytes_endpoint):
def test_header_base64(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.header.base64(
value=bytes("bytes", encoding="utf-8"),
@ -36,7 +36,7 @@ class TestBytesHeaderOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64_url(self, bytes_endpoint):
def test_header_base64_url(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.header.base64_url(
value=bytes("bytes", encoding="utf-8"),
@ -47,7 +47,7 @@ class TestBytesHeaderOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64_url_array(self, bytes_endpoint):
def test_header_base64_url_array(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.header.base64_url_array(
value=[bytes("bytes", encoding="utf-8")],

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

@ -15,7 +15,7 @@ from testpreparer_async import BytesClientTestBaseAsync
class TestBytesHeaderOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_default(self, bytes_endpoint):
async def test_header_default(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.header.default(
value=bytes("bytes", encoding="utf-8"),
@ -26,7 +26,7 @@ class TestBytesHeaderOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_base64(self, bytes_endpoint):
async def test_header_base64(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.header.base64(
value=bytes("bytes", encoding="utf-8"),
@ -37,7 +37,7 @@ class TestBytesHeaderOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_base64_url(self, bytes_endpoint):
async def test_header_base64_url(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.header.base64_url(
value=bytes("bytes", encoding="utf-8"),
@ -48,7 +48,7 @@ class TestBytesHeaderOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_base64_url_array(self, bytes_endpoint):
async def test_header_base64_url_array(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.header.base64_url_array(
value=[bytes("bytes", encoding="utf-8")],

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

@ -14,7 +14,7 @@ from testpreparer import BytesClientTestBase, BytesPreparer
class TestBytesPropertyOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_default(self, bytes_endpoint):
def test_property_default(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.property.default(
body={"value": bytes("bytes", encoding="utf-8")},
@ -25,7 +25,7 @@ class TestBytesPropertyOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64(self, bytes_endpoint):
def test_property_base64(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.property.base64(
body={"value": bytes("bytes", encoding="utf-8")},
@ -36,7 +36,7 @@ class TestBytesPropertyOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64_url(self, bytes_endpoint):
def test_property_base64_url(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.property.base64_url(
body={"value": bytes("bytes", encoding="utf-8")},
@ -47,7 +47,7 @@ class TestBytesPropertyOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64_url_array(self, bytes_endpoint):
def test_property_base64_url_array(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.property.base64_url_array(
body={"value": [bytes("bytes", encoding="utf-8")]},

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

@ -15,7 +15,7 @@ from testpreparer_async import BytesClientTestBaseAsync
class TestBytesPropertyOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_default(self, bytes_endpoint):
async def test_property_default(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.property.default(
body={"value": bytes("bytes", encoding="utf-8")},
@ -26,7 +26,7 @@ class TestBytesPropertyOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_base64(self, bytes_endpoint):
async def test_property_base64(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.property.base64(
body={"value": bytes("bytes", encoding="utf-8")},
@ -37,7 +37,7 @@ class TestBytesPropertyOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_base64_url(self, bytes_endpoint):
async def test_property_base64_url(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.property.base64_url(
body={"value": bytes("bytes", encoding="utf-8")},
@ -48,7 +48,7 @@ class TestBytesPropertyOperationsAsync(BytesClientTestBaseAsync):
@BytesPreparer()
@recorded_by_proxy_async
async def test_base64_url_array(self, bytes_endpoint):
async def test_property_base64_url_array(self, bytes_endpoint):
client = self.create_async_client(endpoint=bytes_endpoint)
response = await client.property.base64_url_array(
body={"value": [bytes("bytes", encoding="utf-8")]},

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

@ -14,7 +14,7 @@ from testpreparer import BytesClientTestBase, BytesPreparer
class TestBytesQueryOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_default(self, bytes_endpoint):
def test_query_default(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.query.default(
value=bytes("bytes", encoding="utf-8"),
@ -25,7 +25,7 @@ class TestBytesQueryOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64(self, bytes_endpoint):
def test_query_base64(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.query.base64(
value=bytes("bytes", encoding="utf-8"),
@ -36,7 +36,7 @@ class TestBytesQueryOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64_url(self, bytes_endpoint):
def test_query_base64_url(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.query.base64_url(
value=bytes("bytes", encoding="utf-8"),
@ -47,7 +47,7 @@ class TestBytesQueryOperations(BytesClientTestBase):
@BytesPreparer()
@recorded_by_proxy
def test_base64_url_array(self, bytes_endpoint):
def test_query_base64_url_array(self, bytes_endpoint):
client = self.create_client(endpoint=bytes_endpoint)
response = client.query.base64_url_array(
value=[bytes("bytes", encoding="utf-8")],

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше