Skip to content
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
4 changes: 2 additions & 2 deletions sdk/authorization/azure-mgmt-authorization/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "d37b3db5ec88a9fc2afcae36bf8d2004b1c5b537",
"commit": "160d46bc2f5d07fd641ffc910dd758696de930f4",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/authorization/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/authorization/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/authorization/resource-manager/readme.md"
}
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
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 = "3.1.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._alert_operation_operations import build_get_request, build_list_for_scope_request
from ...operations._alert_operation_operations import build_get_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
Expand Down Expand Up @@ -113,59 +113,3 @@ async def get(self, scope: str, operation_id: str, **kwargs: Any) -> _models.Ale
return deserialized

get.metadata = {"url": "/{scope}/providers/Microsoft.Authorization/roleManagementAlertOperations/{operationId}"}

@distributed_trace_async
async def list_for_scope(self, scope: str, **kwargs: Any) -> _models.AlertOperationListResult:
"""Gets alert operations for a resource scope.

:param scope: The scope of the alert operation. Required.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertOperationListResult or the result of cls(response)
:rtype: ~azure.mgmt.authorization.v2021_12_01_preview.models.AlertOperationListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
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: Literal["2022-08-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-08-01-preview")
)
cls: ClsType[_models.AlertOperationListResult] = kwargs.pop("cls", None)

request = build_list_for_scope_request(
scope=scope,
api_version=api_version,
template_url=self.list_for_scope.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=False, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = self._deserialize("AlertOperationListResult", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

list_for_scope.metadata = {"url": "/{scope}/providers/Microsoft.Authorization/roleManagementAlertOperations"}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from ._models_py3 import AlertIncidentListResult
from ._models_py3 import AlertIncidentProperties
from ._models_py3 import AlertListResult
from ._models_py3 import AlertOperationListResult
from ._models_py3 import AlertOperationResult
from ._models_py3 import AzureRolesAssignedOutsidePimAlertConfigurationProperties
from ._models_py3 import AzureRolesAssignedOutsidePimAlertIncidentProperties
Expand Down Expand Up @@ -122,7 +121,6 @@
"AlertIncidentListResult",
"AlertIncidentProperties",
"AlertListResult",
"AlertOperationListResult",
"AlertOperationResult",
"AzureRolesAssignedOutsidePimAlertConfigurationProperties",
"AzureRolesAssignedOutsidePimAlertIncidentProperties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3190,39 +3190,6 @@ def __init__(
self.next_link = next_link


class AlertOperationListResult(_serialization.Model):
"""Alert operation list operation result.

:ivar value: Alert operation list.
:vartype value: list[~azure.mgmt.authorization.v2021_12_01_preview.models.AlertOperationResult]
:ivar next_link: The URL to use for getting the next set of results.
:vartype next_link: str
"""

_attribute_map = {
"value": {"key": "value", "type": "[AlertOperationResult]"},
"next_link": {"key": "nextLink", "type": "str"},
}

def __init__(
self,
*,
value: Optional[List["_models.AlertOperationResult"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: Alert operation list.
:paramtype value:
list[~azure.mgmt.authorization.v2021_12_01_preview.models.AlertOperationResult]
:keyword next_link: The URL to use for getting the next set of results.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link


class AlertOperationResult(_serialization.Model):
"""Alert operation result.

Expand All @@ -3232,23 +3199,43 @@ class AlertOperationResult(_serialization.Model):
:vartype id: str
:ivar status: The status of the alert operation.
:vartype status: str
:ivar status_detail: The status detail of the alert operation.
:vartype status_detail: str
:ivar created_date_time: The created date of the alert operation.
:vartype created_date_time: ~datetime.datetime
:ivar last_action_date_time: The last action date of the alert operation.
:vartype last_action_date_time: ~datetime.datetime
:ivar resource_location: The location of the alert associated with the operation.
:vartype resource_location: str
"""

_validation = {
"id": {"readonly": True},
"status": {"readonly": True},
"status_detail": {"readonly": True},
"created_date_time": {"readonly": True},
"last_action_date_time": {"readonly": True},
"resource_location": {"readonly": True},
}

_attribute_map = {
"id": {"key": "id", "type": "str"},
"status": {"key": "status", "type": "str"},
"status_detail": {"key": "statusDetail", "type": "str"},
"created_date_time": {"key": "createdDateTime", "type": "iso-8601"},
"last_action_date_time": {"key": "lastActionDateTime", "type": "iso-8601"},
"resource_location": {"key": "resourceLocation", "type": "str"},
}

def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.id = None
self.status = None
self.status_detail = None
self.created_date_time = None
self.last_action_date_time = None
self.resource_location = None


class AzureRolesAssignedOutsidePimAlertConfigurationProperties(AlertConfigurationProperties):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,6 @@ def build_get_request(scope: str, operation_id: str, **kwargs: Any) -> HttpReque
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)


def build_list_for_scope_request(scope: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2022-08-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-08-01-preview")
)
accept = _headers.pop("Accept", "application/json")

# Construct URL
_url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Authorization/roleManagementAlertOperations")
path_format_arguments = {
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}

_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore

# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")

# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)


class AlertOperationOperations:
"""
.. warning::
Expand Down Expand Up @@ -171,59 +145,3 @@ def get(self, scope: str, operation_id: str, **kwargs: Any) -> _models.AlertOper
return deserialized

get.metadata = {"url": "/{scope}/providers/Microsoft.Authorization/roleManagementAlertOperations/{operationId}"}

@distributed_trace
def list_for_scope(self, scope: str, **kwargs: Any) -> _models.AlertOperationListResult:
"""Gets alert operations for a resource scope.

:param scope: The scope of the alert operation. Required.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertOperationListResult or the result of cls(response)
:rtype: ~azure.mgmt.authorization.v2021_12_01_preview.models.AlertOperationListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
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: Literal["2022-08-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2022-08-01-preview")
)
cls: ClsType[_models.AlertOperationListResult] = kwargs.pop("cls", None)

request = build_list_for_scope_request(
scope=scope,
api_version=api_version,
template_url=self.list_for_scope.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
request, stream=False, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = self._deserialize("AlertOperationListResult", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

list_for_scope.metadata = {"url": "/{scope}/providers/Microsoft.Authorization/roleManagementAlertOperations"}
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 = "3.1.0b1"
VERSION = "1.0.0b1"