diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/__init__.py new file mode 100644 index 000000000000..e8714b719dfc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import AuthorizationManagementClientConfiguration +from ._authorization_management_client import AuthorizationManagementClient +__all__ = ['AuthorizationManagementClient', 'AuthorizationManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_authorization_management_client.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_authorization_management_client.py new file mode 100644 index 000000000000..5be11b05b4c3 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_authorization_management_client.py @@ -0,0 +1,89 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import AuthorizationManagementClientConfiguration +from .operations import Operations +from .operations import AccessReviewScheduleDefinitionsOperations +from .operations import AccessReviewInstancesOperations +from .operations import AccessReviewInstanceOperations +from .operations import AccessReviewInstanceDecisionsOperations +from .operations import AccessReviewDefaultSettingsOperations +from .operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations +from .operations import AccessReviewInstancesAssignedForMyApprovalOperations +from .operations import AccessReviewInstanceMyDecisionsOperations +from . import models + + +class AuthorizationManagementClient(SDKClient): + """Access reviews service provides the workflow for running access reviews on different kind of resources. + + :ivar config: Configuration for client. + :vartype config: AuthorizationManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.authorization.v2018_05_01_preview.operations.Operations + :ivar access_review_schedule_definitions: AccessReviewScheduleDefinitions operations + :vartype access_review_schedule_definitions: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewScheduleDefinitionsOperations + :ivar access_review_instances: AccessReviewInstances operations + :vartype access_review_instances: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstancesOperations + :ivar access_review_instance: AccessReviewInstance operations + :vartype access_review_instance: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceOperations + :ivar access_review_instance_decisions: AccessReviewInstanceDecisions operations + :vartype access_review_instance_decisions: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceDecisionsOperations + :ivar access_review_default_settings: AccessReviewDefaultSettings operations + :vartype access_review_default_settings: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewDefaultSettingsOperations + :ivar access_review_schedule_definitions_assigned_for_my_approval: AccessReviewScheduleDefinitionsAssignedForMyApproval operations + :vartype access_review_schedule_definitions_assigned_for_my_approval: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations + :ivar access_review_instances_assigned_for_my_approval: AccessReviewInstancesAssignedForMyApproval operations + :vartype access_review_instances_assigned_for_my_approval: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstancesAssignedForMyApprovalOperations + :ivar access_review_instance_my_decisions: AccessReviewInstanceMyDecisions operations + :vartype access_review_instance_my_decisions: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceMyDecisionsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, base_url) + super(AuthorizationManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-05-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_schedule_definitions = AccessReviewScheduleDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_instances = AccessReviewInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_instance = AccessReviewInstanceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_instance_decisions = AccessReviewInstanceDecisionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_default_settings = AccessReviewDefaultSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_schedule_definitions_assigned_for_my_approval = AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_instances_assigned_for_my_approval = AccessReviewInstancesAssignedForMyApprovalOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_review_instance_my_decisions = AccessReviewInstanceMyDecisionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_configuration.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_configuration.py new file mode 100644 index 000000000000..c192b8088f15 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class AuthorizationManagementClientConfiguration(AzureConfiguration): + """Configuration for AuthorizationManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(AuthorizationManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-authorization/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/__init__.py new file mode 100644 index 000000000000..ca65be97a222 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/__init__.py @@ -0,0 +1,95 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessReviewDecision + from ._models_py3 import AccessReviewDecisionProperties + from ._models_py3 import AccessReviewDecisionTarget + from ._models_py3 import AccessReviewDefaultSettings + from ._models_py3 import AccessReviewInstance + from ._models_py3 import AccessReviewReviewer + from ._models_py3 import AccessReviewScheduleDefinition + from ._models_py3 import AccessReviewScheduleDefinitionProperties + from ._models_py3 import AccessReviewScheduleSettings + from ._models_py3 import ErrorDefinition, ErrorDefinitionException + from ._models_py3 import ErrorDefinitionProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ServicePrincipalDecisionTarget + from ._models_py3 import UserDecisionTarget +except (SyntaxError, ImportError): + from ._models import AccessReviewDecision + from ._models import AccessReviewDecisionProperties + from ._models import AccessReviewDecisionTarget + from ._models import AccessReviewDefaultSettings + from ._models import AccessReviewInstance + from ._models import AccessReviewReviewer + from ._models import AccessReviewScheduleDefinition + from ._models import AccessReviewScheduleDefinitionProperties + from ._models import AccessReviewScheduleSettings + from ._models import ErrorDefinition, ErrorDefinitionException + from ._models import ErrorDefinitionProperties + from ._models import Operation + from ._models import OperationDisplay + from ._models import ServicePrincipalDecisionTarget + from ._models import UserDecisionTarget +from ._paged_models import AccessReviewDecisionPaged +from ._paged_models import AccessReviewInstancePaged +from ._paged_models import AccessReviewScheduleDefinitionPaged +from ._paged_models import OperationPaged +from ._authorization_management_client_enums import ( + AccessReviewScheduleDefinitionStatus, + AccessReviewActorIdentityType, + DefaultDecisionType, + AccessReviewRecurrencePatternType, + AccessReviewRecurrenceRangeType, + AccessReviewScopePrincipalType, + AccessReviewReviewerType, + AccessReviewScheduleDefinitionReviewersType, + AccessReviewInstanceStatus, + AccessRecommendationType, + AccessReviewResult, + AccessReviewApplyResult, +) + +__all__ = [ + 'AccessReviewDecision', + 'AccessReviewDecisionProperties', + 'AccessReviewDecisionTarget', + 'AccessReviewDefaultSettings', + 'AccessReviewInstance', + 'AccessReviewReviewer', + 'AccessReviewScheduleDefinition', + 'AccessReviewScheduleDefinitionProperties', + 'AccessReviewScheduleSettings', + 'ErrorDefinition', 'ErrorDefinitionException', + 'ErrorDefinitionProperties', + 'Operation', + 'OperationDisplay', + 'ServicePrincipalDecisionTarget', + 'UserDecisionTarget', + 'OperationPaged', + 'AccessReviewScheduleDefinitionPaged', + 'AccessReviewInstancePaged', + 'AccessReviewDecisionPaged', + 'AccessReviewScheduleDefinitionStatus', + 'AccessReviewActorIdentityType', + 'DefaultDecisionType', + 'AccessReviewRecurrencePatternType', + 'AccessReviewRecurrenceRangeType', + 'AccessReviewScopePrincipalType', + 'AccessReviewReviewerType', + 'AccessReviewScheduleDefinitionReviewersType', + 'AccessReviewInstanceStatus', + 'AccessRecommendationType', + 'AccessReviewResult', + 'AccessReviewApplyResult', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_authorization_management_client_enums.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_authorization_management_client_enums.py new file mode 100644 index 000000000000..f5f418ee37b8 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_authorization_management_client_enums.py @@ -0,0 +1,113 @@ +# 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 enum import Enum + + +class AccessReviewScheduleDefinitionStatus(str, Enum): + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + applied = "Applied" + initializing = "Initializing" + applying = "Applying" + completing = "Completing" + scheduled = "Scheduled" + auto_reviewing = "AutoReviewing" + auto_reviewed = "AutoReviewed" + starting = "Starting" + + +class AccessReviewActorIdentityType(str, Enum): + + user = "user" + service_principal = "servicePrincipal" + + +class DefaultDecisionType(str, Enum): + + approve = "Approve" + deny = "Deny" + recommendation = "Recommendation" + + +class AccessReviewRecurrencePatternType(str, Enum): + + weekly = "weekly" + absolute_monthly = "absoluteMonthly" + + +class AccessReviewRecurrenceRangeType(str, Enum): + + end_date = "endDate" + no_end = "noEnd" + numbered = "numbered" + + +class AccessReviewScopePrincipalType(str, Enum): + + user = "user" + service_principal = "servicePrincipal" + + +class AccessReviewReviewerType(str, Enum): + + user = "user" + service_principal = "servicePrincipal" + + +class AccessReviewScheduleDefinitionReviewersType(str, Enum): + + assigned = "Assigned" + self_enum = "Self" + managers = "Managers" + + +class AccessReviewInstanceStatus(str, Enum): + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + applied = "Applied" + initializing = "Initializing" + applying = "Applying" + completing = "Completing" + scheduled = "Scheduled" + auto_reviewing = "AutoReviewing" + auto_reviewed = "AutoReviewed" + starting = "Starting" + + +class AccessRecommendationType(str, Enum): + + approve = "Approve" + deny = "Deny" + no_info_available = "NoInfoAvailable" + + +class AccessReviewResult(str, Enum): + + approve = "Approve" + deny = "Deny" + not_reviewed = "NotReviewed" + dont_know = "DontKnow" + not_notified = "NotNotified" + + +class AccessReviewApplyResult(str, Enum): + + new = "New" + applying = "Applying" + applied_successfully = "AppliedSuccessfully" + applied_with_unknown_failure = "AppliedWithUnknownFailure" + applied_successfully_but_object_not_found = "AppliedSuccessfullyButObjectNotFound" + apply_not_supported = "ApplyNotSupported" diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models.py new file mode 100644 index 000000000000..a1ca401fb100 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models.py @@ -0,0 +1,1095 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AccessReviewDecision(Model): + """Access Review. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review decision id. + :vartype id: str + :ivar name: The access review decision name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessRecommendationType + :param decision: The decision on the approval step. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed', 'DontKnow', + 'NotNotified' + :type decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + :ivar reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :ivar apply_result: The outcome of applying the decision. Possible values + include: 'New', 'Applying', 'AppliedSuccessfully', + 'AppliedWithUnknownFailure', 'AppliedSuccessfullyButObjectNotFound', + 'ApplyNotSupported' + :vartype apply_result: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewApplyResult + :ivar applied_date_time: The date and time when the review decision was + applied. + :vartype applied_date_time: datetime + :ivar principal_id1: The identity id + :vartype principal_id1: str + :ivar principal_type1: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name1: The identity display name + :vartype principal_name1: str + :ivar user_principal_name1: The user principal name(if valid) + :vartype user_principal_name1: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'reviewed_date_time': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'apply_result': {'readonly': True}, + 'applied_date_time': {'readonly': True}, + 'principal_id1': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'principal_name1': {'readonly': True}, + 'user_principal_name1': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'decision': {'key': 'properties.decision', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + 'reviewed_date_time': {'key': 'properties.reviewedDateTime', 'type': 'iso-8601'}, + 'principal_id': {'key': 'properties.reviewedBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.reviewedBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'properties.reviewedBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'properties.reviewedBy.userPrincipalName', 'type': 'str'}, + 'apply_result': {'key': 'properties.applyResult', 'type': 'str'}, + 'applied_date_time': {'key': 'properties.appliedDateTime', 'type': 'iso-8601'}, + 'principal_id1': {'key': 'properties.appliedBy.principalId', 'type': 'str'}, + 'principal_type1': {'key': 'properties.appliedBy.principalType', 'type': 'str'}, + 'principal_name1': {'key': 'properties.appliedBy.principalName', 'type': 'str'}, + 'user_principal_name1': {'key': 'properties.appliedBy.userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDecision, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.recommendation = None + self.decision = kwargs.get('decision', None) + self.justification = kwargs.get('justification', None) + self.reviewed_date_time = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.apply_result = None + self.applied_date_time = None + self.principal_id1 = None + self.principal_type1 = None + self.principal_name1 = None + self.user_principal_name1 = None + + +class AccessReviewDecisionProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessRecommendationType + :param decision: The decision on the approval step. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed', 'DontKnow', + 'NotNotified' + :type decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + :ivar reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :ivar apply_result: The outcome of applying the decision. Possible values + include: 'New', 'Applying', 'AppliedSuccessfully', + 'AppliedWithUnknownFailure', 'AppliedSuccessfullyButObjectNotFound', + 'ApplyNotSupported' + :vartype apply_result: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewApplyResult + :ivar applied_date_time: The date and time when the review decision was + applied. + :vartype applied_date_time: datetime + :ivar principal_id1: The identity id + :vartype principal_id1: str + :ivar principal_type1: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name1: The identity display name + :vartype principal_name1: str + :ivar user_principal_name1: The user principal name(if valid) + :vartype user_principal_name1: str + """ + + _validation = { + 'recommendation': {'readonly': True}, + 'reviewed_date_time': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'apply_result': {'readonly': True}, + 'applied_date_time': {'readonly': True}, + 'principal_id1': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'principal_name1': {'readonly': True}, + 'user_principal_name1': {'readonly': True}, + } + + _attribute_map = { + 'recommendation': {'key': 'recommendation', 'type': 'str'}, + 'decision': {'key': 'decision', 'type': 'str'}, + 'justification': {'key': 'justification', 'type': 'str'}, + 'reviewed_date_time': {'key': 'reviewedDateTime', 'type': 'iso-8601'}, + 'principal_id': {'key': 'reviewedBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'reviewedBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'reviewedBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'reviewedBy.userPrincipalName', 'type': 'str'}, + 'apply_result': {'key': 'applyResult', 'type': 'str'}, + 'applied_date_time': {'key': 'appliedDateTime', 'type': 'iso-8601'}, + 'principal_id1': {'key': 'appliedBy.principalId', 'type': 'str'}, + 'principal_type1': {'key': 'appliedBy.principalType', 'type': 'str'}, + 'principal_name1': {'key': 'appliedBy.principalName', 'type': 'str'}, + 'user_principal_name1': {'key': 'appliedBy.userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionProperties, self).__init__(**kwargs) + self.recommendation = None + self.decision = kwargs.get('decision', None) + self.justification = kwargs.get('justification', None) + self.reviewed_date_time = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.apply_result = None + self.applied_date_time = None + self.principal_id1 = None + self.principal_type1 = None + self.principal_name1 = None + self.user_principal_name1 = None + + +class AccessReviewDecisionTarget(Model): + """Target of the decision. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UserDecisionTarget, ServicePrincipalDecisionTarget + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'user': 'UserDecisionTarget', 'servicePrincipal': 'ServicePrincipalDecisionTarget'} + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionTarget, self).__init__(**kwargs) + self.type = None + + +class AccessReviewDefaultSettings(Model): + """Access Review Default Settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review default settings id. This is only going to be + default + :vartype id: str + :ivar name: The access review default settings name. This is always going + to be Access Review Default Settings + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param type1: The recurrence type : weekly, monthly, etc. Possible values + include: 'weekly', 'absoluteMonthly' + :type type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrencePatternType + :param interval: The interval for recurrence. For a quarterly review, the + interval is 3 for type : absoluteMonthly. + :type interval: int + :param type2: The recurrence range type. The possible values are: endDate, + noEnd, numbered. Possible values include: 'endDate', 'noEnd', 'numbered' + :type type2: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceRangeType + :param number_of_occurrences: The number of times to repeat the access + review. Required and must be positive if type is numbered. + :type number_of_occurrences: int + :param start_date: The DateTime when the review is scheduled to be start. + This could be a date in the future. Required on create. + :type start_date: datetime + :param end_date: The DateTime when the review is scheduled to end. + Required if type is endDate + :type end_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mail_notifications_enabled': {'key': 'properties.mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'properties.reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'properties.defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'properties.justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'properties.defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'properties.autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'properties.recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'properties.instanceDurationInDays', 'type': 'int'}, + 'type1': {'key': 'properties.recurrence.pattern.type', 'type': 'str'}, + 'interval': {'key': 'properties.recurrence.pattern.interval', 'type': 'int'}, + 'type2': {'key': 'properties.recurrence.range.type', 'type': 'str'}, + 'number_of_occurrences': {'key': 'properties.recurrence.range.numberOfOccurrences', 'type': 'int'}, + 'start_date': {'key': 'properties.recurrence.range.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.recurrence.range.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDefaultSettings, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.mail_notifications_enabled = kwargs.get('mail_notifications_enabled', None) + self.reminder_notifications_enabled = kwargs.get('reminder_notifications_enabled', None) + self.default_decision_enabled = kwargs.get('default_decision_enabled', None) + self.justification_required_on_approval = kwargs.get('justification_required_on_approval', None) + self.default_decision = kwargs.get('default_decision', None) + self.auto_apply_decisions_enabled = kwargs.get('auto_apply_decisions_enabled', None) + self.recommendations_enabled = kwargs.get('recommendations_enabled', None) + self.instance_duration_in_days = kwargs.get('instance_duration_in_days', None) + self.type1 = kwargs.get('type1', None) + self.interval = kwargs.get('interval', None) + self.type2 = kwargs.get('type2', None) + self.number_of_occurrences = kwargs.get('number_of_occurrences', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + + +class AccessReviewInstance(Model): + """Access Review Instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review instance id. + :vartype id: str + :ivar name: The access review instance name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar status: This read-only field specifies the status of an access + review instance. Possible values include: 'NotStarted', 'InProgress', + 'Completed', 'Applied', 'Initializing', 'Applying', 'Completing', + 'Scheduled', 'AutoReviewing', 'AutoReviewed', 'Starting' + :vartype status: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstanceStatus + :param start_date_time: The DateTime when the review instance is scheduled + to be start. + :type start_date_time: datetime + :param end_date_time: The DateTime when the review instance is scheduled + to end. + :type end_date_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_date_time': {'key': 'properties.startDateTime', 'type': 'iso-8601'}, + 'end_date_time': {'key': 'properties.endDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(AccessReviewInstance, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.status = None + self.start_date_time = kwargs.get('start_date_time', None) + self.end_date_time = kwargs.get('end_date_time', None) + + +class AccessReviewReviewer(Model): + """Descriptor for what needs to be reviewed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param principal_id: The id of the reviewer(user/servicePrincipal) + :type principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewReviewerType + """ + + _validation = { + 'principal_type': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'principal_type': {'key': 'principalType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewReviewer, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = None + + +class AccessReviewScheduleDefinition(Model): + """Access Review Schedule Definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review schedule definition id. + :vartype id: str + :ivar name: The access review schedule definition unique id. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param display_name: The display name for the schedule definition. + :type display_name: str + :ivar status: This read-only field specifies the status of an + accessReview. Possible values include: 'NotStarted', 'InProgress', + 'Completed', 'Applied', 'Initializing', 'Applying', 'Completing', + 'Scheduled', 'AutoReviewing', 'AutoReviewed', 'Starting' + :vartype status: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionStatus + :param description_for_admins: The description provided by the access + review creator and visible to admins. + :type description_for_admins: str + :param description_for_reviewers: The description provided by the access + review creator to be shown to reviewers. + :type description_for_reviewers: str + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param type1: The recurrence type : weekly, monthly, etc. Possible values + include: 'weekly', 'absoluteMonthly' + :type type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrencePatternType + :param interval: The interval for recurrence. For a quarterly review, the + interval is 3 for type : absoluteMonthly. + :type interval: int + :param type2: The recurrence range type. The possible values are: endDate, + noEnd, numbered. Possible values include: 'endDate', 'noEnd', 'numbered' + :type type2: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceRangeType + :param number_of_occurrences: The number of times to repeat the access + review. Required and must be positive if type is numbered. + :type number_of_occurrences: int + :param start_date: The DateTime when the review is scheduled to be start. + This could be a date in the future. Required on create. + :type start_date: datetime + :param end_date: The DateTime when the review is scheduled to end. + Required if type is endDate + :type end_date: datetime + :ivar resource_id: ResourceId in which this review is getting created + :vartype resource_id: str + :ivar role_definition_id: This is used to indicate the role being reviewed + :vartype role_definition_id: str + :ivar principal_type1: The identity type user/servicePrincipal to review. + Possible values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScopePrincipalType + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewReviewer] + :ivar reviewers_type: This field specifies the type of reviewers for a + review. Usually for a review, reviewers are explicitly assigned. However, + in some cases, the reviewers may not be assigned and instead be chosen + dynamically. For example managers review or self review. Possible values + include: 'Assigned', 'Self', 'Managers' + :vartype reviewers_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionReviewersType + :param instances: This is the collection of instances returned when one + does an expand on it. + :type instances: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'role_definition_id': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'reviewers_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'description_for_admins': {'key': 'properties.descriptionForAdmins', 'type': 'str'}, + 'description_for_reviewers': {'key': 'properties.descriptionForReviewers', 'type': 'str'}, + 'principal_id': {'key': 'properties.createdBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.createdBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'properties.createdBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'properties.createdBy.userPrincipalName', 'type': 'str'}, + 'mail_notifications_enabled': {'key': 'properties.settings.mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'properties.settings.reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'properties.settings.defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'properties.settings.justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'properties.settings.defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'properties.settings.autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'properties.settings.recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'properties.settings.instanceDurationInDays', 'type': 'int'}, + 'type1': {'key': 'properties.settings.recurrence.pattern.type', 'type': 'str'}, + 'interval': {'key': 'properties.settings.recurrence.pattern.interval', 'type': 'int'}, + 'type2': {'key': 'properties.settings.recurrence.range.type', 'type': 'str'}, + 'number_of_occurrences': {'key': 'properties.settings.recurrence.range.numberOfOccurrences', 'type': 'int'}, + 'start_date': {'key': 'properties.settings.recurrence.range.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.settings.recurrence.range.endDate', 'type': 'iso-8601'}, + 'resource_id': {'key': 'properties.scope.resourceId', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.scope.roleDefinitionId', 'type': 'str'}, + 'principal_type1': {'key': 'properties.scope.principalType', 'type': 'str'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'properties.reviewersType', 'type': 'str'}, + 'instances': {'key': 'properties.instances', 'type': '[AccessReviewInstance]'}, + } + + def __init__(self, **kwargs): + super(AccessReviewScheduleDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.display_name = kwargs.get('display_name', None) + self.status = None + self.description_for_admins = kwargs.get('description_for_admins', None) + self.description_for_reviewers = kwargs.get('description_for_reviewers', None) + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.mail_notifications_enabled = kwargs.get('mail_notifications_enabled', None) + self.reminder_notifications_enabled = kwargs.get('reminder_notifications_enabled', None) + self.default_decision_enabled = kwargs.get('default_decision_enabled', None) + self.justification_required_on_approval = kwargs.get('justification_required_on_approval', None) + self.default_decision = kwargs.get('default_decision', None) + self.auto_apply_decisions_enabled = kwargs.get('auto_apply_decisions_enabled', None) + self.recommendations_enabled = kwargs.get('recommendations_enabled', None) + self.instance_duration_in_days = kwargs.get('instance_duration_in_days', None) + self.type1 = kwargs.get('type1', None) + self.interval = kwargs.get('interval', None) + self.type2 = kwargs.get('type2', None) + self.number_of_occurrences = kwargs.get('number_of_occurrences', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.resource_id = None + self.role_definition_id = None + self.principal_type1 = None + self.reviewers = kwargs.get('reviewers', None) + self.reviewers_type = None + self.instances = kwargs.get('instances', None) + + +class AccessReviewScheduleDefinitionProperties(Model): + """Access Review. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: The display name for the schedule definition. + :type display_name: str + :ivar status: This read-only field specifies the status of an + accessReview. Possible values include: 'NotStarted', 'InProgress', + 'Completed', 'Applied', 'Initializing', 'Applying', 'Completing', + 'Scheduled', 'AutoReviewing', 'AutoReviewed', 'Starting' + :vartype status: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionStatus + :param description_for_admins: The description provided by the access + review creator and visible to admins. + :type description_for_admins: str + :param description_for_reviewers: The description provided by the access + review creator to be shown to reviewers. + :type description_for_reviewers: str + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param type: The recurrence type : weekly, monthly, etc. Possible values + include: 'weekly', 'absoluteMonthly' + :type type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrencePatternType + :param interval: The interval for recurrence. For a quarterly review, the + interval is 3 for type : absoluteMonthly. + :type interval: int + :param type1: The recurrence range type. The possible values are: endDate, + noEnd, numbered. Possible values include: 'endDate', 'noEnd', 'numbered' + :type type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceRangeType + :param number_of_occurrences: The number of times to repeat the access + review. Required and must be positive if type is numbered. + :type number_of_occurrences: int + :param start_date: The DateTime when the review is scheduled to be start. + This could be a date in the future. Required on create. + :type start_date: datetime + :param end_date: The DateTime when the review is scheduled to end. + Required if type is endDate + :type end_date: datetime + :ivar resource_id: ResourceId in which this review is getting created + :vartype resource_id: str + :ivar role_definition_id: This is used to indicate the role being reviewed + :vartype role_definition_id: str + :ivar principal_type1: The identity type user/servicePrincipal to review. + Possible values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScopePrincipalType + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewReviewer] + :ivar reviewers_type: This field specifies the type of reviewers for a + review. Usually for a review, reviewers are explicitly assigned. However, + in some cases, the reviewers may not be assigned and instead be chosen + dynamically. For example managers review or self review. Possible values + include: 'Assigned', 'Self', 'Managers' + :vartype reviewers_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionReviewersType + :param instances: This is the collection of instances returned when one + does an expand on it. + :type instances: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance] + """ + + _validation = { + 'status': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'role_definition_id': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'reviewers_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description_for_admins': {'key': 'descriptionForAdmins', 'type': 'str'}, + 'description_for_reviewers': {'key': 'descriptionForReviewers', 'type': 'str'}, + 'principal_id': {'key': 'createdBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'createdBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'createdBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'createdBy.userPrincipalName', 'type': 'str'}, + 'mail_notifications_enabled': {'key': 'settings.mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'settings.reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'settings.defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'settings.justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'settings.defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'settings.autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'settings.recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'settings.instanceDurationInDays', 'type': 'int'}, + 'type': {'key': 'settings.recurrence.pattern.type', 'type': 'str'}, + 'interval': {'key': 'settings.recurrence.pattern.interval', 'type': 'int'}, + 'type1': {'key': 'settings.recurrence.range.type', 'type': 'str'}, + 'number_of_occurrences': {'key': 'settings.recurrence.range.numberOfOccurrences', 'type': 'int'}, + 'start_date': {'key': 'settings.recurrence.range.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'settings.recurrence.range.endDate', 'type': 'iso-8601'}, + 'resource_id': {'key': 'scope.resourceId', 'type': 'str'}, + 'role_definition_id': {'key': 'scope.roleDefinitionId', 'type': 'str'}, + 'principal_type1': {'key': 'scope.principalType', 'type': 'str'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'reviewersType', 'type': 'str'}, + 'instances': {'key': 'instances', 'type': '[AccessReviewInstance]'}, + } + + def __init__(self, **kwargs): + super(AccessReviewScheduleDefinitionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.status = None + self.description_for_admins = kwargs.get('description_for_admins', None) + self.description_for_reviewers = kwargs.get('description_for_reviewers', None) + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.mail_notifications_enabled = kwargs.get('mail_notifications_enabled', None) + self.reminder_notifications_enabled = kwargs.get('reminder_notifications_enabled', None) + self.default_decision_enabled = kwargs.get('default_decision_enabled', None) + self.justification_required_on_approval = kwargs.get('justification_required_on_approval', None) + self.default_decision = kwargs.get('default_decision', None) + self.auto_apply_decisions_enabled = kwargs.get('auto_apply_decisions_enabled', None) + self.recommendations_enabled = kwargs.get('recommendations_enabled', None) + self.instance_duration_in_days = kwargs.get('instance_duration_in_days', None) + self.type = kwargs.get('type', None) + self.interval = kwargs.get('interval', None) + self.type1 = kwargs.get('type1', None) + self.number_of_occurrences = kwargs.get('number_of_occurrences', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.resource_id = None + self.role_definition_id = None + self.principal_type1 = None + self.reviewers = kwargs.get('reviewers', None) + self.reviewers_type = None + self.instances = kwargs.get('instances', None) + + +class AccessReviewScheduleSettings(Model): + """Settings of an Access Review. + + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param recurrence: Access Review Settings. + :type recurrence: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceSettings + """ + + _attribute_map = { + 'mail_notifications_enabled': {'key': 'mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'instanceDurationInDays', 'type': 'int'}, + 'recurrence': {'key': 'recurrence', 'type': 'AccessReviewRecurrenceSettings'}, + } + + def __init__(self, **kwargs): + super(AccessReviewScheduleSettings, self).__init__(**kwargs) + self.mail_notifications_enabled = kwargs.get('mail_notifications_enabled', None) + self.reminder_notifications_enabled = kwargs.get('reminder_notifications_enabled', None) + self.default_decision_enabled = kwargs.get('default_decision_enabled', None) + self.justification_required_on_approval = kwargs.get('justification_required_on_approval', None) + self.default_decision = kwargs.get('default_decision', None) + self.auto_apply_decisions_enabled = kwargs.get('auto_apply_decisions_enabled', None) + self.recommendations_enabled = kwargs.get('recommendations_enabled', None) + self.instance_duration_in_days = kwargs.get('instance_duration_in_days', None) + self.recurrence = kwargs.get('recurrence', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDefinition(Model): + """Error. + + Error description and code explaining why an operation failed. + + :param error: Error of the list gateway status. + :type error: + ~azure.mgmt.authorization.v2018_05_01_preview.models.ErrorDefinitionProperties + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinitionProperties'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorDefinitionException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDefinition'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDefinitionException, self).__init__(deserialize, response, 'ErrorDefinition', *args) + + +class ErrorDefinitionProperties(Model): + """Error. + + Error description and code explaining why an operation failed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: Description of the error. + :vartype message: str + :param code: Error code of list gateway. + :type code: str + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinitionProperties, self).__init__(**kwargs) + self.message = None + self.code = kwargs.get('code', None) + + +class Operation(Model): + """The definition of a Microsoft.Authorization operation. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: + ~azure.mgmt.authorization.v2018_05_01_preview.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + + +class OperationDisplay(Model): + """The display information for a Microsoft.Authorization operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The resource provider name: Microsoft.Authorization. + :vartype provider: str + :ivar resource: The resource on which the operation is performed. + :vartype resource: str + :ivar operation: The operation that users can perform. + :vartype operation: str + :ivar description: The description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class ServicePrincipalDecisionTarget(AccessReviewDecisionTarget): + """Service Principal Decision Target. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :ivar principal_id: The id of service principal whose access is reviewed. + :vartype principal_id: str + :ivar principal_name: The display name of the service principal whose + access was reviewed. + :vartype principal_name: str + :ivar app_id: The appId for the service principal entity being reviewed + :vartype app_id: str + """ + + _validation = { + 'type': {'required': True}, + 'principal_id': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'app_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServicePrincipalDecisionTarget, self).__init__(**kwargs) + self.principal_id = None + self.principal_name = None + self.app_id = None + self.type = 'servicePrincipal' + + +class UserDecisionTarget(AccessReviewDecisionTarget): + """User Decision Target. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :ivar principal_id: The id of user whose access was reviewed. + :vartype principal_id: str + :ivar principal_name: The display name of the user whose access was + reviewed. + :vartype principal_name: str + :ivar user_principal_name: The user principal name of the user whose + access was reviewed. + :vartype user_principal_name: str + """ + + _validation = { + 'type': {'required': True}, + 'principal_id': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserDecisionTarget, self).__init__(**kwargs) + self.principal_id = None + self.principal_name = None + self.user_principal_name = None + self.type = 'user' diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..ddf2d9365d2f --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models_py3.py @@ -0,0 +1,1095 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AccessReviewDecision(Model): + """Access Review. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review decision id. + :vartype id: str + :ivar name: The access review decision name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessRecommendationType + :param decision: The decision on the approval step. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed', 'DontKnow', + 'NotNotified' + :type decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + :ivar reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :ivar apply_result: The outcome of applying the decision. Possible values + include: 'New', 'Applying', 'AppliedSuccessfully', + 'AppliedWithUnknownFailure', 'AppliedSuccessfullyButObjectNotFound', + 'ApplyNotSupported' + :vartype apply_result: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewApplyResult + :ivar applied_date_time: The date and time when the review decision was + applied. + :vartype applied_date_time: datetime + :ivar principal_id1: The identity id + :vartype principal_id1: str + :ivar principal_type1: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name1: The identity display name + :vartype principal_name1: str + :ivar user_principal_name1: The user principal name(if valid) + :vartype user_principal_name1: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'recommendation': {'readonly': True}, + 'reviewed_date_time': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'apply_result': {'readonly': True}, + 'applied_date_time': {'readonly': True}, + 'principal_id1': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'principal_name1': {'readonly': True}, + 'user_principal_name1': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation': {'key': 'properties.recommendation', 'type': 'str'}, + 'decision': {'key': 'properties.decision', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + 'reviewed_date_time': {'key': 'properties.reviewedDateTime', 'type': 'iso-8601'}, + 'principal_id': {'key': 'properties.reviewedBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.reviewedBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'properties.reviewedBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'properties.reviewedBy.userPrincipalName', 'type': 'str'}, + 'apply_result': {'key': 'properties.applyResult', 'type': 'str'}, + 'applied_date_time': {'key': 'properties.appliedDateTime', 'type': 'iso-8601'}, + 'principal_id1': {'key': 'properties.appliedBy.principalId', 'type': 'str'}, + 'principal_type1': {'key': 'properties.appliedBy.principalType', 'type': 'str'}, + 'principal_name1': {'key': 'properties.appliedBy.principalName', 'type': 'str'}, + 'user_principal_name1': {'key': 'properties.appliedBy.userPrincipalName', 'type': 'str'}, + } + + def __init__(self, *, decision=None, justification: str=None, **kwargs) -> None: + super(AccessReviewDecision, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.recommendation = None + self.decision = decision + self.justification = justification + self.reviewed_date_time = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.apply_result = None + self.applied_date_time = None + self.principal_id1 = None + self.principal_type1 = None + self.principal_name1 = None + self.user_principal_name1 = None + + +class AccessReviewDecisionProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessRecommendationType + :param decision: The decision on the approval step. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed', 'DontKnow', + 'NotNotified' + :type decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + :ivar reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :ivar apply_result: The outcome of applying the decision. Possible values + include: 'New', 'Applying', 'AppliedSuccessfully', + 'AppliedWithUnknownFailure', 'AppliedSuccessfullyButObjectNotFound', + 'ApplyNotSupported' + :vartype apply_result: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewApplyResult + :ivar applied_date_time: The date and time when the review decision was + applied. + :vartype applied_date_time: datetime + :ivar principal_id1: The identity id + :vartype principal_id1: str + :ivar principal_type1: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name1: The identity display name + :vartype principal_name1: str + :ivar user_principal_name1: The user principal name(if valid) + :vartype user_principal_name1: str + """ + + _validation = { + 'recommendation': {'readonly': True}, + 'reviewed_date_time': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'apply_result': {'readonly': True}, + 'applied_date_time': {'readonly': True}, + 'principal_id1': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'principal_name1': {'readonly': True}, + 'user_principal_name1': {'readonly': True}, + } + + _attribute_map = { + 'recommendation': {'key': 'recommendation', 'type': 'str'}, + 'decision': {'key': 'decision', 'type': 'str'}, + 'justification': {'key': 'justification', 'type': 'str'}, + 'reviewed_date_time': {'key': 'reviewedDateTime', 'type': 'iso-8601'}, + 'principal_id': {'key': 'reviewedBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'reviewedBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'reviewedBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'reviewedBy.userPrincipalName', 'type': 'str'}, + 'apply_result': {'key': 'applyResult', 'type': 'str'}, + 'applied_date_time': {'key': 'appliedDateTime', 'type': 'iso-8601'}, + 'principal_id1': {'key': 'appliedBy.principalId', 'type': 'str'}, + 'principal_type1': {'key': 'appliedBy.principalType', 'type': 'str'}, + 'principal_name1': {'key': 'appliedBy.principalName', 'type': 'str'}, + 'user_principal_name1': {'key': 'appliedBy.userPrincipalName', 'type': 'str'}, + } + + def __init__(self, *, decision=None, justification: str=None, **kwargs) -> None: + super(AccessReviewDecisionProperties, self).__init__(**kwargs) + self.recommendation = None + self.decision = decision + self.justification = justification + self.reviewed_date_time = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.apply_result = None + self.applied_date_time = None + self.principal_id1 = None + self.principal_type1 = None + self.principal_name1 = None + self.user_principal_name1 = None + + +class AccessReviewDecisionTarget(Model): + """Target of the decision. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UserDecisionTarget, ServicePrincipalDecisionTarget + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'user': 'UserDecisionTarget', 'servicePrincipal': 'ServicePrincipalDecisionTarget'} + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionTarget, self).__init__(**kwargs) + self.type = None + + +class AccessReviewDefaultSettings(Model): + """Access Review Default Settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review default settings id. This is only going to be + default + :vartype id: str + :ivar name: The access review default settings name. This is always going + to be Access Review Default Settings + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param type1: The recurrence type : weekly, monthly, etc. Possible values + include: 'weekly', 'absoluteMonthly' + :type type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrencePatternType + :param interval: The interval for recurrence. For a quarterly review, the + interval is 3 for type : absoluteMonthly. + :type interval: int + :param type2: The recurrence range type. The possible values are: endDate, + noEnd, numbered. Possible values include: 'endDate', 'noEnd', 'numbered' + :type type2: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceRangeType + :param number_of_occurrences: The number of times to repeat the access + review. Required and must be positive if type is numbered. + :type number_of_occurrences: int + :param start_date: The DateTime when the review is scheduled to be start. + This could be a date in the future. Required on create. + :type start_date: datetime + :param end_date: The DateTime when the review is scheduled to end. + Required if type is endDate + :type end_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mail_notifications_enabled': {'key': 'properties.mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'properties.reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'properties.defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'properties.justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'properties.defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'properties.autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'properties.recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'properties.instanceDurationInDays', 'type': 'int'}, + 'type1': {'key': 'properties.recurrence.pattern.type', 'type': 'str'}, + 'interval': {'key': 'properties.recurrence.pattern.interval', 'type': 'int'}, + 'type2': {'key': 'properties.recurrence.range.type', 'type': 'str'}, + 'number_of_occurrences': {'key': 'properties.recurrence.range.numberOfOccurrences', 'type': 'int'}, + 'start_date': {'key': 'properties.recurrence.range.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.recurrence.range.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, mail_notifications_enabled: bool=None, reminder_notifications_enabled: bool=None, default_decision_enabled: bool=None, justification_required_on_approval: bool=None, default_decision=None, auto_apply_decisions_enabled: bool=None, recommendations_enabled: bool=None, instance_duration_in_days: int=None, type1=None, interval: int=None, type2=None, number_of_occurrences: int=None, start_date=None, end_date=None, **kwargs) -> None: + super(AccessReviewDefaultSettings, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.mail_notifications_enabled = mail_notifications_enabled + self.reminder_notifications_enabled = reminder_notifications_enabled + self.default_decision_enabled = default_decision_enabled + self.justification_required_on_approval = justification_required_on_approval + self.default_decision = default_decision + self.auto_apply_decisions_enabled = auto_apply_decisions_enabled + self.recommendations_enabled = recommendations_enabled + self.instance_duration_in_days = instance_duration_in_days + self.type1 = type1 + self.interval = interval + self.type2 = type2 + self.number_of_occurrences = number_of_occurrences + self.start_date = start_date + self.end_date = end_date + + +class AccessReviewInstance(Model): + """Access Review Instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review instance id. + :vartype id: str + :ivar name: The access review instance name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar status: This read-only field specifies the status of an access + review instance. Possible values include: 'NotStarted', 'InProgress', + 'Completed', 'Applied', 'Initializing', 'Applying', 'Completing', + 'Scheduled', 'AutoReviewing', 'AutoReviewed', 'Starting' + :vartype status: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstanceStatus + :param start_date_time: The DateTime when the review instance is scheduled + to be start. + :type start_date_time: datetime + :param end_date_time: The DateTime when the review instance is scheduled + to end. + :type end_date_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_date_time': {'key': 'properties.startDateTime', 'type': 'iso-8601'}, + 'end_date_time': {'key': 'properties.endDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, start_date_time=None, end_date_time=None, **kwargs) -> None: + super(AccessReviewInstance, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.status = None + self.start_date_time = start_date_time + self.end_date_time = end_date_time + + +class AccessReviewReviewer(Model): + """Descriptor for what needs to be reviewed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param principal_id: The id of the reviewer(user/servicePrincipal) + :type principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewReviewerType + """ + + _validation = { + 'principal_type': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'principal_type': {'key': 'principalType', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, **kwargs) -> None: + super(AccessReviewReviewer, self).__init__(**kwargs) + self.principal_id = principal_id + self.principal_type = None + + +class AccessReviewScheduleDefinition(Model): + """Access Review Schedule Definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The access review schedule definition id. + :vartype id: str + :ivar name: The access review schedule definition unique id. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param display_name: The display name for the schedule definition. + :type display_name: str + :ivar status: This read-only field specifies the status of an + accessReview. Possible values include: 'NotStarted', 'InProgress', + 'Completed', 'Applied', 'Initializing', 'Applying', 'Completing', + 'Scheduled', 'AutoReviewing', 'AutoReviewed', 'Starting' + :vartype status: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionStatus + :param description_for_admins: The description provided by the access + review creator and visible to admins. + :type description_for_admins: str + :param description_for_reviewers: The description provided by the access + review creator to be shown to reviewers. + :type description_for_reviewers: str + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param type1: The recurrence type : weekly, monthly, etc. Possible values + include: 'weekly', 'absoluteMonthly' + :type type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrencePatternType + :param interval: The interval for recurrence. For a quarterly review, the + interval is 3 for type : absoluteMonthly. + :type interval: int + :param type2: The recurrence range type. The possible values are: endDate, + noEnd, numbered. Possible values include: 'endDate', 'noEnd', 'numbered' + :type type2: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceRangeType + :param number_of_occurrences: The number of times to repeat the access + review. Required and must be positive if type is numbered. + :type number_of_occurrences: int + :param start_date: The DateTime when the review is scheduled to be start. + This could be a date in the future. Required on create. + :type start_date: datetime + :param end_date: The DateTime when the review is scheduled to end. + Required if type is endDate + :type end_date: datetime + :ivar resource_id: ResourceId in which this review is getting created + :vartype resource_id: str + :ivar role_definition_id: This is used to indicate the role being reviewed + :vartype role_definition_id: str + :ivar principal_type1: The identity type user/servicePrincipal to review. + Possible values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScopePrincipalType + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewReviewer] + :ivar reviewers_type: This field specifies the type of reviewers for a + review. Usually for a review, reviewers are explicitly assigned. However, + in some cases, the reviewers may not be assigned and instead be chosen + dynamically. For example managers review or self review. Possible values + include: 'Assigned', 'Self', 'Managers' + :vartype reviewers_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionReviewersType + :param instances: This is the collection of instances returned when one + does an expand on it. + :type instances: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'role_definition_id': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'reviewers_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'description_for_admins': {'key': 'properties.descriptionForAdmins', 'type': 'str'}, + 'description_for_reviewers': {'key': 'properties.descriptionForReviewers', 'type': 'str'}, + 'principal_id': {'key': 'properties.createdBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.createdBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'properties.createdBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'properties.createdBy.userPrincipalName', 'type': 'str'}, + 'mail_notifications_enabled': {'key': 'properties.settings.mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'properties.settings.reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'properties.settings.defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'properties.settings.justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'properties.settings.defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'properties.settings.autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'properties.settings.recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'properties.settings.instanceDurationInDays', 'type': 'int'}, + 'type1': {'key': 'properties.settings.recurrence.pattern.type', 'type': 'str'}, + 'interval': {'key': 'properties.settings.recurrence.pattern.interval', 'type': 'int'}, + 'type2': {'key': 'properties.settings.recurrence.range.type', 'type': 'str'}, + 'number_of_occurrences': {'key': 'properties.settings.recurrence.range.numberOfOccurrences', 'type': 'int'}, + 'start_date': {'key': 'properties.settings.recurrence.range.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.settings.recurrence.range.endDate', 'type': 'iso-8601'}, + 'resource_id': {'key': 'properties.scope.resourceId', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.scope.roleDefinitionId', 'type': 'str'}, + 'principal_type1': {'key': 'properties.scope.principalType', 'type': 'str'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'properties.reviewersType', 'type': 'str'}, + 'instances': {'key': 'properties.instances', 'type': '[AccessReviewInstance]'}, + } + + def __init__(self, *, display_name: str=None, description_for_admins: str=None, description_for_reviewers: str=None, mail_notifications_enabled: bool=None, reminder_notifications_enabled: bool=None, default_decision_enabled: bool=None, justification_required_on_approval: bool=None, default_decision=None, auto_apply_decisions_enabled: bool=None, recommendations_enabled: bool=None, instance_duration_in_days: int=None, type1=None, interval: int=None, type2=None, number_of_occurrences: int=None, start_date=None, end_date=None, reviewers=None, instances=None, **kwargs) -> None: + super(AccessReviewScheduleDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.display_name = display_name + self.status = None + self.description_for_admins = description_for_admins + self.description_for_reviewers = description_for_reviewers + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.mail_notifications_enabled = mail_notifications_enabled + self.reminder_notifications_enabled = reminder_notifications_enabled + self.default_decision_enabled = default_decision_enabled + self.justification_required_on_approval = justification_required_on_approval + self.default_decision = default_decision + self.auto_apply_decisions_enabled = auto_apply_decisions_enabled + self.recommendations_enabled = recommendations_enabled + self.instance_duration_in_days = instance_duration_in_days + self.type1 = type1 + self.interval = interval + self.type2 = type2 + self.number_of_occurrences = number_of_occurrences + self.start_date = start_date + self.end_date = end_date + self.resource_id = None + self.role_definition_id = None + self.principal_type1 = None + self.reviewers = reviewers + self.reviewers_type = None + self.instances = instances + + +class AccessReviewScheduleDefinitionProperties(Model): + """Access Review. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: The display name for the schedule definition. + :type display_name: str + :ivar status: This read-only field specifies the status of an + accessReview. Possible values include: 'NotStarted', 'InProgress', + 'Completed', 'Applied', 'Initializing', 'Applying', 'Completing', + 'Scheduled', 'AutoReviewing', 'AutoReviewed', 'Starting' + :vartype status: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionStatus + :param description_for_admins: The description provided by the access + review creator and visible to admins. + :type description_for_admins: str + :param description_for_reviewers: The description provided by the access + review creator to be shown to reviewers. + :type description_for_reviewers: str + :ivar principal_id: The identity id + :vartype principal_id: str + :ivar principal_type: The identity type : user/servicePrincipal. Possible + values include: 'user', 'servicePrincipal' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewActorIdentityType + :ivar principal_name: The identity display name + :vartype principal_name: str + :ivar user_principal_name: The user principal name(if valid) + :vartype user_principal_name: str + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param type: The recurrence type : weekly, monthly, etc. Possible values + include: 'weekly', 'absoluteMonthly' + :type type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrencePatternType + :param interval: The interval for recurrence. For a quarterly review, the + interval is 3 for type : absoluteMonthly. + :type interval: int + :param type1: The recurrence range type. The possible values are: endDate, + noEnd, numbered. Possible values include: 'endDate', 'noEnd', 'numbered' + :type type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceRangeType + :param number_of_occurrences: The number of times to repeat the access + review. Required and must be positive if type is numbered. + :type number_of_occurrences: int + :param start_date: The DateTime when the review is scheduled to be start. + This could be a date in the future. Required on create. + :type start_date: datetime + :param end_date: The DateTime when the review is scheduled to end. + Required if type is endDate + :type end_date: datetime + :ivar resource_id: ResourceId in which this review is getting created + :vartype resource_id: str + :ivar role_definition_id: This is used to indicate the role being reviewed + :vartype role_definition_id: str + :ivar principal_type1: The identity type user/servicePrincipal to review. + Possible values include: 'user', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScopePrincipalType + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewReviewer] + :ivar reviewers_type: This field specifies the type of reviewers for a + review. Usually for a review, reviewers are explicitly assigned. However, + in some cases, the reviewers may not be assigned and instead be chosen + dynamically. For example managers review or self review. Possible values + include: 'Assigned', 'Self', 'Managers' + :vartype reviewers_type: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionReviewersType + :param instances: This is the collection of instances returned when one + does an expand on it. + :type instances: + list[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance] + """ + + _validation = { + 'status': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'role_definition_id': {'readonly': True}, + 'principal_type1': {'readonly': True}, + 'reviewers_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description_for_admins': {'key': 'descriptionForAdmins', 'type': 'str'}, + 'description_for_reviewers': {'key': 'descriptionForReviewers', 'type': 'str'}, + 'principal_id': {'key': 'createdBy.principalId', 'type': 'str'}, + 'principal_type': {'key': 'createdBy.principalType', 'type': 'str'}, + 'principal_name': {'key': 'createdBy.principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'createdBy.userPrincipalName', 'type': 'str'}, + 'mail_notifications_enabled': {'key': 'settings.mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'settings.reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'settings.defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'settings.justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'settings.defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'settings.autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'settings.recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'settings.instanceDurationInDays', 'type': 'int'}, + 'type': {'key': 'settings.recurrence.pattern.type', 'type': 'str'}, + 'interval': {'key': 'settings.recurrence.pattern.interval', 'type': 'int'}, + 'type1': {'key': 'settings.recurrence.range.type', 'type': 'str'}, + 'number_of_occurrences': {'key': 'settings.recurrence.range.numberOfOccurrences', 'type': 'int'}, + 'start_date': {'key': 'settings.recurrence.range.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'settings.recurrence.range.endDate', 'type': 'iso-8601'}, + 'resource_id': {'key': 'scope.resourceId', 'type': 'str'}, + 'role_definition_id': {'key': 'scope.roleDefinitionId', 'type': 'str'}, + 'principal_type1': {'key': 'scope.principalType', 'type': 'str'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'reviewersType', 'type': 'str'}, + 'instances': {'key': 'instances', 'type': '[AccessReviewInstance]'}, + } + + def __init__(self, *, display_name: str=None, description_for_admins: str=None, description_for_reviewers: str=None, mail_notifications_enabled: bool=None, reminder_notifications_enabled: bool=None, default_decision_enabled: bool=None, justification_required_on_approval: bool=None, default_decision=None, auto_apply_decisions_enabled: bool=None, recommendations_enabled: bool=None, instance_duration_in_days: int=None, type=None, interval: int=None, type1=None, number_of_occurrences: int=None, start_date=None, end_date=None, reviewers=None, instances=None, **kwargs) -> None: + super(AccessReviewScheduleDefinitionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.status = None + self.description_for_admins = description_for_admins + self.description_for_reviewers = description_for_reviewers + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.mail_notifications_enabled = mail_notifications_enabled + self.reminder_notifications_enabled = reminder_notifications_enabled + self.default_decision_enabled = default_decision_enabled + self.justification_required_on_approval = justification_required_on_approval + self.default_decision = default_decision + self.auto_apply_decisions_enabled = auto_apply_decisions_enabled + self.recommendations_enabled = recommendations_enabled + self.instance_duration_in_days = instance_duration_in_days + self.type = type + self.interval = interval + self.type1 = type1 + self.number_of_occurrences = number_of_occurrences + self.start_date = start_date + self.end_date = end_date + self.resource_id = None + self.role_definition_id = None + self.principal_type1 = None + self.reviewers = reviewers + self.reviewers_type = None + self.instances = instances + + +class AccessReviewScheduleSettings(Model): + """Settings of an Access Review. + + :param mail_notifications_enabled: Flag to indicate whether sending mails + to reviewers and the review creator is enabled. + :type mail_notifications_enabled: bool + :param reminder_notifications_enabled: Flag to indicate whether sending + reminder emails to reviewers are enabled. + :type reminder_notifications_enabled: bool + :param default_decision_enabled: Flag to indicate whether reviewers are + required to provide a justification when reviewing access. + :type default_decision_enabled: bool + :param justification_required_on_approval: Flag to indicate whether the + reviewer is required to pass justification when recording a decision. + :type justification_required_on_approval: bool + :param default_decision: This specifies the behavior for the autoReview + feature when an access review completes. Possible values include: + 'Approve', 'Deny', 'Recommendation' + :type default_decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.DefaultDecisionType + :param auto_apply_decisions_enabled: Flag to indicate whether auto-apply + capability, to automatically change the target object access resource, is + enabled. If not enabled, a user must, after the review completes, apply + the access review. + :type auto_apply_decisions_enabled: bool + :param recommendations_enabled: Flag to indicate whether showing + recommendations to reviewers is enabled. + :type recommendations_enabled: bool + :param instance_duration_in_days: The duration in days for an instance. + :type instance_duration_in_days: int + :param recurrence: Access Review Settings. + :type recurrence: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewRecurrenceSettings + """ + + _attribute_map = { + 'mail_notifications_enabled': {'key': 'mailNotificationsEnabled', 'type': 'bool'}, + 'reminder_notifications_enabled': {'key': 'reminderNotificationsEnabled', 'type': 'bool'}, + 'default_decision_enabled': {'key': 'defaultDecisionEnabled', 'type': 'bool'}, + 'justification_required_on_approval': {'key': 'justificationRequiredOnApproval', 'type': 'bool'}, + 'default_decision': {'key': 'defaultDecision', 'type': 'str'}, + 'auto_apply_decisions_enabled': {'key': 'autoApplyDecisionsEnabled', 'type': 'bool'}, + 'recommendations_enabled': {'key': 'recommendationsEnabled', 'type': 'bool'}, + 'instance_duration_in_days': {'key': 'instanceDurationInDays', 'type': 'int'}, + 'recurrence': {'key': 'recurrence', 'type': 'AccessReviewRecurrenceSettings'}, + } + + def __init__(self, *, mail_notifications_enabled: bool=None, reminder_notifications_enabled: bool=None, default_decision_enabled: bool=None, justification_required_on_approval: bool=None, default_decision=None, auto_apply_decisions_enabled: bool=None, recommendations_enabled: bool=None, instance_duration_in_days: int=None, recurrence=None, **kwargs) -> None: + super(AccessReviewScheduleSettings, self).__init__(**kwargs) + self.mail_notifications_enabled = mail_notifications_enabled + self.reminder_notifications_enabled = reminder_notifications_enabled + self.default_decision_enabled = default_decision_enabled + self.justification_required_on_approval = justification_required_on_approval + self.default_decision = default_decision + self.auto_apply_decisions_enabled = auto_apply_decisions_enabled + self.recommendations_enabled = recommendations_enabled + self.instance_duration_in_days = instance_duration_in_days + self.recurrence = recurrence + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorDefinition(Model): + """Error. + + Error description and code explaining why an operation failed. + + :param error: Error of the list gateway status. + :type error: + ~azure.mgmt.authorization.v2018_05_01_preview.models.ErrorDefinitionProperties + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinitionProperties'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.error = error + + +class ErrorDefinitionException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDefinition'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDefinitionException, self).__init__(deserialize, response, 'ErrorDefinition', *args) + + +class ErrorDefinitionProperties(Model): + """Error. + + Error description and code explaining why an operation failed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: Description of the error. + :vartype message: str + :param code: Error code of list gateway. + :type code: str + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, **kwargs) -> None: + super(ErrorDefinitionProperties, self).__init__(**kwargs) + self.message = None + self.code = code + + +class Operation(Model): + """The definition of a Microsoft.Authorization operation. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: + ~azure.mgmt.authorization.v2018_05_01_preview.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + + +class OperationDisplay(Model): + """The display information for a Microsoft.Authorization operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The resource provider name: Microsoft.Authorization. + :vartype provider: str + :ivar resource: The resource on which the operation is performed. + :vartype resource: str + :ivar operation: The operation that users can perform. + :vartype operation: str + :ivar description: The description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class ServicePrincipalDecisionTarget(AccessReviewDecisionTarget): + """Service Principal Decision Target. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :ivar principal_id: The id of service principal whose access is reviewed. + :vartype principal_id: str + :ivar principal_name: The display name of the service principal whose + access was reviewed. + :vartype principal_name: str + :ivar app_id: The appId for the service principal entity being reviewed + :vartype app_id: str + """ + + _validation = { + 'type': {'required': True}, + 'principal_id': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'app_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ServicePrincipalDecisionTarget, self).__init__(**kwargs) + self.principal_id = None + self.principal_name = None + self.app_id = None + self.type = 'servicePrincipal' + + +class UserDecisionTarget(AccessReviewDecisionTarget): + """User Decision Target. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :ivar principal_id: The id of user whose access was reviewed. + :vartype principal_id: str + :ivar principal_name: The display name of the user whose access was + reviewed. + :vartype principal_name: str + :ivar user_principal_name: The user principal name of the user whose + access was reviewed. + :vartype user_principal_name: str + """ + + _validation = { + 'type': {'required': True}, + 'principal_id': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'principal_name': {'key': 'principalName', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UserDecisionTarget, self).__init__(**kwargs) + self.principal_id = None + self.principal_name = None + self.user_principal_name = None + self.type = 'user' diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_paged_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..3def9e2f0367 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_paged_models.py @@ -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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class AccessReviewScheduleDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`AccessReviewScheduleDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AccessReviewScheduleDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(AccessReviewScheduleDefinitionPaged, self).__init__(*args, **kwargs) +class AccessReviewInstancePaged(Paged): + """ + A paging container for iterating over a list of :class:`AccessReviewInstance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AccessReviewInstance]'} + } + + def __init__(self, *args, **kwargs): + + super(AccessReviewInstancePaged, self).__init__(*args, **kwargs) +class AccessReviewDecisionPaged(Paged): + """ + A paging container for iterating over a list of :class:`AccessReviewDecision ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AccessReviewDecision]'} + } + + def __init__(self, *args, **kwargs): + + super(AccessReviewDecisionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/__init__.py new file mode 100644 index 000000000000..cba7f42add55 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/__init__.py @@ -0,0 +1,32 @@ +# 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 ._operations import Operations +from ._access_review_schedule_definitions_operations import AccessReviewScheduleDefinitionsOperations +from ._access_review_instances_operations import AccessReviewInstancesOperations +from ._access_review_instance_operations import AccessReviewInstanceOperations +from ._access_review_instance_decisions_operations import AccessReviewInstanceDecisionsOperations +from ._access_review_default_settings_operations import AccessReviewDefaultSettingsOperations +from ._access_review_schedule_definitions_assigned_for_my_approval_operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations +from ._access_review_instances_assigned_for_my_approval_operations import AccessReviewInstancesAssignedForMyApprovalOperations +from ._access_review_instance_my_decisions_operations import AccessReviewInstanceMyDecisionsOperations + +__all__ = [ + 'Operations', + 'AccessReviewScheduleDefinitionsOperations', + 'AccessReviewInstancesOperations', + 'AccessReviewInstanceOperations', + 'AccessReviewInstanceDecisionsOperations', + 'AccessReviewDefaultSettingsOperations', + 'AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations', + 'AccessReviewInstancesAssignedForMyApprovalOperations', + 'AccessReviewInstanceMyDecisionsOperations', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_default_settings_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_default_settings_operations.py new file mode 100644 index 000000000000..c86d01586b5c --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_default_settings_operations.py @@ -0,0 +1,156 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewDefaultSettingsOperations(object): + """AccessReviewDefaultSettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get access review default settings for the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewDefaultSettings or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDefaultSettings + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewDefaultSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default'} + + def put( + self, properties, custom_headers=None, raw=False, **operation_config): + """Get access review default settings for the subscription. + + :param properties: Access review schedule settings. + :type properties: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleSettings + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewDefaultSettings or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDefaultSettings + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(properties, 'AccessReviewScheduleSettings') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewDefaultSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_decisions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_decisions_operations.py new file mode 100644 index 000000000000..f851a3bba40d --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_decisions_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewInstanceDecisionsOperations(object): + """AccessReviewInstanceDecisionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """Get access review instance decisions. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessReviewDecision + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDecisionPaged[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDecision] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessReviewDecisionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_my_decisions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_my_decisions_operations.py new file mode 100644 index 000000000000..8efbc740b4a4 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_my_decisions_operations.py @@ -0,0 +1,253 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewInstanceMyDecisionsOperations(object): + """AccessReviewInstanceMyDecisionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """Get my access review instance decisions. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessReviewDecision + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDecisionPaged[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDecision] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessReviewDecisionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions'} + + def get_by_id( + self, schedule_definition_id, id, decision_id, custom_headers=None, raw=False, **operation_config): + """Get my single access review instance decision. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param decision_id: The id of the decision record. + :type decision_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewDecision or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDecision + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'decisionId': self._serialize.url("decision_id", decision_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewDecision', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions/{decisionId}'} + + def patch( + self, schedule_definition_id, id, decision_id, decision=None, justification=None, custom_headers=None, raw=False, **operation_config): + """Record a decision. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param decision_id: The id of the decision record. + :type decision_id: str + :param decision: The decision on the approval step. This value is + initially set to NotReviewed. Approvers can take action of + Approve/Deny. Possible values include: 'Approve', 'Deny', + 'NotReviewed', 'DontKnow', 'NotNotified' + :type decision: str or + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewResult + :param justification: Justification provided by approvers for their + action + :type justification: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewDecision or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewDecision + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + properties = models.AccessReviewDecisionProperties(decision=decision, justification=justification) + + # Construct URL + url = self.patch.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'decisionId': self._serialize.url("decision_id", decision_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(properties, 'AccessReviewDecisionProperties') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewDecision', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions/{decisionId}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_operations.py new file mode 100644 index 000000000000..dbc28ccb4430 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_operations.py @@ -0,0 +1,304 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewInstanceOperations(object): + """AccessReviewInstanceOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def stop( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """An action to stop an access review instance. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/stop'} + + def reset_decisions( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """An action to reset all decisions for an access review instance. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.reset_decisions.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + reset_decisions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/resetDecisions'} + + def apply_decisions( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """An action to apply all decisions for an access review instance. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.apply_decisions.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + apply_decisions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/applyDecisions'} + + def send_reminders( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """An action to send reminders for an access review instance. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.send_reminders.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + send_reminders.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/sendReminders'} + + def accept_recommendations( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """An action to accept recommendations for decision in an access review + instance. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.accept_recommendations.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + accept_recommendations.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/acceptRecommendations'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py new file mode 100644 index 000000000000..8d9ab8526f46 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py @@ -0,0 +1,168 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewInstancesAssignedForMyApprovalOperations(object): + """AccessReviewInstancesAssignedForMyApprovalOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, custom_headers=None, raw=False, **operation_config): + """Get access review instances assigned for my approval. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessReviewInstance + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstancePaged[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessReviewInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances'} + + def get_by_id( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """Get single access review instance assigned for my approval. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewInstance or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_operations.py new file mode 100644 index 000000000000..059e1d3289cc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_operations.py @@ -0,0 +1,170 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewInstancesOperations(object): + """AccessReviewInstancesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, custom_headers=None, raw=False, **operation_config): + """Get access review instances. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessReviewInstance + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstancePaged[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessReviewInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances'} + + def get_by_id( + self, schedule_definition_id, id, custom_headers=None, raw=False, **operation_config): + """Get access review instances. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param id: The id of the access review instance. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewInstance or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewInstance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py new file mode 100644 index 000000000000..7aa0afdaf94a --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations(object): + """AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get access review instances assigned for my approval. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessReviewScheduleDefinition + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionPaged[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinition] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessReviewScheduleDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/accessReviewScheduleDefinitions'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_operations.py new file mode 100644 index 000000000000..ccfad23cb52c --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_operations.py @@ -0,0 +1,331 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AccessReviewScheduleDefinitionsOperations(object): + """AccessReviewScheduleDefinitionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get access review schedule definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessReviewScheduleDefinition + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionPaged[~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinition] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessReviewScheduleDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions'} + + def get_by_id( + self, schedule_definition_id, custom_headers=None, raw=False, **operation_config): + """Get single access review definition. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewScheduleDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewScheduleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}'} + + def delete_by_id( + self, schedule_definition_id, custom_headers=None, raw=False, **operation_config): + """Delete access review schedule definition. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.delete_by_id.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}'} + + def create_or_update_by_id( + self, schedule_definition_id, properties, custom_headers=None, raw=False, **operation_config): + """Create or Update access review schedule definition. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param properties: Access review schedule definition properties. + :type properties: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinitionProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessReviewScheduleDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.AccessReviewScheduleDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.create_or_update_by_id.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(properties, 'AccessReviewScheduleDefinitionProperties') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessReviewScheduleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}'} + + def stop( + self, schedule_definition_id, custom_headers=None, raw=False, **operation_config): + """Stop access review definition. + + :param schedule_definition_id: The id of the access review schedule + definition. + :type schedule_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'scheduleDefinitionId': self._serialize.url("schedule_definition_id", schedule_definition_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorDefinitionException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/stop'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_operations.py new file mode 100644 index 000000000000..3b6b4072fac7 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the operations available from this provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.authorization.v2018_05_01_preview.models.OperationPaged[~azure.mgmt.authorization.v2018_05_01_preview.models.Operation] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDefinitionException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/operations'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/version.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/version.py new file mode 100644 index 000000000000..7921c843fb54 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2018-05-01-preview" + diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py index 7fa9d33fff9d..b9da08d124b5 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py @@ -10,10 +10,16 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import RoleAssignment from ._models_py3 import RoleAssignmentCreateParameters from ._models_py3 import RoleAssignmentFilter except (SyntaxError, ImportError): + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import RoleAssignment from ._models import RoleAssignmentCreateParameters from ._models import RoleAssignmentFilter @@ -23,6 +29,9 @@ ) __all__ = [ + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'RoleAssignment', 'RoleAssignmentCreateParameters', 'RoleAssignmentFilter', diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py index ca78bb76ffd1..9acbb5024643 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CloudError(Model): @@ -20,6 +21,112 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: + ~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + 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 RoleAssignment(Model): """Role Assignments. @@ -54,8 +161,19 @@ class RoleAssignment(Model): StringEqualsIgnoreCase 'foo_storage_container' :type condition: str :param condition_version: Version of the condition. Currently accepted - values are '1.0' or '2.0' + value is '2.0' :type condition_version: str + :param created_on: Time it was created + :type created_on: datetime + :param updated_on: Time it was updated + :type updated_on: datetime + :param created_by: Id of the user who created the assignment + :type created_by: str + :param updated_by: Id of the user who updated the assignment + :type updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -76,6 +194,11 @@ class RoleAssignment(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'updated_on': {'key': 'properties.updatedOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -91,6 +214,11 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) self.condition = kwargs.get('condition', None) self.condition_version = kwargs.get('condition_version', None) + self.created_on = kwargs.get('created_on', None) + self.updated_on = kwargs.get('updated_on', None) + self.created_by = kwargs.get('created_by', None) + self.updated_by = kwargs.get('updated_by', None) + self.delegated_managed_identity_resource_id = kwargs.get('delegated_managed_identity_resource_id', None) class RoleAssignmentCreateParameters(Model): @@ -116,9 +244,13 @@ class RoleAssignmentCreateParameters(Model): :type can_delegate: bool :param description: Description of role assignment :type description: str - :param condition: The conditions on the role assignment + :param condition: The conditions on the role assignment. This limits the + resources it can be assigned to. e.g.: + @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + StringEqualsIgnoreCase 'foo_storage_container' :type condition: str - :param condition_version: Version of the condition + :param condition_version: Version of the condition. Currently accepted + value is '2.0' :type condition_version: str """ diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py index 2d4acd255fca..1c3cac6b6cba 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CloudError(Model): @@ -20,6 +21,112 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: + ~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +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 RoleAssignment(Model): """Role Assignments. @@ -54,8 +161,19 @@ class RoleAssignment(Model): StringEqualsIgnoreCase 'foo_storage_container' :type condition: str :param condition_version: Version of the condition. Currently accepted - values are '1.0' or '2.0' + value is '2.0' :type condition_version: str + :param created_on: Time it was created + :type created_on: datetime + :param updated_on: Time it was updated + :type updated_on: datetime + :param created_by: Id of the user who created the assignment + :type created_by: str + :param updated_by: Id of the user who updated the assignment + :type updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -76,9 +194,14 @@ class RoleAssignment(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'updated_on': {'key': 'properties.updatedOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } - def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, **kwargs) -> None: + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, created_on=None, updated_on=None, created_by: str=None, updated_by: str=None, delegated_managed_identity_resource_id: str=None, **kwargs) -> None: super(RoleAssignment, self).__init__(**kwargs) self.id = None self.name = None @@ -91,6 +214,11 @@ def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_i self.description = description self.condition = condition self.condition_version = condition_version + self.created_on = created_on + self.updated_on = updated_on + self.created_by = created_by + self.updated_by = updated_by + self.delegated_managed_identity_resource_id = delegated_managed_identity_resource_id class RoleAssignmentCreateParameters(Model): @@ -116,9 +244,13 @@ class RoleAssignmentCreateParameters(Model): :type can_delegate: bool :param description: Description of role assignment :type description: str - :param condition: The conditions on the role assignment + :param condition: The conditions on the role assignment. This limits the + resources it can be assigned to. e.g.: + @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + StringEqualsIgnoreCase 'foo_storage_container' :type condition: str - :param condition_version: Version of the condition + :param condition_version: Version of the condition. Currently accepted + value is '2.0' :type condition_version: str """ diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py index 2fe33743dac8..7e3838a91863 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py @@ -148,7 +148,8 @@ def list_for_resource_group( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -190,9 +191,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -223,7 +222,8 @@ def delete( :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -251,10 +251,8 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -294,7 +292,8 @@ def create( :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create.metadata['url'] @@ -327,9 +326,7 @@ def create( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: @@ -359,7 +356,8 @@ def get( :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -388,9 +386,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -601,7 +597,8 @@ def list( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -642,9 +639,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -676,7 +671,8 @@ def list_for_scope( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -717,9 +713,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response