Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-graphservices] update sample parameter #3588

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/graphservices/azure-mgmt-graphservices/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "d4dfb3388ab40185cf302512268ad1406f666d64",
"commit": "4e5216b0d32a3e041d2fbee8cb5c5d5fff3dd50b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/[email protected].3",
"@autorest/[email protected].12",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/graphservicesprod/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/[email protected].3 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/graphservicesprod/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/[email protected].12 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/graphservicesprod/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 @@ -42,7 +36,7 @@ class GraphServicesMgmtClientConfiguration(Configuration): # pylint: disable=to

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(GraphServicesMgmtClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2022-09-22-preview"] = kwargs.pop("api_version", "2022-09-22-preview")
api_version: str = kwargs.pop("api_version", "2022-09-22-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 @@ -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,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 @@ -42,7 +36,7 @@ class GraphServicesMgmtClientConfiguration(Configuration): # pylint: disable=to

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(GraphServicesMgmtClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2022-09-22-preview"] = kwargs.pop("api_version", "2022-09-22-preview")
api_version: str = kwargs.pop("api_version", "2022-09-22-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 @@ -6,7 +6,7 @@
# 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 io import IOBase
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload

from azure.core.exceptions import (
Expand Down Expand Up @@ -35,10 +35,6 @@
build_update_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 @@ -87,9 +83,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any)
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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.AccountResource] = kwargs.pop("cls", None)

request = build_get_request(
Expand Down Expand Up @@ -145,16 +139,14 @@ async def _create_and_update_initial(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AccountResource] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(account_resource, (IO, bytes)):
if isinstance(account_resource, (IOBase, bytes)):
_content = account_resource
else:
_json = self._serialize.body(account_resource, "AccountResource")
Expand Down Expand Up @@ -310,9 +302,7 @@ async def begin_create_and_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AccountResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
Expand Down Expand Up @@ -453,16 +443,14 @@ async def update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AccountResource] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(account_resource, (IO, bytes)):
if isinstance(account_resource, (IOBase, bytes)):
_content = account_resource
else:
_json = self._serialize.body(account_resource, "AccountPatchResource")
Expand Down Expand Up @@ -532,9 +520,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["2022-09-22-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
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, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse

Expand All @@ -30,10 +29,6 @@
from ..._vendor import _convert_request
from ...operations._accounts_operations import build_list_by_resource_group_request, build_list_by_subscription_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 @@ -75,9 +70,7 @@ def list_by_resource_group(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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.AccountResourceList] = kwargs.pop("cls", None)

error_map = {
Expand Down Expand Up @@ -162,9 +155,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AccountR
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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.AccountResourceList] = kwargs.pop("cls", None)

error_map = {
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, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse

Expand All @@ -30,10 +29,6 @@
from ..._vendor import _convert_request
from ...operations._operation_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 @@ -69,9 +64,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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.OperationListResult] = kwargs.pop("cls", None)

error_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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 io import IOBase
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload

from azure.core.exceptions import (
Expand All @@ -30,10 +30,6 @@
from .._serialization import Serializer
from .._vendor import _convert_request, _format_url_section

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, HttpResponse], T, Dict[str, Any]], Any]]

Expand All @@ -45,9 +41,7 @@ def build_get_request(resource_group_name: str, resource_name: str, subscription
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-09-22-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-22-preview"))
accept = _headers.pop("Accept", "application/json")

# Construct URL
Expand Down Expand Up @@ -80,9 +74,7 @@ def build_create_and_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-09-22-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-22-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")

Expand Down Expand Up @@ -118,9 +110,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-09-22-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-22-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")

Expand Down Expand Up @@ -156,9 +146,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-09-22-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-22-preview"))
accept = _headers.pop("Accept", "application/json")

# Construct URL
Expand Down Expand Up @@ -229,9 +217,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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.AccountResource] = kwargs.pop("cls", None)

request = build_get_request(
Expand Down Expand Up @@ -287,16 +273,14 @@ def _create_and_update_initial(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AccountResource] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(account_resource, (IO, bytes)):
if isinstance(account_resource, (IOBase, bytes)):
_content = account_resource
else:
_json = self._serialize.body(account_resource, "AccountResource")
Expand Down Expand Up @@ -452,9 +436,7 @@ def begin_create_and_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AccountResource] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
Expand Down Expand Up @@ -594,16 +576,14 @@ def update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AccountResource] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(account_resource, (IO, bytes)):
if isinstance(account_resource, (IOBase, bytes)):
_content = account_resource
else:
_json = self._serialize.body(account_resource, "AccountPatchResource")
Expand Down Expand Up @@ -673,9 +653,7 @@ def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-09-22-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