Skip to content

Commit

Permalink
CodeGen from PR 14205 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 2fc338f9ea7b1d88ce0109196040077333a5dfa9 into c2ea3a3
  • Loading branch information
SDKAuto committed Apr 30, 2021
1 parent aab9997 commit 21ae193
Show file tree
Hide file tree
Showing 33 changed files with 117 additions and 956 deletions.
2 changes: 1 addition & 1 deletion sdk/maintenance/azure-mgmt-maintenance/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.6",
"commit": "eb6d68be864349a8fd33d261e90bb2756e904e82",
"commit": "ae8f2a76c610386d12df72ec27493dc326f6f313",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/maintenance/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0",
"readme": "specification/maintenance/resource-manager/readme.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._maintenance_client import MaintenanceClient
from ._maintenance_management_client import MaintenanceManagementClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['MaintenanceClient']
__all__ = ['MaintenanceManagementClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from azure.core.credentials import TokenCredential


class MaintenanceClientConfiguration(Configuration):
"""Configuration for MaintenanceClient.
class MaintenanceManagementClientConfiguration(Configuration):
"""Configuration for MaintenanceManagementClient.
Note that all parameters used to create this instance are saved as instance
attributes.
Expand All @@ -44,11 +44,11 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MaintenanceClientConfiguration, self).__init__(**kwargs)
super(MaintenanceManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2021-04-01-preview"
self.api_version = "2021-05-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-maintenance/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,20 @@
from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import MaintenanceClientConfiguration
from ._configuration import MaintenanceManagementClientConfiguration
from .operations import PublicMaintenanceConfigurationsOperations
from .operations import ApplyUpdatesOperations
from .operations import ConfigurationAssignmentsOperations
from .operations import MaintenanceConfigurationsOperations
from .operations import MaintenanceConfigurationsForResourceGroupOperations
from .operations import ApplyUpdateForResourceGroupOperations
from .operations import ConfigurationAssignmentsWithinSubscriptionOperations
from .operations import Operations
from .operations import UpdatesOperations
from . import models


class MaintenanceClient(object):
"""Maintenance Client.
class MaintenanceManagementClient(object):
"""Azure Maintenance Management Client.
:ivar public_maintenance_configurations: PublicMaintenanceConfigurationsOperations operations
:vartype public_maintenance_configurations: azure.mgmt.maintenance.operations.PublicMaintenanceConfigurationsOperations
Expand All @@ -46,8 +45,6 @@ class MaintenanceClient(object):
:vartype maintenance_configurations_for_resource_group: azure.mgmt.maintenance.operations.MaintenanceConfigurationsForResourceGroupOperations
:ivar apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations operations
:vartype apply_update_for_resource_group: azure.mgmt.maintenance.operations.ApplyUpdateForResourceGroupOperations
:ivar configuration_assignments_within_subscription: ConfigurationAssignmentsWithinSubscriptionOperations operations
:vartype configuration_assignments_within_subscription: azure.mgmt.maintenance.operations.ConfigurationAssignmentsWithinSubscriptionOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.maintenance.operations.Operations
:ivar updates: UpdatesOperations operations
Expand All @@ -69,7 +66,7 @@ def __init__(
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = MaintenanceClientConfiguration(credential, subscription_id, **kwargs)
self._config = MaintenanceManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand All @@ -89,8 +86,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.apply_update_for_resource_group = ApplyUpdateForResourceGroupOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.updates = UpdatesOperations(
Expand Down Expand Up @@ -119,7 +114,7 @@ def close(self):
self._client.close()

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"chosen_version": "2021-04-01-preview",
"total_api_version_list": ["2021-04-01-preview"],
"chosen_version": "2021-05-01",
"total_api_version_list": ["2021-05-01"],
"client": {
"name": "MaintenanceClient",
"filename": "_maintenance_client",
"description": "Maintenance Client.",
"name": "MaintenanceManagementClient",
"filename": "_maintenance_management_client",
"description": "Azure Maintenance Management Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MaintenanceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MaintenanceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MaintenanceManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MaintenanceManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -104,7 +104,6 @@
"maintenance_configurations": "MaintenanceConfigurationsOperations",
"maintenance_configurations_for_resource_group": "MaintenanceConfigurationsForResourceGroupOperations",
"apply_update_for_resource_group": "ApplyUpdateForResourceGroupOperations",
"configuration_assignments_within_subscription": "ConfigurationAssignmentsWithinSubscriptionOperations",
"operations": "Operations",
"updates": "UpdatesOperations"
}
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.0.0"
VERSION = "1.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._maintenance_client import MaintenanceClient
__all__ = ['MaintenanceClient']
from ._maintenance_management_client import MaintenanceManagementClient
__all__ = ['MaintenanceManagementClient']
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from azure.core.credentials_async import AsyncTokenCredential


class MaintenanceClientConfiguration(Configuration):
"""Configuration for MaintenanceClient.
class MaintenanceManagementClientConfiguration(Configuration):
"""Configuration for MaintenanceManagementClient.
Note that all parameters used to create this instance are saved as instance
attributes.
Expand All @@ -41,11 +41,11 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MaintenanceClientConfiguration, self).__init__(**kwargs)
super(MaintenanceManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2021-04-01-preview"
self.api_version = "2021-05-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-maintenance/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import MaintenanceClientConfiguration
from ._configuration import MaintenanceManagementClientConfiguration
from .operations import PublicMaintenanceConfigurationsOperations
from .operations import ApplyUpdatesOperations
from .operations import ConfigurationAssignmentsOperations
from .operations import MaintenanceConfigurationsOperations
from .operations import MaintenanceConfigurationsForResourceGroupOperations
from .operations import ApplyUpdateForResourceGroupOperations
from .operations import ConfigurationAssignmentsWithinSubscriptionOperations
from .operations import Operations
from .operations import UpdatesOperations
from .. import models


class MaintenanceClient(object):
"""Maintenance Client.
class MaintenanceManagementClient(object):
"""Azure Maintenance Management Client.
:ivar public_maintenance_configurations: PublicMaintenanceConfigurationsOperations operations
:vartype public_maintenance_configurations: azure.mgmt.maintenance.aio.operations.PublicMaintenanceConfigurationsOperations
Expand All @@ -44,8 +43,6 @@ class MaintenanceClient(object):
:vartype maintenance_configurations_for_resource_group: azure.mgmt.maintenance.aio.operations.MaintenanceConfigurationsForResourceGroupOperations
:ivar apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations operations
:vartype apply_update_for_resource_group: azure.mgmt.maintenance.aio.operations.ApplyUpdateForResourceGroupOperations
:ivar configuration_assignments_within_subscription: ConfigurationAssignmentsWithinSubscriptionOperations operations
:vartype configuration_assignments_within_subscription: azure.mgmt.maintenance.aio.operations.ConfigurationAssignmentsWithinSubscriptionOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.maintenance.aio.operations.Operations
:ivar updates: UpdatesOperations operations
Expand All @@ -66,7 +63,7 @@ def __init__(
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = MaintenanceClientConfiguration(credential, subscription_id, **kwargs)
self._config = MaintenanceManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand All @@ -86,8 +83,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.apply_update_for_resource_group = ApplyUpdateForResourceGroupOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.updates = UpdatesOperations(
Expand All @@ -113,7 +108,7 @@ async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> Async
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "MaintenanceClient":
async def __aenter__(self) -> "MaintenanceManagementClient":
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations
from ._maintenance_configurations_for_resource_group_operations import MaintenanceConfigurationsForResourceGroupOperations
from ._apply_update_for_resource_group_operations import ApplyUpdateForResourceGroupOperations
from ._configuration_assignments_within_subscription_operations import ConfigurationAssignmentsWithinSubscriptionOperations
from ._operations import Operations
from ._updates_operations import UpdatesOperations

Expand All @@ -23,7 +22,6 @@
'MaintenanceConfigurationsOperations',
'MaintenanceConfigurationsForResourceGroupOperations',
'ApplyUpdateForResourceGroupOperations',
'ConfigurationAssignmentsWithinSubscriptionOperations',
'Operations',
'UpdatesOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-04-01-preview"
api_version = "2021-05-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def get_parent(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-04-01-preview"
api_version = "2021-05-01"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -155,7 +155,7 @@ async def get(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-04-01-preview"
api_version = "2021-05-01"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -231,7 +231,7 @@ async def create_or_update_parent(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-04-01-preview"
api_version = "2021-05-01"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -302,7 +302,7 @@ async def create_or_update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-04-01-preview"
api_version = "2021-05-01"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -359,7 +359,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-04-01-preview"
api_version = "2021-05-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down
Loading

0 comments on commit 21ae193

Please sign in to comment.