Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-alertsmanagement] [DO NOT MERGE] alerts management separating error responses with same name #713

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ class AlertsManagementClient(SDKClient):
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param subscription_id1: The ID of the target subscription.
:type subscription_id1: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, subscription_id1, base_url=None):

self.config = AlertsManagementClientConfiguration(credentials, subscription_id, base_url)
self.config = AlertsManagementClientConfiguration(credentials, subscription_id, subscription_id1, base_url)
super(AlertsManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ class AlertsManagementClientConfiguration(AzureConfiguration):
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param subscription_id1: The ID of the target subscription.
:type subscription_id1: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, subscription_id1, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if subscription_id1 is None:
raise ValueError("Parameter 'subscription_id1' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

Expand All @@ -46,3 +50,4 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.subscription_id1 = subscription_id1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ._models_py3 import AlertProperties
from ._models_py3 import AlertRule
from ._models_py3 import AlertRulePatchObject
from ._models_py3 import AlertsManagementErrorResponse, AlertsManagementErrorResponseException
from ._models_py3 import AlertsMetaData
from ._models_py3 import AlertsMetaDataProperties
from ._models_py3 import AlertsSummary
Expand All @@ -31,8 +32,6 @@
from ._models_py3 import Conditions
from ._models_py3 import Detector
from ._models_py3 import Diagnostics
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import ErrorResponse1, ErrorResponse1Exception
from ._models_py3 import ErrorResponseBody
from ._models_py3 import Essentials
from ._models_py3 import ManagedResource
Expand All @@ -43,6 +42,7 @@
from ._models_py3 import PatchObject
from ._models_py3 import Resource
from ._models_py3 import Scope
from ._models_py3 import SmartDetectorErrorResponse, SmartDetectorErrorResponseException
from ._models_py3 import SmartGroup
from ._models_py3 import SmartGroupAggregatedProperty
from ._models_py3 import SmartGroupModification
Expand All @@ -64,6 +64,7 @@
from ._models import AlertProperties
from ._models import AlertRule
from ._models import AlertRulePatchObject
from ._models import AlertsManagementErrorResponse, AlertsManagementErrorResponseException
from ._models import AlertsMetaData
from ._models import AlertsMetaDataProperties
from ._models import AlertsSummary
Expand All @@ -74,8 +75,6 @@
from ._models import Conditions
from ._models import Detector
from ._models import Diagnostics
from ._models import ErrorResponse, ErrorResponseException
from ._models import ErrorResponse1, ErrorResponse1Exception
from ._models import ErrorResponseBody
from ._models import Essentials
from ._models import ManagedResource
Expand All @@ -86,6 +85,7 @@
from ._models import PatchObject
from ._models import Resource
from ._models import Scope
from ._models import SmartDetectorErrorResponse, SmartDetectorErrorResponseException
from ._models import SmartGroup
from ._models import SmartGroupAggregatedProperty
from ._models import SmartGroupModification
Expand Down Expand Up @@ -132,6 +132,7 @@
'AlertProperties',
'AlertRule',
'AlertRulePatchObject',
'AlertsManagementErrorResponse', 'AlertsManagementErrorResponseException',
'AlertsMetaData',
'AlertsMetaDataProperties',
'AlertsSummary',
Expand All @@ -142,8 +143,6 @@
'Conditions',
'Detector',
'Diagnostics',
'ErrorResponse', 'ErrorResponseException',
'ErrorResponse1', 'ErrorResponse1Exception',
'ErrorResponseBody',
'Essentials',
'ManagedResource',
Expand All @@ -154,6 +153,7 @@
'PatchObject',
'Resource',
'Scope',
'SmartDetectorErrorResponse', 'SmartDetectorErrorResponseException',
'SmartGroup',
'SmartGroupAggregatedProperty',
'SmartGroupModification',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,34 @@ def __init__(self, **kwargs):
self.throttling = kwargs.get('throttling', None)


class AlertsManagementErrorResponse(Model):
"""An error response from the service.

:param error:
:type error: ~azure.mgmt.alertsmanagement.models.ErrorResponseBody
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
}

def __init__(self, **kwargs):
super(AlertsManagementErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


class AlertsManagementErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'AlertsManagementErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(AlertsManagementErrorResponseException, self).__init__(deserialize, response, 'AlertsManagementErrorResponse', *args)


class AlertsMetaData(Model):
"""alert meta data information.

Expand Down Expand Up @@ -965,66 +993,6 @@ def __init__(self, **kwargs):
self.type = 'Diagnostics'


class ErrorResponse(Model):
"""An error response from the service.

:param error:
:type error: ~azure.mgmt.alertsmanagement.models.ErrorResponseBody
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
}

def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)


class ErrorResponse1(Model):
"""Describe the format of an Error response.

:param code: Error code
:type code: str
:param message: Error message indicating why the operation failed.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ErrorResponse1, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)


class ErrorResponse1Exception(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse1'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponse1Exception, self).__init__(deserialize, response, 'ErrorResponse1', *args)


class ErrorResponseBody(Model):
"""Details of error response.

Expand Down Expand Up @@ -1324,6 +1292,38 @@ def __init__(self, **kwargs):
self.values = kwargs.get('values', None)


class SmartDetectorErrorResponse(Model):
"""Describe the format of an Error response.

:param code: Error code
:type code: str
:param message: Error message indicating why the operation failed.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(SmartDetectorErrorResponse, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)


class SmartDetectorErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'SmartDetectorErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(SmartDetectorErrorResponseException, self).__init__(deserialize, response, 'SmartDetectorErrorResponse', *args)


class SmartGroup(Resource):
"""Set of related alerts grouped together smartly by AMS.

Expand Down
Loading