Skip to content

Commit

Permalink
CodeGen from PR 21564 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated + S360] Review request for Microsoft.SqlVirtualMachine to add version preview/2022-07-01-preview (Azure#21564)

* Adds base for updating Microsoft.SqlVirtualMachine from version preview/2022-02-01-preview to version 2022-07-01-preview

* Updates readme

* Updates API version in new specs and examples

* Updating swagger to latest api

* Add default values for optional parameters

* Adding default to optional parameters

* Fixing ModelValidator

* Adding long running options

* Update response to async

* Removing headers

* Adding headers for deletion

* Updating location for Post

* Added prettier check

* Reverted changes from error codes

* Removing the location from POST
  • Loading branch information
SDKAuto committed Dec 1, 2022
1 parent 6642030 commit 47264fd
Show file tree
Hide file tree
Showing 48 changed files with 2,355 additions and 592 deletions.
12 changes: 6 additions & 6 deletions sdk/sql/azure-mgmt-sqlvirtualmachine/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.8.4",
"commit": "a27182384f54fafa6a418c67f36b7f2b7bf5bf37",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.1.6",
"@autorest/modelerfour@4.23.5"
"@autorest/python@6.2.7",
"@autorest/modelerfour@4.24.3"
],
"commit": "e24bbf6a66cb0a19c072c6f15cee163acbd7acf7",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/sqlvirtualmachine/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.8.4 --version-tolerant=False",
"autorest_command": "autorest specification/sqlvirtualmachine/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] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/sqlvirtualmachine/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["SqlVirtualMachineManagementClient"]
__all__ = [
"SqlVirtualMachineManagementClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# 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 @@ -14,6 +15,11 @@

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 @@ -36,7 +42,7 @@ class SqlVirtualMachineManagementClientConfiguration(Configuration): # pylint:

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(SqlVirtualMachineManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-07-01-preview") # type: str
api_version: Literal["2022-07-01-preview"] = kwargs.pop("api_version", "2022-07-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -50,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-sqlvirtualmachine/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
Expand Down
Loading

0 comments on commit 47264fd

Please sign in to comment.