Skip to content

Commit

Permalink
CodeGen from PR 24031 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 52cbd197be3e297c82857e8b1253e0dc36e57b6c into 173bb3b6fd5b1809fdbf347f67fccfa0440ac126
  • Loading branch information
SDKAuto committed May 17, 2023
1 parent 68ff2e3 commit 811c3ae
Show file tree
Hide file tree
Showing 65 changed files with 644 additions and 630 deletions.
6 changes: 3 additions & 3 deletions sdk/elastic/azure-mgmt-elastic/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "969fd0c2634fbcc1975d7abe3749330a5145a97c",
"commit": "511c7c51633c0e1a31a37f76b651da5468e39d3e",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.3",
"@autorest/python@6.4.12",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.3 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/elastic/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -43,7 +37,7 @@ class MicrosoftElasticConfiguration(Configuration): # pylint: disable=too-many-

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(MicrosoftElasticConfiguration, self).__init__(**kwargs)
api_version: Literal["2023-02-01-preview"] = kwargs.pop("api_version", "2023-02-01-preview")
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
DeploymentInfoOperations,
DetachAndDeleteTrafficFilterOperations,
DetachTrafficFilterOperations,
ElasticVersionsOperations,
ExternalUserOperations,
ListAssociatedTrafficFiltersOperations,
MonitorOperations,
Expand Down Expand Up @@ -50,6 +51,8 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype operations: azure.mgmt.elastic.operations.Operations
:ivar monitors: MonitorsOperations operations
:vartype monitors: azure.mgmt.elastic.operations.MonitorsOperations
:ivar elastic_versions: ElasticVersionsOperations operations
:vartype elastic_versions: azure.mgmt.elastic.operations.ElasticVersionsOperations
:ivar monitored_resources: MonitoredResourcesOperations operations
:vartype monitored_resources: azure.mgmt.elastic.operations.MonitoredResourcesOperations
:ivar deployment_info: DeploymentInfoOperations operations
Expand Down Expand Up @@ -121,6 +124,9 @@ def __init__(
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.monitors = MonitorsOperations(self._client, self._config, self._serialize, self._deserialize)
self.elastic_versions = ElasticVersionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.monitored_resources = MonitoredResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if xml_desc.get("attr", False):
if xml_ns:
ET.register_namespace(xml_prefix, xml_ns)
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
serialized.set(xml_name, new_attr) # type: ignore
continue
if xml_desc.get("text", False):
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
xml_ns = internal_type_xml_map.get("ns", None)
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
return xml_name


Expand All @@ -1295,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data):
# Integrate namespace if necessary
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)

# If it's an attribute, that's simple
if xml_desc.get("attr", False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.1.0b2"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from .._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
Expand All @@ -43,7 +37,7 @@ class MicrosoftElasticConfiguration(Configuration): # pylint: disable=too-many-

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(MicrosoftElasticConfiguration, self).__init__(**kwargs)
api_version: Literal["2023-02-01-preview"] = kwargs.pop("api_version", "2023-02-01-preview")
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
DeploymentInfoOperations,
DetachAndDeleteTrafficFilterOperations,
DetachTrafficFilterOperations,
ElasticVersionsOperations,
ExternalUserOperations,
ListAssociatedTrafficFiltersOperations,
MonitorOperations,
Expand Down Expand Up @@ -50,6 +51,8 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype operations: azure.mgmt.elastic.aio.operations.Operations
:ivar monitors: MonitorsOperations operations
:vartype monitors: azure.mgmt.elastic.aio.operations.MonitorsOperations
:ivar elastic_versions: ElasticVersionsOperations operations
:vartype elastic_versions: azure.mgmt.elastic.aio.operations.ElasticVersionsOperations
:ivar monitored_resources: MonitoredResourcesOperations operations
:vartype monitored_resources: azure.mgmt.elastic.aio.operations.MonitoredResourcesOperations
:ivar deployment_info: DeploymentInfoOperations operations
Expand Down Expand Up @@ -121,6 +124,9 @@ def __init__(
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.monitors = MonitorsOperations(self._client, self._config, self._serialize, self._deserialize)
self.elastic_versions = ElasticVersionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.monitored_resources = MonitoredResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from ._operations import Operations
from ._monitors_operations import MonitorsOperations
from ._elastic_versions_operations import ElasticVersionsOperations
from ._monitored_resources_operations import MonitoredResourcesOperations
from ._deployment_info_operations import DeploymentInfoOperations
from ._external_user_operations import ExternalUserOperations
Expand All @@ -34,6 +35,7 @@
__all__ = [
"Operations",
"MonitorsOperations",
"ElasticVersionsOperations",
"MonitoredResourcesOperations",
"DeploymentInfoOperations",
"ExternalUserOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar

from azure.core.exceptions import (
Expand All @@ -28,10 +27,6 @@
from ..._vendor import _convert_request
from ...operations._all_traffic_filters_operations import build_list_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -84,9 +79,7 @@ async def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ElasticTrafficFilterResponse] = kwargs.pop("cls", None)

request = build_list_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast

from azure.core.exceptions import (
Expand All @@ -30,10 +29,6 @@
from ..._vendor import _convert_request
from ...operations._associate_traffic_filter_operations import build_associate_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -71,9 +66,7 @@ async def _associate_initial( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)

request = build_associate_request(
Expand Down Expand Up @@ -140,9 +133,7 @@ async def begin_associate(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast

from azure.core.exceptions import (
Expand All @@ -30,10 +29,6 @@
from ..._vendor import _convert_request
from ...operations._create_and_associate_ip_filter_operations import build_create_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -76,9 +71,7 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)

request = build_create_request(
Expand Down Expand Up @@ -153,9 +146,7 @@ async def begin_create(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast

from azure.core.exceptions import (
Expand All @@ -30,10 +29,6 @@
from ..._vendor import _convert_request
from ...operations._create_and_associate_pl_filter_operations import build_create_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -77,9 +72,7 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)

request = build_create_request(
Expand Down Expand Up @@ -158,9 +151,7 @@ async def begin_create(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar

from azure.core.exceptions import (
Expand All @@ -28,10 +27,6 @@
from ..._vendor import _convert_request
from ...operations._deployment_info_operations import build_list_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -84,9 +79,7 @@ async def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any)
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DeploymentInfoResponse] = kwargs.pop("cls", None)

request = build_list_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar

from azure.core.exceptions import (
Expand All @@ -28,10 +27,6 @@
from ..._vendor import _convert_request
from ...operations._detach_and_delete_traffic_filter_operations import build_delete_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -86,9 +81,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2023-02-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)

request = build_delete_request(
Expand Down
Loading

0 comments on commit 811c3ae

Please sign in to comment.