Skip to content

Commit

Permalink
CodeGen from PR 20680 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2019-03-01 (Azure#20680)

* Add comment to Change state parameters

* fix error

* fix error

* fix

* fix

* fix error

* fix validations

* add example for operation list command

* fix example

* fix example

* fix

* fix

* delete json file

* add origin parameter to operation defenition

* fix

* fix

* fix

* delete unneccesary files

* revert packege-lock.json file changes

* fix comment parameter to be comments

* Delete package-lock.json

* undelete package-lock.json

* fix comments object

* run prettier

* fix

* revert unncessary changes

* LintdiffFix

* run prettier

Co-authored-by: Khaled Abo Asbe <khaboasb@microsoft.com>
  • Loading branch information
SDKAuto and Khaled Abo Asbe committed Sep 26, 2022
1 parent a0c359d commit b408117
Show file tree
Hide file tree
Showing 18 changed files with 433 additions and 3,942 deletions.
6 changes: 3 additions & 3 deletions sdk/alertsmanagement/azure-mgmt-alertsmanagement/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.8.4",
"use": [
"@autorest/python@6.0.1",
"@autorest/python@6.1.6",
"@autorest/modelerfour@4.23.5"
],
"commit": "261132757bc9806f4aa90bd5b176ecfa6a447726",
"commit": "280a5061138fbfa2924f9f989be9f109e39ede4c",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/alertsmanagement/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.0.1 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"autorest_command": "autorest specification/alertsmanagement/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.6 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"readme": "specification/alertsmanagement/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
try:
return self(target_obj, data, content_type=content_type)
except:
_LOGGER.warning(
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
return None
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 = "2.0.0b1"
VERSION = "1.0.0b1"

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
Expand Down Expand Up @@ -71,10 +72,15 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AlertPro
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-08")) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertProcessingRulesList]

error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
Expand Down Expand Up @@ -140,10 +146,15 @@ def list_by_resource_group(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-08")) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertProcessingRulesList]

error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

def prepare_request(next_link=None):
Expand Down Expand Up @@ -209,13 +220,18 @@ async def get_by_name(
:rtype: ~azure.mgmt.alertsmanagement.models.AlertProcessingRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-08")) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertProcessingRule]

request = build_get_by_name_request(
Expand Down Expand Up @@ -335,13 +351,18 @@ async def create_or_update(
:rtype: ~azure.mgmt.alertsmanagement.models.AlertProcessingRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-08")) # type: str
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertProcessingRule]

Expand Down Expand Up @@ -413,13 +434,18 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-08")) # type: str
cls = kwargs.pop("cls", None) # type: ClsType[None]

request = build_delete_request(
Expand Down Expand Up @@ -536,13 +562,18 @@ async def update(
:rtype: ~azure.mgmt.alertsmanagement.models.AlertProcessingRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-08")) # type: str
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertProcessingRule]

Expand Down
Loading

0 comments on commit b408117

Please sign in to comment.