Skip to content

Commit

Permalink
CodeGen from PR 24219 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
update (Azure#24219)
  • Loading branch information
SDKAuto committed May 30, 2023
1 parent e328ef6 commit 2624c3f
Show file tree
Hide file tree
Showing 194 changed files with 4,185 additions and 2,927 deletions.
6 changes: 3 additions & 3 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "817e7cea0b7e3194868825cbef6d4e62a7895951",
"commit": "389d3c2b3256fa48e3d78e07769907857b215536",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.8",
"@autorest/python@6.4.12",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/monitor/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.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/monitor/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/monitor/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def _models_dict(cls, api_version):
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2014-04-01: :mod:`v2014_04_01.models<azure.mgmt.monitor.v2014_04_01.models>`
* 2015-04-01: :mod:`v2015_04_01.models<azure.mgmt.monitor.v2015_04_01.models>`
* 2015-07-01: :mod:`v2015_07_01.models<azure.mgmt.monitor.v2015_07_01.models>`
* 2016-03-01: :mod:`v2016_03_01.models<azure.mgmt.monitor.v2016_03_01.models>`
Expand Down Expand Up @@ -156,7 +157,10 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2023-01-01: :mod:`v2023_01_01.models<azure.mgmt.monitor.v2023_01_01.models>`
* 2023-03-01-preview: :mod:`v2023_03_01_preview.models<azure.mgmt.monitor.v2023_03_01_preview.models>`
"""
if api_version == '2015-04-01':
if api_version == '2014-04-01':
from .v2014_04_01 import models
return models
elif api_version == '2015-04-01':
from .v2015_04_01 import models
return models
elif api_version == '2015-07-01':
Expand Down Expand Up @@ -350,15 +354,12 @@ def alert_rule_incidents(self):
def alert_rules(self):
"""Instance depends on the API version:
* 2015-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_04_01.operations.AlertRulesOperations>`
* 2015-07-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_07_01.operations.AlertRulesOperations>`
* 2014-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2014_04_01.operations.AlertRulesOperations>`
* 2016-03-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2016_03_01.operations.AlertRulesOperations>`
"""
api_version = self._get_api_version('alert_rules')
if api_version == '2015-04-01':
from .v2015_04_01.operations import AlertRulesOperations as OperationClass
elif api_version == '2015-07-01':
from .v2015_07_01.operations import AlertRulesOperations as OperationClass
if api_version == '2014-04-01':
from .v2014_04_01.operations import AlertRulesOperations as OperationClass
elif api_version == '2016-03-01':
from .v2016_03_01.operations import AlertRulesOperations as OperationClass
else:
Expand All @@ -370,12 +371,15 @@ def alert_rules(self):
def autoscale_settings(self):
"""Instance depends on the API version:
* 2014-04-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2014_04_01.operations.AutoscaleSettingsOperations>`
* 2015-04-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2015_04_01.operations.AutoscaleSettingsOperations>`
* 2021-05-01-preview: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.AutoscaleSettingsOperations>`
* 2022-10-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2022_10_01.operations.AutoscaleSettingsOperations>`
"""
api_version = self._get_api_version('autoscale_settings')
if api_version == '2015-04-01':
if api_version == '2014-04-01':
from .v2014_04_01.operations import AutoscaleSettingsOperations as OperationClass
elif api_version == '2015-04-01':
from .v2015_04_01.operations import AutoscaleSettingsOperations as OperationClass
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import AutoscaleSettingsOperations as OperationClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "6.0.1"
VERSION = "0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def _models_dict(cls, api_version):
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2014-04-01: :mod:`v2014_04_01.models<azure.mgmt.monitor.v2014_04_01.models>`
* 2015-04-01: :mod:`v2015_04_01.models<azure.mgmt.monitor.v2015_04_01.models>`
* 2015-07-01: :mod:`v2015_07_01.models<azure.mgmt.monitor.v2015_07_01.models>`
* 2016-03-01: :mod:`v2016_03_01.models<azure.mgmt.monitor.v2016_03_01.models>`
Expand Down Expand Up @@ -156,7 +157,10 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2023-01-01: :mod:`v2023_01_01.models<azure.mgmt.monitor.v2023_01_01.models>`
* 2023-03-01-preview: :mod:`v2023_03_01_preview.models<azure.mgmt.monitor.v2023_03_01_preview.models>`
"""
if api_version == '2015-04-01':
if api_version == '2014-04-01':
from ..v2014_04_01 import models
return models
elif api_version == '2015-04-01':
from ..v2015_04_01 import models
return models
elif api_version == '2015-07-01':
Expand Down Expand Up @@ -350,15 +354,12 @@ def alert_rule_incidents(self):
def alert_rules(self):
"""Instance depends on the API version:
* 2015-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_04_01.aio.operations.AlertRulesOperations>`
* 2015-07-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_07_01.aio.operations.AlertRulesOperations>`
* 2014-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2014_04_01.aio.operations.AlertRulesOperations>`
* 2016-03-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2016_03_01.aio.operations.AlertRulesOperations>`
"""
api_version = self._get_api_version('alert_rules')
if api_version == '2015-04-01':
from ..v2015_04_01.aio.operations import AlertRulesOperations as OperationClass
elif api_version == '2015-07-01':
from ..v2015_07_01.aio.operations import AlertRulesOperations as OperationClass
if api_version == '2014-04-01':
from ..v2014_04_01.aio.operations import AlertRulesOperations as OperationClass
elif api_version == '2016-03-01':
from ..v2016_03_01.aio.operations import AlertRulesOperations as OperationClass
else:
Expand All @@ -370,12 +371,15 @@ def alert_rules(self):
def autoscale_settings(self):
"""Instance depends on the API version:
* 2014-04-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2014_04_01.aio.operations.AutoscaleSettingsOperations>`
* 2015-04-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2015_04_01.aio.operations.AutoscaleSettingsOperations>`
* 2021-05-01-preview: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.aio.operations.AutoscaleSettingsOperations>`
* 2022-10-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2022_10_01.aio.operations.AutoscaleSettingsOperations>`
"""
api_version = self._get_api_version('autoscale_settings')
if api_version == '2015-04-01':
if api_version == '2014-04-01':
from ..v2014_04_01.aio.operations import AutoscaleSettingsOperations as OperationClass
elif api_version == '2015-04-01':
from ..v2015_04_01.aio.operations import AutoscaleSettingsOperations as OperationClass
elif api_version == '2021-05-01-preview':
from ..v2021_05_01_preview.aio.operations import AutoscaleSettingsOperations as OperationClass
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
from ._version import VERSION

__version__ = VERSION

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

__all__ = [
"MonitorManagementClient",
]
__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
@@ -0,0 +1,66 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class MonitorManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for MonitorManagementClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2014-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(MonitorManagementClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2014-04-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-monitor/{}".format(VERSION))
self._configure(**kwargs)

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)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"chosen_version": "2014-04-01",
"total_api_version_list": ["2014-04-01"],
"client": {
"name": "MonitorManagementClient",
"filename": "_monitor_management_client",
"description": "Monitor Management Client.",
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true,
"method_location": "positional"
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true,
"method_location": "positional"
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The ID of the target subscription. Required.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version: Optional[str]=None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles=KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false,
"method_location": "positional"
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false,
"method_location": "positional"
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"alert_rules": "AlertRulesOperations",
"autoscale_settings": "AutoscaleSettingsOperations"
}
}
Loading

0 comments on commit 2624c3f

Please sign in to comment.