Skip to content

Commit

Permalink
CodeGen from PR 24048 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Publish private branch 'dev-maintenance-Microsoft.Maintenance-2023-04-01' (Azure#24048)

* Revert "Revert "[Hub Generated] Publish private branch 'dev-maintenance-Microsoft.Maintenance-2023-04-01' (Azure#23832)" (Azure#23923)"

This reverts commit e6c0e188a74d051a3a44728ce058e85447553392.

* Removed 202 and Async supression.

* Update documentation.

* Updated documentation

---------

Co-authored-by: Kalpesh Chavan <kachavan@microsoft.com>
  • Loading branch information
SDKAuto and Kalpesh Chavan committed Jul 14, 2023
1 parent 258b250 commit 9e0a778
Show file tree
Hide file tree
Showing 73 changed files with 3,567 additions and 995 deletions.
6 changes: 3 additions & 3 deletions sdk/maintenance/azure-mgmt-maintenance/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "a2da92ad78961529a087f9d0e65394174ac50794",
"commit": "f4135efe6b75bb7bdd22e57414d2ca727a32583e",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.1",
"@autorest/python@6.6.0",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/maintenance/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.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/maintenance/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.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/maintenance/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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
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 import TokenCredential
Expand All @@ -36,14 +30,14 @@ class MaintenanceManagementClientConfiguration(Configuration): # pylint: disabl
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -57,10 +51,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-maintenance/{}".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
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models
from . import models as _models
from ._configuration import MaintenanceManagementClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
ApplyUpdateForResourceGroupOperations,
ApplyUpdatesOperations,
ConfigurationAssignmentsForResourceGroupOperations,
ConfigurationAssignmentsForSubscriptionsOperations,
ConfigurationAssignmentsOperations,
ConfigurationAssignmentsWithinSubscriptionOperations,
MaintenanceConfigurationsForResourceGroupOperations,
Expand Down Expand Up @@ -57,6 +59,14 @@ class MaintenanceManagementClient: # pylint: disable=client-accepts-api-version
ConfigurationAssignmentsWithinSubscriptionOperations operations
:vartype configuration_assignments_within_subscription:
azure.mgmt.maintenance.operations.ConfigurationAssignmentsWithinSubscriptionOperations
:ivar configuration_assignments_for_subscriptions:
ConfigurationAssignmentsForSubscriptionsOperations operations
:vartype configuration_assignments_for_subscriptions:
azure.mgmt.maintenance.operations.ConfigurationAssignmentsForSubscriptionsOperations
:ivar configuration_assignments_for_resource_group:
ConfigurationAssignmentsForResourceGroupOperations operations
:vartype configuration_assignments_for_resource_group:
azure.mgmt.maintenance.operations.ConfigurationAssignmentsForResourceGroupOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.maintenance.operations.Operations
:ivar updates: UpdatesOperations operations
Expand All @@ -68,8 +78,8 @@ class MaintenanceManagementClient: # pylint: disable=client-accepts-api-version
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand All @@ -83,9 +93,9 @@ def __init__(
self._config = MaintenanceManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
Expand All @@ -108,6 +118,12 @@ def __init__(
self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.configuration_assignments_for_subscriptions = ConfigurationAssignmentsForSubscriptionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.configuration_assignments_for_resource_group = ConfigurationAssignmentsForResourceGroupOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.updates = UpdatesOperations(self._client, self._config, self._serialize, self._deserialize)

Expand All @@ -133,15 +149,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

def __enter__(self):
# type: () -> MaintenanceManagementClient
def __enter__(self) -> "MaintenanceManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Loading

0 comments on commit 9e0a778

Please sign in to comment.