From dafd4ecdf1bfc24c17f4aa71c2103d6cbca7fd6a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 10 Jun 2021 03:13:18 +0000 Subject: [PATCH] CodeGen from PR 14560 in Azure/azure-rest-api-specs Merge 5de4c00e98f1308ecd79dca90c41302202bebb29 into 5d011b57ab387ed9b2eff5b6f17857476cf19d86 --- .../azure-mgmt-authorization/MANIFEST.in | 1 + .../azure-mgmt-authorization/_meta.json | 8 + .../_authorization_management_client.py | 392 +++ .../v2015_06_01/models/__init__.py | 9 + .../v2015_06_01/models/_models.py | 106 + .../v2015_06_01/models/_models_py3.py | 106 + .../_classic_administrators_operations.py | 12 +- .../v2015_07_01/models/__init__.py | 9 + .../v2015_07_01/models/_models.py | 106 + .../v2015_07_01/models/_models_py3.py | 106 + .../_classic_administrators_operations.py | 12 +- .../_global_administrator_operations.py | 10 +- .../operations/_permissions_operations.py | 35 +- ...provider_operations_metadata_operations.py | 29 +- .../_role_assignments_operations.py | 111 +- .../_role_definitions_operations.py | 48 +- .../v2018_01_01_preview/models/__init__.py | 9 + .../v2018_01_01_preview/models/_models.py | 107 + .../v2018_01_01_preview/models/_models_py3.py | 107 + .../operations/_permissions_operations.py | 33 +- ...provider_operations_metadata_operations.py | 19 +- .../_role_assignments_operations.py | 111 +- .../_role_definitions_operations.py | 48 +- .../v2018_05_01_preview/__init__.py | 19 + .../_authorization_management_client.py | 89 + .../v2018_05_01_preview/_configuration.py | 48 + .../v2018_05_01_preview/models/__init__.py | 95 + .../_authorization_management_client_enums.py | 113 + .../v2018_05_01_preview/models/_models.py | 1095 ++++++++ .../v2018_05_01_preview/models/_models_py3.py | 1095 ++++++++ .../models/_paged_models.py | 66 + .../operations/__init__.py | 32 + ...cess_review_default_settings_operations.py | 156 ++ ...ss_review_instance_decisions_operations.py | 111 + ...review_instance_my_decisions_operations.py | 253 ++ .../_access_review_instance_operations.py | 304 +++ ...ces_assigned_for_my_approval_operations.py | 168 ++ .../_access_review_instances_operations.py | 170 ++ ...ons_assigned_for_my_approval_operations.py | 100 + ..._review_schedule_definitions_operations.py | 331 +++ .../operations/_operations.py | 100 + .../v2018_05_01_preview/version.py | 13 + .../v2018_07_01_preview/models/__init__.py | 9 + .../v2018_07_01_preview/models/_models.py | 107 + .../v2018_07_01_preview/models/_models_py3.py | 107 + .../_deny_assignments_operations.py | 71 +- .../v2018_09_01_preview/models/__init__.py | 9 + .../v2018_09_01_preview/models/_models.py | 107 + .../v2018_09_01_preview/models/_models_py3.py | 107 + .../_role_assignments_operations.py | 111 +- .../v2020_04_01_preview/models/__init__.py | 9 + .../v2020_04_01_preview/models/_models.py | 147 +- .../v2020_04_01_preview/models/_models_py3.py | 149 +- .../_role_assignments_operations.py | 169 +- .../v2020_10_01_preview/__init__.py | 19 + .../_authorization_management_client.py | 94 + .../v2020_10_01_preview/_configuration.py | 48 + .../v2020_10_01_preview/models/__init__.py | 214 ++ .../_authorization_management_client_enums.py | 135 + .../v2020_10_01_preview/models/_models.py | 2322 +++++++++++++++++ .../v2020_10_01_preview/models/_models_py3.py | 2322 +++++++++++++++++ .../models/_paged_models.py | 144 + .../operations/__init__.py | 34 + .../_eligible_child_resources_operations.py | 117 + ...ssignment_schedule_instances_operations.py | 182 ++ ...assignment_schedule_requests_operations.py | 315 +++ .../_role_assignment_schedules_operations.py | 180 ++ .../_role_assignments_operations.py | 926 +++++++ ...igibility_schedule_instances_operations.py | 182 ++ ...ligibility_schedule_requests_operations.py | 315 +++ .../_role_eligibility_schedules_operations.py | 180 ++ .../_role_management_policies_operations.py | 292 +++ ...anagement_policy_assignments_operations.py | 298 +++ .../v2020_10_01_preview/version.py | 13 + .../v2021_01_01_preview/__init__.py | 19 + .../_authorization_management_client.py | 79 + .../v2021_01_01_preview/_configuration.py | 48 + .../v2021_01_01_preview/models/__init__.py | 52 + .../_authorization_management_client_enums.py | 37 + .../v2021_01_01_preview/models/_models.py | 379 +++ .../v2021_01_01_preview/models/_models_py3.py | 379 +++ .../models/_paged_models.py | 40 + .../operations/__init__.py | 28 + .../operations/_operations.py | 100 + .../_role_assignment_approval_operations.py | 170 ++ ...ole_assignment_approval_step_operations.py | 233 ++ ...le_assignment_approval_steps_operations.py | 97 + ...ope_role_assignment_approval_operations.py | 179 ++ ...ole_assignment_approval_step_operations.py | 242 ++ ...le_assignment_approval_steps_operations.py | 100 + .../v2021_01_01_preview/version.py | 13 + .../v2021_03_01_preview/__init__.py | 19 + .../_authorization_management_client.py | 89 + .../v2021_03_01_preview/_configuration.py | 48 + .../v2021_03_01_preview/models/__init__.py | 97 + .../_authorization_management_client_enums.py | 120 + .../v2021_03_01_preview/models/_models.py | 1190 +++++++++ .../v2021_03_01_preview/models/_models_py3.py | 1190 +++++++++ .../models/_paged_models.py | 66 + .../operations/__init__.py | 32 + ...cess_review_default_settings_operations.py | 156 ++ ...ss_review_instance_decisions_operations.py | 119 + ...review_instance_my_decisions_operations.py | 261 ++ .../_access_review_instance_operations.py | 304 +++ ...ces_assigned_for_my_approval_operations.py | 176 ++ .../_access_review_instances_operations.py | 178 ++ ...ons_assigned_for_my_approval_operations.py | 108 + ..._review_schedule_definitions_operations.py | 339 +++ .../operations/_operations.py | 100 + .../v2021_03_01_preview/version.py | 13 + .../v2021_07_01_preview/__init__.py | 19 + .../_authorization_management_client.py | 89 + .../v2021_07_01_preview/_configuration.py | 48 + .../v2021_07_01_preview/models/__init__.py | 102 + .../_authorization_management_client_enums.py | 128 + .../v2021_07_01_preview/models/_models.py | 1327 ++++++++++ .../v2021_07_01_preview/models/_models_py3.py | 1327 ++++++++++ .../models/_paged_models.py | 66 + .../operations/__init__.py | 32 + ...cess_review_default_settings_operations.py | 156 ++ ...ss_review_instance_decisions_operations.py | 119 + ...review_instance_my_decisions_operations.py | 261 ++ .../_access_review_instance_operations.py | 304 +++ ...ces_assigned_for_my_approval_operations.py | 176 ++ .../_access_review_instances_operations.py | 247 ++ ...ons_assigned_for_my_approval_operations.py | 108 + ..._review_schedule_definitions_operations.py | 339 +++ .../operations/_operations.py | 100 + .../v2021_07_01_preview/version.py | 13 + 129 files changed, 26647 insertions(+), 440 deletions(-) create mode 100644 sdk/authorization/azure-mgmt-authorization/_meta.json create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_authorization_management_client.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/_configuration.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_authorization_management_client_enums.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_models_py3.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/models/_paged_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_default_settings_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_decisions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_my_decisions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instance_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_instances_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_access_review_schedule_definitions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/operations/_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/version.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/_authorization_management_client.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/_configuration.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_authorization_management_client_enums.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models_py3.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_paged_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_eligible_child_resources_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_instances_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_requests_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedules_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignments_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_instances_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_requests_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedules_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policies_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policy_assignments_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/version.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/_authorization_management_client.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/_configuration.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_authorization_management_client_enums.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models_py3.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_paged_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_step_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_steps_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_step_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_steps_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/version.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/_authorization_management_client.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/_configuration.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_authorization_management_client_enums.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models_py3.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_paged_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_default_settings_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_decisions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_my_decisions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instances_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_schedule_definitions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/version.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/_authorization_management_client.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/_configuration.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_authorization_management_client_enums.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models_py3.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_paged_models.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/__init__.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_default_settings_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_decisions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_my_decisions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instances_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_operations.py create mode 100644 sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/version.py diff --git a/sdk/authorization/azure-mgmt-authorization/MANIFEST.in b/sdk/authorization/azure-mgmt-authorization/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/authorization/azure-mgmt-authorization/MANIFEST.in +++ b/sdk/authorization/azure-mgmt-authorization/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/authorization/azure-mgmt-authorization/_meta.json b/sdk/authorization/azure-mgmt-authorization/_meta.json new file mode 100644 index 000000000000..b8f229a40944 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "5870565676a0956e0bd2f05b1918203c2722e0ca", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/authorization/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/authorization/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/_authorization_management_client.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/_authorization_management_client.py index a0f3743f3b87..9aec9e4dee76 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/_authorization_management_client.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/_authorization_management_client.py @@ -81,9 +81,14 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2015-06-01: :mod:`v2015_06_01.models` * 2015-07-01: :mod:`v2015_07_01.models` * 2018-01-01-preview: :mod:`v2018_01_01_preview.models` + * 2018-05-01-preview: :mod:`v2018_05_01_preview.models` * 2018-07-01-preview: :mod:`v2018_07_01_preview.models` * 2018-09-01-preview: :mod:`v2018_09_01_preview.models` * 2020-04-01-preview: :mod:`v2020_04_01_preview.models` + * 2020-10-01-preview: :mod:`v2020_10_01_preview.models` + * 2021-01-01-preview: :mod:`v2021_01_01_preview.models` + * 2021-03-01-preview: :mod:`v2021_03_01_preview.models` + * 2021-07-01-preview: :mod:`v2021_07_01_preview.models` """ if api_version == '2015-06-01': from .v2015_06_01 import models @@ -94,6 +99,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview import models return models + elif api_version == '2018-05-01-preview': + from .v2018_05_01_preview import models + return models elif api_version == '2018-07-01-preview': from .v2018_07_01_preview import models return models @@ -103,8 +111,172 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-04-01-preview': from .v2020_04_01_preview import models return models + elif api_version == '2020-10-01-preview': + from .v2020_10_01_preview import models + return models + elif api_version == '2021-01-01-preview': + from .v2021_01_01_preview import models + return models + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview import models + return models + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def access_review_default_settings(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewDefaultSettingsOperations` + * 2021-03-01-preview: :class:`AccessReviewDefaultSettingsOperations` + * 2021-07-01-preview: :class:`AccessReviewDefaultSettingsOperations` + """ + api_version = self._get_api_version('access_review_default_settings') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewDefaultSettingsOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewDefaultSettingsOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewDefaultSettingsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_instance(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewInstanceOperations` + * 2021-03-01-preview: :class:`AccessReviewInstanceOperations` + * 2021-07-01-preview: :class:`AccessReviewInstanceOperations` + """ + api_version = self._get_api_version('access_review_instance') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewInstanceOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewInstanceOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewInstanceOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_instance_decisions(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewInstanceDecisionsOperations` + * 2021-03-01-preview: :class:`AccessReviewInstanceDecisionsOperations` + * 2021-07-01-preview: :class:`AccessReviewInstanceDecisionsOperations` + """ + api_version = self._get_api_version('access_review_instance_decisions') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewInstanceDecisionsOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewInstanceDecisionsOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewInstanceDecisionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_instance_my_decisions(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewInstanceMyDecisionsOperations` + * 2021-03-01-preview: :class:`AccessReviewInstanceMyDecisionsOperations` + * 2021-07-01-preview: :class:`AccessReviewInstanceMyDecisionsOperations` + """ + api_version = self._get_api_version('access_review_instance_my_decisions') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewInstanceMyDecisionsOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewInstanceMyDecisionsOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewInstanceMyDecisionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_instances(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewInstancesOperations` + * 2021-03-01-preview: :class:`AccessReviewInstancesOperations` + * 2021-07-01-preview: :class:`AccessReviewInstancesOperations` + """ + api_version = self._get_api_version('access_review_instances') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewInstancesOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewInstancesOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewInstancesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_instances_assigned_for_my_approval(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewInstancesAssignedForMyApprovalOperations` + * 2021-03-01-preview: :class:`AccessReviewInstancesAssignedForMyApprovalOperations` + * 2021-07-01-preview: :class:`AccessReviewInstancesAssignedForMyApprovalOperations` + """ + api_version = self._get_api_version('access_review_instances_assigned_for_my_approval') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewInstancesAssignedForMyApprovalOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewInstancesAssignedForMyApprovalOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewInstancesAssignedForMyApprovalOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_schedule_definitions(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewScheduleDefinitionsOperations` + * 2021-03-01-preview: :class:`AccessReviewScheduleDefinitionsOperations` + * 2021-07-01-preview: :class:`AccessReviewScheduleDefinitionsOperations` + """ + api_version = self._get_api_version('access_review_schedule_definitions') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewScheduleDefinitionsOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewScheduleDefinitionsOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewScheduleDefinitionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def access_review_schedule_definitions_assigned_for_my_approval(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations` + * 2021-03-01-preview: :class:`AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations` + * 2021-07-01-preview: :class:`AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations` + """ + api_version = self._get_api_version('access_review_schedule_definitions_assigned_for_my_approval') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def classic_administrators(self): """Instance depends on the API version: @@ -134,6 +306,19 @@ def deny_assignments(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def eligible_child_resources(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`EligibleChildResourcesOperations` + """ + api_version = self._get_api_version('eligible_child_resources') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import EligibleChildResourcesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def global_administrator(self): """Instance depends on the API version: @@ -147,6 +332,28 @@ def global_administrator(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def operations(self): + """Instance depends on the API version: + + * 2018-05-01-preview: :class:`Operations` + * 2021-01-01-preview: :class:`Operations` + * 2021-03-01-preview: :class:`Operations` + * 2021-07-01-preview: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import Operations as OperationClass + elif api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import Operations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import Operations as OperationClass + elif api_version == '2021-07-01-preview': + from .v2021_07_01_preview.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def permissions(self): """Instance depends on the API version: @@ -179,6 +386,84 @@ def provider_operations_metadata(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def role_assignment_approval(self): + """Instance depends on the API version: + + * 2021-01-01-preview: :class:`RoleAssignmentApprovalOperations` + """ + api_version = self._get_api_version('role_assignment_approval') + if api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import RoleAssignmentApprovalOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_assignment_approval_step(self): + """Instance depends on the API version: + + * 2021-01-01-preview: :class:`RoleAssignmentApprovalStepOperations` + """ + api_version = self._get_api_version('role_assignment_approval_step') + if api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import RoleAssignmentApprovalStepOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_assignment_approval_steps(self): + """Instance depends on the API version: + + * 2021-01-01-preview: :class:`RoleAssignmentApprovalStepsOperations` + """ + api_version = self._get_api_version('role_assignment_approval_steps') + if api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import RoleAssignmentApprovalStepsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_assignment_schedule_instances(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleAssignmentScheduleInstancesOperations` + """ + api_version = self._get_api_version('role_assignment_schedule_instances') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleAssignmentScheduleInstancesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_assignment_schedule_requests(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleAssignmentScheduleRequestsOperations` + """ + api_version = self._get_api_version('role_assignment_schedule_requests') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleAssignmentScheduleRequestsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_assignment_schedules(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleAssignmentSchedulesOperations` + """ + api_version = self._get_api_version('role_assignment_schedules') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleAssignmentSchedulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def role_assignments(self): """Instance depends on the API version: @@ -187,6 +472,7 @@ def role_assignments(self): * 2018-01-01-preview: :class:`RoleAssignmentsOperations` * 2018-09-01-preview: :class:`RoleAssignmentsOperations` * 2020-04-01-preview: :class:`RoleAssignmentsOperations` + * 2020-10-01-preview: :class:`RoleAssignmentsOperations` """ api_version = self._get_api_version('role_assignments') if api_version == '2015-07-01': @@ -197,6 +483,8 @@ def role_assignments(self): from .v2018_09_01_preview.operations import RoleAssignmentsOperations as OperationClass elif api_version == '2020-04-01-preview': from .v2020_04_01_preview.operations import RoleAssignmentsOperations as OperationClass + elif api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleAssignmentsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -216,3 +504,107 @@ def role_definitions(self): else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_eligibility_schedule_instances(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleEligibilityScheduleInstancesOperations` + """ + api_version = self._get_api_version('role_eligibility_schedule_instances') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleEligibilityScheduleInstancesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_eligibility_schedule_requests(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleEligibilityScheduleRequestsOperations` + """ + api_version = self._get_api_version('role_eligibility_schedule_requests') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleEligibilityScheduleRequestsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_eligibility_schedules(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleEligibilitySchedulesOperations` + """ + api_version = self._get_api_version('role_eligibility_schedules') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleEligibilitySchedulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_management_policies(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleManagementPoliciesOperations` + """ + api_version = self._get_api_version('role_management_policies') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleManagementPoliciesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def role_management_policy_assignments(self): + """Instance depends on the API version: + + * 2020-10-01-preview: :class:`RoleManagementPolicyAssignmentsOperations` + """ + api_version = self._get_api_version('role_management_policy_assignments') + if api_version == '2020-10-01-preview': + from .v2020_10_01_preview.operations import RoleManagementPolicyAssignmentsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def scope_role_assignment_approval(self): + """Instance depends on the API version: + + * 2021-01-01-preview: :class:`ScopeRoleAssignmentApprovalOperations` + """ + api_version = self._get_api_version('scope_role_assignment_approval') + if api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import ScopeRoleAssignmentApprovalOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def scope_role_assignment_approval_step(self): + """Instance depends on the API version: + + * 2021-01-01-preview: :class:`ScopeRoleAssignmentApprovalStepOperations` + """ + api_version = self._get_api_version('scope_role_assignment_approval_step') + if api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import ScopeRoleAssignmentApprovalStepOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def scope_role_assignment_approval_steps(self): + """Instance depends on the API version: + + * 2021-01-01-preview: :class:`ScopeRoleAssignmentApprovalStepsOperations` + """ + api_version = self._get_api_version('scope_role_assignment_approval_steps') + if api_version == '2021-01-01-preview': + from .v2021_01_01_preview.operations import ScopeRoleAssignmentApprovalStepsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/__init__.py index 99ccac775f2d..651c14481778 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/__init__.py @@ -11,11 +11,20 @@ try: from ._models_py3 import ClassicAdministrator + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException except (SyntaxError, ImportError): from ._models import ClassicAdministrator + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._paged_models import ClassicAdministratorPaged __all__ = [ 'ClassicAdministrator', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'ClassicAdministratorPaged', ] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models.py index d14093bb951f..04689cdf2587 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class ClassicAdministrator(Model): @@ -50,3 +51,108 @@ class CloudError(Model): _attribute_map = { } + + +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.v2015_06_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2015_06_01.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.v2015_06_01.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) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models_py3.py index b0928e129f56..3f0298079e64 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class ClassicAdministrator(Model): @@ -50,3 +51,108 @@ class CloudError(Model): _attribute_map = { } + + +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.v2015_06_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2015_06_01.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.v2015_06_01.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) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/operations/_classic_administrators_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/operations/_classic_administrators_operations.py index 2f6df9c99e31..8fd078f46f35 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/operations/_classic_administrators_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/operations/_classic_administrators_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -52,20 +51,21 @@ def list( :return: An iterator like instance of ClassicAdministrator :rtype: ~azure.mgmt.authorization.v2015_06_01.models.ClassicAdministratorPaged[~azure.mgmt.authorization.v2015_06_01.models.ClassicAdministrator] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ 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') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -91,9 +91,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/__init__.py index fb1c4770e5ee..f2ff9071af2b 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/__init__.py @@ -11,6 +11,9 @@ try: from ._models_py3 import ClassicAdministrator + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import Permission from ._models_py3 import ProviderOperation from ._models_py3 import ProviderOperationsMetadata @@ -24,6 +27,9 @@ from ._models_py3 import RoleDefinitionFilter except (SyntaxError, ImportError): from ._models import ClassicAdministrator + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import Permission from ._models import ProviderOperation from ._models import ProviderOperationsMetadata @@ -43,6 +49,9 @@ __all__ = [ 'ClassicAdministrator', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'Permission', 'ProviderOperation', 'ProviderOperationsMetadata', diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models.py index 96194e05896a..6d3a14f24712 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class ClassicAdministrator(Model): @@ -52,6 +53,111 @@ 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.v2015_07_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2015_07_01.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.v2015_07_01.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 Permission(Model): """Role definition permissions. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models_py3.py index 9587447a649b..51277e76abbb 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class ClassicAdministrator(Model): @@ -52,6 +53,111 @@ 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.v2015_07_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2015_07_01.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.v2015_07_01.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 Permission(Model): """Role definition permissions. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_classic_administrators_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_classic_administrators_operations.py index fd437331b775..c65bd154516a 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_classic_administrators_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_classic_administrators_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -52,20 +51,21 @@ def list( :return: An iterator like instance of ClassicAdministrator :rtype: ~azure.mgmt.authorization.v2015_07_01.models.ClassicAdministratorPaged[~azure.mgmt.authorization.v2015_07_01.models.ClassicAdministrator] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ 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') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -91,9 +91,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_global_administrator_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_global_administrator_operations.py index 78b1739ca7a7..6da7b33f60de 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_global_administrator_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_global_administrator_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -50,14 +49,15 @@ def elevate_access( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.elevate_access.metadata['url'] # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -73,9 +73,7 @@ def elevate_access( 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) if raw: client_raw_response = ClientRawResponse(None, response) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_permissions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_permissions_operations.py index bcd40b7ecacf..6699594dbaf0 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_permissions_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_permissions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -43,8 +42,8 @@ def list_for_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets all permissions the caller has for a resource group. - :param resource_group_name: The name of the resource group to get the - permissions for. The name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -54,21 +53,22 @@ def list_for_resource_group( :return: An iterator like instance of Permission :rtype: ~azure.mgmt.authorization.v2015_07_01.models.PermissionPaged[~azure.mgmt.authorization.v2015_07_01.models.Permission] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -94,9 +94,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 @@ -113,8 +111,8 @@ def list_for_resource( self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): """Gets all permissions the caller has for a resource. - :param resource_group_name: The name of the resource group containing - the resource. The name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -134,25 +132,26 @@ def list_for_resource( :return: An iterator like instance of Permission :rtype: ~azure.mgmt.authorization.v2015_07_01.models.PermissionPaged[~azure.mgmt.authorization.v2015_07_01.models.Permission] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -178,9 +177,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_provider_operations_metadata_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_provider_operations_metadata_operations.py index ce311cb2d563..c7678a8b7067 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_provider_operations_metadata_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_provider_operations_metadata_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,6 +24,7 @@ class ProviderOperationsMetadataOperations(object): :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 use for this operation. Constant value: "2015-07-01". """ models = models @@ -34,18 +34,17 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2015-07-01" self.config = config def get( - self, resource_provider_namespace, api_version, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): + self, resource_provider_namespace, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): """Gets provider operations metadata for the specified resource provider. :param resource_provider_namespace: The namespace of the resource provider. :type resource_provider_namespace: str - :param api_version: The API version to use for the operation. - :type api_version: str :param expand: Specifies whether to expand the values. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -57,7 +56,8 @@ def get( :rtype: ~azure.mgmt.authorization.v2015_07_01.models.ProviderOperationsMetadata or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -68,7 +68,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') @@ -87,9 +87,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: @@ -103,11 +101,9 @@ def get( get.metadata = {'url': '/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}'} def list( - self, api_version, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): + self, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): """Gets provider operations metadata for all resource providers. - :param api_version: The API version to use for this operation. - :type api_version: str :param expand: Specifies whether to expand the values. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -118,7 +114,8 @@ def list( :return: An iterator like instance of ProviderOperationsMetadata :rtype: ~azure.mgmt.authorization.v2015_07_01.models.ProviderOperationsMetadataPaged[~azure.mgmt.authorization.v2015_07_01.models.ProviderOperationsMetadata] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -127,7 +124,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') @@ -155,9 +152,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_assignments_operations.py index 8e3bd0f3e928..19f3bb8987a6 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_assignments_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -43,7 +42,8 @@ def list_for_resource( self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -68,19 +68,20 @@ def list_for_resource( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -88,7 +89,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -114,9 +115,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 @@ -133,7 +132,8 @@ def list_for_resource_group( self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param filter: The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the @@ -148,15 +148,16 @@ def list_for_resource_group( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -164,7 +165,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = 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 @@ -222,7 +221,8 @@ def delete( :return: RoleAssignment or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -234,7 +234,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -250,10 +250,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: @@ -292,7 +290,8 @@ def create( :return: RoleAssignment or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.RoleAssignmentCreateParameters(properties=properties) @@ -306,7 +305,7 @@ def create( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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: @@ -358,7 +355,8 @@ def get( :return: RoleAssignment or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -370,7 +368,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -387,9 +385,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: @@ -421,7 +417,8 @@ def delete_by_id( :return: RoleAssignment or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete_by_id.metadata['url'] @@ -432,7 +429,7 @@ def delete_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -448,10 +445,8 @@ def delete_by_id( 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: @@ -486,7 +481,8 @@ def create_by_id( :return: RoleAssignment or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.RoleAssignmentCreateParameters(properties=properties) @@ -499,7 +495,7 @@ def create_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -520,9 +516,7 @@ def create_by_id( 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: @@ -554,7 +548,8 @@ def get_by_id( :return: RoleAssignment or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -565,7 +560,7 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -582,9 +577,7 @@ def get_by_id( 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: @@ -614,14 +607,15 @@ def list( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ 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') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -629,7 +623,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -655,9 +649,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 @@ -689,7 +681,8 @@ def list_for_scope( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2015_07_01.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -704,7 +697,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -730,9 +723,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_definitions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_definitions_operations.py index 3af909bb9218..5f204d737a5a 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_definitions_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_07_01/operations/_role_definitions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -55,7 +54,8 @@ def delete( :return: RoleDefinition or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -67,7 +67,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -83,10 +83,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: @@ -115,7 +113,8 @@ def get( :return: RoleDefinition or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -127,7 +126,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -144,9 +143,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: @@ -178,7 +175,8 @@ def create_or_update( :return: RoleDefinition or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -190,7 +188,7 @@ def create_or_update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -211,9 +209,7 @@ def create_or_update( 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: @@ -243,7 +239,8 @@ def list( :return: An iterator like instance of RoleDefinition :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleDefinitionPaged[~azure.mgmt.authorization.v2015_07_01.models.RoleDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -258,7 +255,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -284,9 +281,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 @@ -318,7 +313,8 @@ def get_by_id( :return: RoleDefinition or ClientRawResponse if raw=true :rtype: ~azure.mgmt.authorization.v2015_07_01.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -329,7 +325,7 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -346,9 +342,7 @@ def get_by_id( 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: diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py index d8f1cd2bf98b..efe775f30d5f 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py @@ -10,6 +10,9 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import Permission from ._models_py3 import ProviderOperation from ._models_py3 import ProviderOperationsMetadata @@ -20,6 +23,9 @@ from ._models_py3 import RoleDefinition from ._models_py3 import RoleDefinitionFilter except (SyntaxError, ImportError): + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import Permission from ._models import ProviderOperation from ._models import ProviderOperationsMetadata @@ -35,6 +41,9 @@ from ._paged_models import RoleDefinitionPaged __all__ = [ + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'Permission', 'ProviderOperation', 'ProviderOperationsMetadata', diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py index 0dbfaf8253cc..36fa027cca55 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_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.v2018_01_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2018_01_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.v2018_01_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 Permission(Model): """Role definition permissions. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py index 491028a4d4de..7dcd74718128 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_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.v2018_01_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2018_01_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.v2018_01_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 Permission(Model): """Role definition permissions. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_permissions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_permissions_operations.py index e902660afbb6..37f6ec3b8d80 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_permissions_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_permissions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -43,7 +42,8 @@ def list_for_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets all permissions the caller has for a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -53,21 +53,22 @@ def list_for_resource_group( :return: An iterator like instance of Permission :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.PermissionPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.Permission] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -93,9 +94,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 @@ -112,7 +111,8 @@ def list_for_resource( self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): """Gets all permissions the caller has for a resource. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -132,25 +132,26 @@ def list_for_resource( :return: An iterator like instance of Permission :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.PermissionPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.Permission] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -176,9 +177,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_provider_operations_metadata_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_provider_operations_metadata_operations.py index 2376a6b16c7a..363e59e88e77 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_provider_operations_metadata_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_provider_operations_metadata_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -57,7 +56,8 @@ def get( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.ProviderOperationsMetadata or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -68,7 +68,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') @@ -87,9 +87,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: @@ -116,7 +114,8 @@ def list( :return: An iterator like instance of ProviderOperationsMetadata :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.ProviderOperationsMetadataPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.ProviderOperationsMetadata] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -125,7 +124,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') @@ -153,9 +152,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_assignments_operations.py index e951cf39508b..aa414215671d 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_assignments_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -43,7 +42,8 @@ def list_for_resource( self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -68,19 +68,20 @@ def list_for_resource( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -88,7 +89,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -114,9 +115,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 @@ -133,7 +132,8 @@ def list_for_resource_group( self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param filter: The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the @@ -148,15 +148,16 @@ def list_for_resource_group( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -164,7 +165,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = 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.v2018_01_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -235,7 +235,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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.v2018_01_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create.metadata['url'] @@ -306,7 +305,7 @@ def create( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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.v2018_01_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -371,7 +369,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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: @@ -418,7 +414,8 @@ def delete_by_id( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete_by_id.metadata['url'] @@ -429,7 +426,7 @@ def delete_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -445,10 +442,8 @@ def delete_by_id( 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: @@ -479,7 +474,8 @@ def create_by_id( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_by_id.metadata['url'] @@ -490,7 +486,7 @@ def create_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -511,9 +507,7 @@ def create_by_id( 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: @@ -541,7 +535,8 @@ def get_by_id( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -552,7 +547,7 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -569,9 +564,7 @@ def get_by_id( 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,14 +594,15 @@ def list( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ 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') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -616,7 +610,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -642,9 +636,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 +668,8 @@ def list_for_scope( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -691,7 +684,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -717,9 +710,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_definitions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_definitions_operations.py index c921ee6551e8..aa68b30a9baa 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_definitions_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/operations/_role_definitions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -56,7 +55,8 @@ def delete( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -68,7 +68,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -84,10 +84,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: @@ -117,7 +115,8 @@ def get( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -129,7 +128,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -146,9 +145,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: @@ -181,7 +178,8 @@ def create_or_update( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -193,7 +191,7 @@ def create_or_update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -214,9 +212,7 @@ def create_or_update( 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: @@ -246,7 +242,8 @@ def list( :return: An iterator like instance of RoleDefinition :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleDefinitionPaged[~azure.mgmt.authorization.v2018_01_01_preview.models.RoleDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -261,7 +258,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -287,9 +284,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 @@ -322,7 +317,8 @@ def get_by_id( :rtype: ~azure.mgmt.authorization.v2018_01_01_preview.models.RoleDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -333,7 +329,7 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -350,9 +346,7 @@ def get_by_id( 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: 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/v2018_07_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py index 66060cabcd57..51454184dbfe 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py @@ -13,11 +13,17 @@ from ._models_py3 import DenyAssignment from ._models_py3 import DenyAssignmentFilter from ._models_py3 import DenyAssignmentPermission + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import Principal except (SyntaxError, ImportError): from ._models import DenyAssignment from ._models import DenyAssignmentFilter from ._models import DenyAssignmentPermission + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import Principal from ._paged_models import DenyAssignmentPaged @@ -25,6 +31,9 @@ 'DenyAssignment', 'DenyAssignmentFilter', 'DenyAssignmentPermission', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'Principal', 'DenyAssignmentPaged', ] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py index 3f34d4eccca2..5870b0cc4b18 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CloudError(Model): @@ -152,6 +153,112 @@ def __init__(self, **kwargs): self.not_data_actions = kwargs.get('not_data_actions', None) +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.v2018_07_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2018_07_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.v2018_07_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 Principal(Model): """Deny assignment principal. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py index ea24aa033cbd..0033e1e11a54 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CloudError(Model): @@ -152,6 +153,112 @@ def __init__(self, *, actions=None, not_actions=None, data_actions=None, not_dat self.not_data_actions = not_data_actions +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.v2018_07_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2018_07_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.v2018_07_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 Principal(Model): """Deny assignment principal. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/operations/_deny_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/operations/_deny_assignments_operations.py index baf2c93202ad..c076c57a9c05 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/operations/_deny_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/operations/_deny_assignments_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -43,7 +42,8 @@ def list_for_resource( self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets deny assignments for a resource. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -78,15 +78,16 @@ def list_for_resource( :return: An iterator like instance of DenyAssignment :rtype: ~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignmentPaged[~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), @@ -96,7 +97,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') @@ -124,9 +125,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 @@ -143,7 +142,8 @@ def list_for_resource_group( self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets deny assignments for a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param filter: The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or above the @@ -168,21 +168,22 @@ def list_for_resource_group( :return: An iterator like instance of DenyAssignment :rtype: ~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignmentPaged[~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') @@ -210,9 +211,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 @@ -252,20 +251,21 @@ def list( :return: An iterator like instance of DenyAssignment :rtype: ~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignmentPaged[~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ 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') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') @@ -293,9 +293,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 @@ -325,7 +323,8 @@ def get( :rtype: ~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -337,7 +336,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -354,9 +353,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: @@ -389,7 +386,8 @@ def get_by_id( :rtype: ~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -400,7 +398,7 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -417,9 +415,7 @@ def get_by_id( 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: @@ -461,7 +457,8 @@ def list_for_scope( :return: An iterator like instance of DenyAssignment :rtype: ~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignmentPaged[~azure.mgmt.authorization.v2018_07_01_preview.models.DenyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -474,7 +471,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') @@ -502,9 +499,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/__init__.py index 7fa9d33fff9d..b9da08d124b5 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_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/v2018_09_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models.py index 18d880b6cc49..a298d0f9f60c 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_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.v2018_09_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2018_09_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.v2018_09_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. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models_py3.py index a0bb24a96def..bd76702bd208 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_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.v2018_09_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2018_09_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.v2018_09_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. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/operations/_role_assignments_operations.py index 6fbe84aa3234..3386785da297 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/operations/_role_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/operations/_role_assignments_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -43,7 +42,8 @@ def list_for_resource( self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -68,19 +68,20 @@ def list_for_resource( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -88,7 +89,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -114,9 +115,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 @@ -133,7 +132,8 @@ def list_for_resource_group( self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param filter: The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the @@ -148,15 +148,16 @@ def list_for_resource_group( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -164,7 +165,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = 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.v2018_09_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -235,7 +235,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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.v2018_09_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create.metadata['url'] @@ -306,7 +305,7 @@ def create( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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.v2018_09_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -371,7 +369,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -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: @@ -418,7 +414,8 @@ def delete_by_id( :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete_by_id.metadata['url'] @@ -429,7 +426,7 @@ def delete_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -445,10 +442,8 @@ def delete_by_id( 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: @@ -479,7 +474,8 @@ def create_by_id( :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_by_id.metadata['url'] @@ -490,7 +486,7 @@ def create_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -511,9 +507,7 @@ def create_by_id( 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: @@ -541,7 +535,8 @@ def get_by_id( :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -552,7 +547,7 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -569,9 +564,7 @@ def get_by_id( 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,14 +594,15 @@ def list( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ 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') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -616,7 +610,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -642,9 +636,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 +668,8 @@ def list_for_scope( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2018_09_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -691,7 +684,7 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -717,9 +710,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 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..bcc3b99db556 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): @@ -108,7 +236,7 @@ class RoleAssignmentCreateParameters(Model): :param principal_type: The principal type of the assigned principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', - 'DirectoryObjectOrGroup', 'Everyone' + 'DirectoryObjectOrGroup', 'Everyone'. Default value: "User" . :type principal_type: str or ~azure.mgmt.authorization.v2020_04_01_preview.models.PrincipalType :param can_delegate: The delegation flag used for creating a role @@ -116,10 +244,17 @@ 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 + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -135,17 +270,19 @@ class RoleAssignmentCreateParameters(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } def __init__(self, **kwargs): super(RoleAssignmentCreateParameters, self).__init__(**kwargs) self.role_definition_id = kwargs.get('role_definition_id', None) self.principal_id = kwargs.get('principal_id', None) - self.principal_type = kwargs.get('principal_type', None) + self.principal_type = kwargs.get('principal_type', "User") self.can_delegate = kwargs.get('can_delegate', None) self.description = kwargs.get('description', None) self.condition = kwargs.get('condition', None) self.condition_version = kwargs.get('condition_version', None) + self.delegated_managed_identity_resource_id = kwargs.get('delegated_managed_identity_resource_id', None) class RoleAssignmentFilter(Model): 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..7e08c40d33d6 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): @@ -108,7 +236,7 @@ class RoleAssignmentCreateParameters(Model): :param principal_type: The principal type of the assigned principal ID. Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', - 'DirectoryObjectOrGroup', 'Everyone' + 'DirectoryObjectOrGroup', 'Everyone'. Default value: "User" . :type principal_type: str or ~azure.mgmt.authorization.v2020_04_01_preview.models.PrincipalType :param can_delegate: The delegation flag used for creating a role @@ -116,10 +244,17 @@ 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 + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -135,9 +270,10 @@ class RoleAssignmentCreateParameters(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } - def __init__(self, *, role_definition_id: str, principal_id: str, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, **kwargs) -> None: + def __init__(self, *, role_definition_id: str, principal_id: str, principal_type="User", can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, delegated_managed_identity_resource_id: str=None, **kwargs) -> None: super(RoleAssignmentCreateParameters, self).__init__(**kwargs) self.role_definition_id = role_definition_id self.principal_id = principal_id @@ -146,6 +282,7 @@ def __init__(self, *, role_definition_id: str, principal_id: str, principal_type self.description = description self.condition = condition self.condition_version = condition_version + self.delegated_managed_identity_resource_id = delegated_managed_identity_resource_id class RoleAssignmentFilter(Model): 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..4108ddafa8b5 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -40,10 +39,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_for_resource( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets role assignments for a resource. + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """List role assignments for a resource. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_provider_namespace: The namespace of the resource provider. @@ -60,6 +60,8 @@ def list_for_resource( scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -68,19 +70,20 @@ def list_for_resource( :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: # Construct URL url = self.list_for_resource.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -88,7 +91,9 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') else: url = next_link @@ -114,9 +119,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 @@ -130,16 +133,19 @@ def internal_paging(next_link=None): list_for_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments'} def list_for_resource_group( - self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets role assignments for a resource group. + self, resource_group_name, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """List role assignments for a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param filter: The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -148,15 +154,16 @@ 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: # Construct URL url = self.list_for_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -164,7 +171,9 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') else: url = next_link @@ -190,9 +199,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 @@ -206,14 +213,16 @@ def internal_paging(next_link=None): list_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments'} def delete( - self, scope, role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Deletes a role assignment. + self, scope, role_assignment_name, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """Delete a role assignment. :param scope: The scope of the role assignment to delete. :type scope: str :param role_assignment_name: The name of the role assignment to delete. :type role_assignment_name: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -223,7 +232,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'] @@ -235,7 +245,9 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') # Construct headers header_parameters = {} @@ -251,10 +263,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: @@ -269,7 +279,7 @@ def delete( def create( self, scope, role_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates a role assignment. + """Create a role assignment. :param scope: The scope of the role assignment to create. The scope can be any REST resource instance. For example, use @@ -294,7 +304,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'] @@ -306,7 +317,7 @@ def create( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -327,9 +338,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: @@ -343,13 +352,15 @@ def create( create.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'} def get( - self, scope, role_assignment_name, custom_headers=None, raw=False, **operation_config): + self, scope, role_assignment_name, tenant_id=None, custom_headers=None, raw=False, **operation_config): """Get the specified role assignment. :param scope: The scope of the role assignment. :type scope: str :param role_assignment_name: The name of the role assignment to get. :type role_assignment_name: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -359,7 +370,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'] @@ -371,7 +383,9 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') # Construct headers header_parameters = {} @@ -388,9 +402,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: @@ -404,11 +416,13 @@ def get( get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'} def delete_by_id( - self, role_id, custom_headers=None, raw=False, **operation_config): - """Deletes a role assignment. + self, role_id, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """Delete a role assignment. :param role_id: The ID of the role assignment to delete. :type role_id: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -418,7 +432,8 @@ def delete_by_id( :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_by_id.metadata['url'] @@ -429,7 +444,9 @@ def delete_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') # Construct headers header_parameters = {} @@ -445,10 +462,8 @@ def delete_by_id( 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: @@ -479,7 +494,8 @@ def create_by_id( :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_by_id.metadata['url'] @@ -490,7 +506,7 @@ def create_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -511,9 +527,7 @@ def create_by_id( 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: @@ -527,11 +541,13 @@ def create_by_id( create_by_id.metadata = {'url': '/{roleId}'} def get_by_id( - self, role_id, custom_headers=None, raw=False, **operation_config): + self, role_id, tenant_id=None, custom_headers=None, raw=False, **operation_config): """Gets a role assignment by ID. :param role_id: The ID of the role assignment to get. :type role_id: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -541,7 +557,8 @@ def get_by_id( :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_by_id.metadata['url'] @@ -552,7 +569,9 @@ def get_by_id( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') # Construct headers header_parameters = {} @@ -569,9 +588,7 @@ def get_by_id( 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: @@ -585,7 +602,7 @@ def get_by_id( get_by_id.metadata = {'url': '/{roleId}'} def list( - self, filter=None, custom_headers=None, raw=False, **operation_config): + self, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): """Gets all role assignments for the subscription. :param filter: The filter to apply on the operation. Use @@ -593,6 +610,8 @@ def list( scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -601,14 +620,15 @@ 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: # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -616,7 +636,9 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') else: url = next_link @@ -642,9 +664,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 @@ -658,7 +678,7 @@ def internal_paging(next_link=None): list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments'} def list_for_scope( - self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + self, scope, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a scope. :param scope: The scope of the role assignments. @@ -668,6 +688,8 @@ def list_for_scope( scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 @@ -676,7 +698,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: @@ -691,7 +714,9 @@ def prepare_request(next_link=None): query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, 'str') else: url = next_link @@ -717,9 +742,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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/__init__.py new file mode 100644 index 000000000000..e8714b719dfc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_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/v2020_10_01_preview/_authorization_management_client.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/_authorization_management_client.py new file mode 100644 index 000000000000..1c7a6b6a9f9e --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/_authorization_management_client.py @@ -0,0 +1,94 @@ +# 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 RoleAssignmentSchedulesOperations +from .operations import RoleAssignmentScheduleInstancesOperations +from .operations import RoleAssignmentScheduleRequestsOperations +from .operations import RoleEligibilitySchedulesOperations +from .operations import RoleEligibilityScheduleInstancesOperations +from .operations import RoleEligibilityScheduleRequestsOperations +from .operations import RoleManagementPoliciesOperations +from .operations import RoleManagementPolicyAssignmentsOperations +from .operations import EligibleChildResourcesOperations +from .operations import RoleAssignmentsOperations +from . import models + + +class AuthorizationManagementClient(SDKClient): + """AuthorizationManagementClient + + :ivar config: Configuration for client. + :vartype config: AuthorizationManagementClientConfiguration + + :ivar role_assignment_schedules: RoleAssignmentSchedules operations + :vartype role_assignment_schedules: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleAssignmentSchedulesOperations + :ivar role_assignment_schedule_instances: RoleAssignmentScheduleInstances operations + :vartype role_assignment_schedule_instances: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleAssignmentScheduleInstancesOperations + :ivar role_assignment_schedule_requests: RoleAssignmentScheduleRequests operations + :vartype role_assignment_schedule_requests: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleAssignmentScheduleRequestsOperations + :ivar role_eligibility_schedules: RoleEligibilitySchedules operations + :vartype role_eligibility_schedules: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleEligibilitySchedulesOperations + :ivar role_eligibility_schedule_instances: RoleEligibilityScheduleInstances operations + :vartype role_eligibility_schedule_instances: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleEligibilityScheduleInstancesOperations + :ivar role_eligibility_schedule_requests: RoleEligibilityScheduleRequests operations + :vartype role_eligibility_schedule_requests: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleEligibilityScheduleRequestsOperations + :ivar role_management_policies: RoleManagementPolicies operations + :vartype role_management_policies: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleManagementPoliciesOperations + :ivar role_management_policy_assignments: RoleManagementPolicyAssignments operations + :vartype role_management_policy_assignments: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleManagementPolicyAssignmentsOperations + :ivar eligible_child_resources: EligibleChildResources operations + :vartype eligible_child_resources: azure.mgmt.authorization.v2020_10_01_preview.operations.EligibleChildResourcesOperations + :ivar role_assignments: RoleAssignments operations + :vartype role_assignments: azure.mgmt.authorization.v2020_10_01_preview.operations.RoleAssignmentsOperations + + :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 = '2020-10-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.role_assignment_schedules = RoleAssignmentSchedulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_assignment_schedule_instances = RoleAssignmentScheduleInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_assignment_schedule_requests = RoleAssignmentScheduleRequestsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_eligibility_schedules = RoleEligibilitySchedulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_eligibility_schedule_instances = RoleEligibilityScheduleInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_eligibility_schedule_requests = RoleEligibilityScheduleRequestsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_management_policies = RoleManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_management_policy_assignments = RoleManagementPolicyAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.eligible_child_resources = EligibleChildResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_assignments = RoleAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/_configuration.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/_configuration.py new file mode 100644 index 000000000000..c192b8088f15 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_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/v2020_10_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/__init__.py new file mode 100644 index 000000000000..3b507a323c2f --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/__init__.py @@ -0,0 +1,214 @@ +# 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 ApprovalSettings + from ._models_py3 import ApprovalStage + from ._models_py3 import EligibleChildResource + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ExpandedProperties + from ._models_py3 import ExpandedPropertiesPrincipal + from ._models_py3 import ExpandedPropertiesRoleDefinition + from ._models_py3 import ExpandedPropertiesScope + from ._models_py3 import PolicyAssignmentProperties + from ._models_py3 import PolicyAssignmentPropertiesPolicy + from ._models_py3 import PolicyAssignmentPropertiesRoleDefinition + from ._models_py3 import PolicyAssignmentPropertiesScope + from ._models_py3 import PolicyProperties + from ._models_py3 import PolicyPropertiesScope + from ._models_py3 import Principal + from ._models_py3 import RoleAssignment + from ._models_py3 import RoleAssignmentCreateParameters + from ._models_py3 import RoleAssignmentFilter + from ._models_py3 import RoleAssignmentSchedule + from ._models_py3 import RoleAssignmentScheduleFilter + from ._models_py3 import RoleAssignmentScheduleInstance + from ._models_py3 import RoleAssignmentScheduleInstanceFilter + from ._models_py3 import RoleAssignmentScheduleRequest + from ._models_py3 import RoleAssignmentScheduleRequestFilter + from ._models_py3 import RoleAssignmentScheduleRequestPropertiesScheduleInfo + from ._models_py3 import RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + from ._models_py3 import RoleAssignmentScheduleRequestPropertiesTicketInfo + from ._models_py3 import RoleEligibilitySchedule + from ._models_py3 import RoleEligibilityScheduleFilter + from ._models_py3 import RoleEligibilityScheduleInstance + from ._models_py3 import RoleEligibilityScheduleInstanceFilter + from ._models_py3 import RoleEligibilityScheduleRequest + from ._models_py3 import RoleEligibilityScheduleRequestFilter + from ._models_py3 import RoleEligibilityScheduleRequestPropertiesScheduleInfo + from ._models_py3 import RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + from ._models_py3 import RoleEligibilityScheduleRequestPropertiesTicketInfo + from ._models_py3 import RoleManagementPolicy + from ._models_py3 import RoleManagementPolicyApprovalRule + from ._models_py3 import RoleManagementPolicyAssignment + from ._models_py3 import RoleManagementPolicyAuthenticationContextRule + from ._models_py3 import RoleManagementPolicyEnablementRule + from ._models_py3 import RoleManagementPolicyExpirationRule + from ._models_py3 import RoleManagementPolicyNotificationRule + from ._models_py3 import RoleManagementPolicyRule + from ._models_py3 import RoleManagementPolicyRuleTarget + from ._models_py3 import UserSet + from ._models_py3 import ValidationResponse + from ._models_py3 import ValidationResponseErrorInfo +except (SyntaxError, ImportError): + from ._models import ApprovalSettings + from ._models import ApprovalStage + from ._models import EligibleChildResource + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException + from ._models import ExpandedProperties + from ._models import ExpandedPropertiesPrincipal + from ._models import ExpandedPropertiesRoleDefinition + from ._models import ExpandedPropertiesScope + from ._models import PolicyAssignmentProperties + from ._models import PolicyAssignmentPropertiesPolicy + from ._models import PolicyAssignmentPropertiesRoleDefinition + from ._models import PolicyAssignmentPropertiesScope + from ._models import PolicyProperties + from ._models import PolicyPropertiesScope + from ._models import Principal + from ._models import RoleAssignment + from ._models import RoleAssignmentCreateParameters + from ._models import RoleAssignmentFilter + from ._models import RoleAssignmentSchedule + from ._models import RoleAssignmentScheduleFilter + from ._models import RoleAssignmentScheduleInstance + from ._models import RoleAssignmentScheduleInstanceFilter + from ._models import RoleAssignmentScheduleRequest + from ._models import RoleAssignmentScheduleRequestFilter + from ._models import RoleAssignmentScheduleRequestPropertiesScheduleInfo + from ._models import RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + from ._models import RoleAssignmentScheduleRequestPropertiesTicketInfo + from ._models import RoleEligibilitySchedule + from ._models import RoleEligibilityScheduleFilter + from ._models import RoleEligibilityScheduleInstance + from ._models import RoleEligibilityScheduleInstanceFilter + from ._models import RoleEligibilityScheduleRequest + from ._models import RoleEligibilityScheduleRequestFilter + from ._models import RoleEligibilityScheduleRequestPropertiesScheduleInfo + from ._models import RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + from ._models import RoleEligibilityScheduleRequestPropertiesTicketInfo + from ._models import RoleManagementPolicy + from ._models import RoleManagementPolicyApprovalRule + from ._models import RoleManagementPolicyAssignment + from ._models import RoleManagementPolicyAuthenticationContextRule + from ._models import RoleManagementPolicyEnablementRule + from ._models import RoleManagementPolicyExpirationRule + from ._models import RoleManagementPolicyNotificationRule + from ._models import RoleManagementPolicyRule + from ._models import RoleManagementPolicyRuleTarget + from ._models import UserSet + from ._models import ValidationResponse + from ._models import ValidationResponseErrorInfo +from ._paged_models import EligibleChildResourcePaged +from ._paged_models import RoleAssignmentPaged +from ._paged_models import RoleAssignmentScheduleInstancePaged +from ._paged_models import RoleAssignmentSchedulePaged +from ._paged_models import RoleAssignmentScheduleRequestPaged +from ._paged_models import RoleEligibilityScheduleInstancePaged +from ._paged_models import RoleEligibilitySchedulePaged +from ._paged_models import RoleEligibilityScheduleRequestPaged +from ._paged_models import RoleManagementPolicyAssignmentPaged +from ._paged_models import RoleManagementPolicyPaged +from ._authorization_management_client_enums import ( + PrincipalType, + AssignmentType, + MemberType, + Status, + RequestType, + Type, + ApprovalMode, + UserType, + EnablementRules, + NotificationDeliveryMechanism, + NotificationLevel, + RecipientType, + RoleManagementPolicyRuleType, +) + +__all__ = [ + 'ApprovalSettings', + 'ApprovalStage', + 'EligibleChildResource', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', + 'ExpandedProperties', + 'ExpandedPropertiesPrincipal', + 'ExpandedPropertiesRoleDefinition', + 'ExpandedPropertiesScope', + 'PolicyAssignmentProperties', + 'PolicyAssignmentPropertiesPolicy', + 'PolicyAssignmentPropertiesRoleDefinition', + 'PolicyAssignmentPropertiesScope', + 'PolicyProperties', + 'PolicyPropertiesScope', + 'Principal', + 'RoleAssignment', + 'RoleAssignmentCreateParameters', + 'RoleAssignmentFilter', + 'RoleAssignmentSchedule', + 'RoleAssignmentScheduleFilter', + 'RoleAssignmentScheduleInstance', + 'RoleAssignmentScheduleInstanceFilter', + 'RoleAssignmentScheduleRequest', + 'RoleAssignmentScheduleRequestFilter', + 'RoleAssignmentScheduleRequestPropertiesScheduleInfo', + 'RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration', + 'RoleAssignmentScheduleRequestPropertiesTicketInfo', + 'RoleEligibilitySchedule', + 'RoleEligibilityScheduleFilter', + 'RoleEligibilityScheduleInstance', + 'RoleEligibilityScheduleInstanceFilter', + 'RoleEligibilityScheduleRequest', + 'RoleEligibilityScheduleRequestFilter', + 'RoleEligibilityScheduleRequestPropertiesScheduleInfo', + 'RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration', + 'RoleEligibilityScheduleRequestPropertiesTicketInfo', + 'RoleManagementPolicy', + 'RoleManagementPolicyApprovalRule', + 'RoleManagementPolicyAssignment', + 'RoleManagementPolicyAuthenticationContextRule', + 'RoleManagementPolicyEnablementRule', + 'RoleManagementPolicyExpirationRule', + 'RoleManagementPolicyNotificationRule', + 'RoleManagementPolicyRule', + 'RoleManagementPolicyRuleTarget', + 'UserSet', + 'ValidationResponse', + 'ValidationResponseErrorInfo', + 'RoleAssignmentSchedulePaged', + 'RoleAssignmentScheduleInstancePaged', + 'RoleAssignmentScheduleRequestPaged', + 'RoleEligibilitySchedulePaged', + 'RoleEligibilityScheduleInstancePaged', + 'RoleEligibilityScheduleRequestPaged', + 'RoleManagementPolicyPaged', + 'RoleManagementPolicyAssignmentPaged', + 'EligibleChildResourcePaged', + 'RoleAssignmentPaged', + 'PrincipalType', + 'AssignmentType', + 'MemberType', + 'Status', + 'RequestType', + 'Type', + 'ApprovalMode', + 'UserType', + 'EnablementRules', + 'NotificationDeliveryMechanism', + 'NotificationLevel', + 'RecipientType', + 'RoleManagementPolicyRuleType', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_authorization_management_client_enums.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_authorization_management_client_enums.py new file mode 100644 index 000000000000..548a8863526a --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_authorization_management_client_enums.py @@ -0,0 +1,135 @@ +# 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 PrincipalType(str, Enum): + + user = "User" + group = "Group" + service_principal = "ServicePrincipal" + unknown = "Unknown" + directory_role_template = "DirectoryRoleTemplate" + foreign_group = "ForeignGroup" + application = "Application" + msi = "MSI" + directory_object_or_group = "DirectoryObjectOrGroup" + everyone = "Everyone" + device = "Device" + + +class AssignmentType(str, Enum): + + activated = "Activated" + assigned = "Assigned" + + +class MemberType(str, Enum): + + inherited = "Inherited" + direct = "Direct" + group = "Group" + + +class Status(str, Enum): + + accepted = "Accepted" + pending_evaluation = "PendingEvaluation" + granted = "Granted" + denied = "Denied" + pending_provisioning = "PendingProvisioning" + provisioned = "Provisioned" + pending_revocation = "PendingRevocation" + revoked = "Revoked" + canceled = "Canceled" + failed = "Failed" + pending_approval_provisioning = "PendingApprovalProvisioning" + pending_approval = "PendingApproval" + failed_as_resource_is_locked = "FailedAsResourceIsLocked" + pending_admin_decision = "PendingAdminDecision" + admin_approved = "AdminApproved" + admin_denied = "AdminDenied" + timed_out = "TimedOut" + provisioning_started = "ProvisioningStarted" + invalid = "Invalid" + pending_schedule_creation = "PendingScheduleCreation" + schedule_created = "ScheduleCreated" + pending_external_provisioning = "PendingExternalProvisioning" + + +class RequestType(str, Enum): + + admin_assign = "AdminAssign" + admin_remove = "AdminRemove" + admin_update = "AdminUpdate" + admin_extend = "AdminExtend" + admin_renew = "AdminRenew" + self_activate = "SelfActivate" + self_deactivate = "SelfDeactivate" + self_extend = "SelfExtend" + self_renew = "SelfRenew" + + +class Type(str, Enum): + + after_duration = "AfterDuration" + after_date_time = "AfterDateTime" + no_expiration = "NoExpiration" + + +class ApprovalMode(str, Enum): + + single_stage = "SingleStage" + serial = "Serial" + parallel = "Parallel" + no_approval = "NoApproval" + + +class UserType(str, Enum): + + user = "User" + group = "Group" + + +class EnablementRules(str, Enum): + + multi_factor_authentication = "MultiFactorAuthentication" + justification = "Justification" + ticketing = "Ticketing" + + +class NotificationDeliveryMechanism(str, Enum): + + email = "Email" + + +class NotificationLevel(str, Enum): + + none = "None" + critical = "Critical" + all = "All" + + +class RecipientType(str, Enum): + + requestor = "Requestor" + approver = "Approver" + admin = "Admin" + + +class RoleManagementPolicyRuleType(str, Enum): + + role_management_policy_approval_rule = "RoleManagementPolicyApprovalRule" + role_management_policy_authentication_context_rule = "RoleManagementPolicyAuthenticationContextRule" + role_management_policy_enablement_rule = "RoleManagementPolicyEnablementRule" + role_management_policy_expiration_rule = "RoleManagementPolicyExpirationRule" + role_management_policy_notification_rule = "RoleManagementPolicyNotificationRule" diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models.py new file mode 100644 index 000000000000..e775cf614882 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models.py @@ -0,0 +1,2322 @@ +# 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 ApprovalSettings(Model): + """The approval settings. + + :param is_approval_required: Determine whether approval is required or + not. + :type is_approval_required: bool + :param is_approval_required_for_extension: Determine whether approval is + required for assignment extension. + :type is_approval_required_for_extension: bool + :param is_requestor_justification_required: Determine whether requestor + justification required. + :type is_requestor_justification_required: bool + :param approval_mode: The type of rule. Possible values include: + 'SingleStage', 'Serial', 'Parallel', 'NoApproval' + :type approval_mode: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.ApprovalMode + :param approval_stages: The approval stages of the request. + :type approval_stages: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.ApprovalStage] + """ + + _attribute_map = { + 'is_approval_required': {'key': 'isApprovalRequired', 'type': 'bool'}, + 'is_approval_required_for_extension': {'key': 'isApprovalRequiredForExtension', 'type': 'bool'}, + 'is_requestor_justification_required': {'key': 'isRequestorJustificationRequired', 'type': 'bool'}, + 'approval_mode': {'key': 'approvalMode', 'type': 'str'}, + 'approval_stages': {'key': 'approvalStages', 'type': '[ApprovalStage]'}, + } + + def __init__(self, **kwargs): + super(ApprovalSettings, self).__init__(**kwargs) + self.is_approval_required = kwargs.get('is_approval_required', None) + self.is_approval_required_for_extension = kwargs.get('is_approval_required_for_extension', None) + self.is_requestor_justification_required = kwargs.get('is_requestor_justification_required', None) + self.approval_mode = kwargs.get('approval_mode', None) + self.approval_stages = kwargs.get('approval_stages', None) + + +class ApprovalStage(Model): + """The approval stage. + + :param approval_stage_time_out_in_days: The time in days when approval + request would be timed out. + :type approval_stage_time_out_in_days: int + :param is_approver_justification_required: Determine whether approver need + to provide justification for his decision. + :type is_approver_justification_required: bool + :param escalation_time_in_minutes: The time in minutes when the approval + request would be escalated if the primary approver does not approves. + :type escalation_time_in_minutes: int + :param primary_approvers: The primary approver of the request. + :type primary_approvers: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.UserSet] + :param is_escalation_enabled: The value determine whether escalation + feature is enabled. + :type is_escalation_enabled: bool + :param escalation_approvers: The escalation approver of the request. + :type escalation_approvers: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.UserSet] + """ + + _attribute_map = { + 'approval_stage_time_out_in_days': {'key': 'approvalStageTimeOutInDays', 'type': 'int'}, + 'is_approver_justification_required': {'key': 'isApproverJustificationRequired', 'type': 'bool'}, + 'escalation_time_in_minutes': {'key': 'escalationTimeInMinutes', 'type': 'int'}, + 'primary_approvers': {'key': 'primaryApprovers', 'type': '[UserSet]'}, + 'is_escalation_enabled': {'key': 'isEscalationEnabled', 'type': 'bool'}, + 'escalation_approvers': {'key': 'escalationApprovers', 'type': '[UserSet]'}, + } + + def __init__(self, **kwargs): + super(ApprovalStage, self).__init__(**kwargs) + self.approval_stage_time_out_in_days = kwargs.get('approval_stage_time_out_in_days', None) + self.is_approver_justification_required = kwargs.get('is_approver_justification_required', None) + self.escalation_time_in_minutes = kwargs.get('escalation_time_in_minutes', None) + self.primary_approvers = kwargs.get('primary_approvers', None) + self.is_escalation_enabled = kwargs.get('is_escalation_enabled', None) + self.escalation_approvers = kwargs.get('escalation_approvers', None) + + +class CloudError(Model): + """An error response from the service. + + :param error: + :type error: + ~azure.mgmt.authorization.v2020_10_01_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class EligibleChildResource(Model): + """Eligible child resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource scope Id. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(EligibleChildResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +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_10_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2020_10_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_10_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 ExpandedProperties(Model): + """ExpandedProperties. + + :param scope: Details of the resource scope + :type scope: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedPropertiesScope + :param role_definition: Details of role definition + :type role_definition: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedPropertiesRoleDefinition + :param principal: Details of the principal + :type principal: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedPropertiesPrincipal + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'ExpandedPropertiesScope'}, + 'role_definition': {'key': 'roleDefinition', 'type': 'ExpandedPropertiesRoleDefinition'}, + 'principal': {'key': 'principal', 'type': 'ExpandedPropertiesPrincipal'}, + } + + def __init__(self, **kwargs): + super(ExpandedProperties, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + self.role_definition = kwargs.get('role_definition', None) + self.principal = kwargs.get('principal', None) + + +class ExpandedPropertiesPrincipal(Model): + """Details of the principal. + + :param id: Id of the principal + :type id: str + :param display_name: Display name of the principal + :type display_name: str + :param email: Email id of the principal + :type email: str + :param type: Type of the principal + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpandedPropertiesPrincipal, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.email = kwargs.get('email', None) + self.type = kwargs.get('type', None) + + +class ExpandedPropertiesRoleDefinition(Model): + """Details of role definition. + + :param id: Id of the role definition + :type id: str + :param display_name: Display name of the role definition + :type display_name: str + :param type: Type of the role definition + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpandedPropertiesRoleDefinition, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + + +class ExpandedPropertiesScope(Model): + """Details of the resource scope. + + :param id: Scope id of the resource + :type id: str + :param display_name: Display name of the resource + :type display_name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpandedPropertiesScope, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + + +class PolicyAssignmentProperties(Model): + """PolicyAssignmentProperties. + + :param scope: Details of the resource scope + :type scope: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentPropertiesScope + :param role_definition: Details of role definition + :type role_definition: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentPropertiesRoleDefinition + :param policy: Details of the policy + :type policy: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentPropertiesPolicy + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'PolicyAssignmentPropertiesScope'}, + 'role_definition': {'key': 'roleDefinition', 'type': 'PolicyAssignmentPropertiesRoleDefinition'}, + 'policy': {'key': 'policy', 'type': 'PolicyAssignmentPropertiesPolicy'}, + } + + def __init__(self, **kwargs): + super(PolicyAssignmentProperties, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + self.role_definition = kwargs.get('role_definition', None) + self.policy = kwargs.get('policy', None) + + +class PolicyAssignmentPropertiesPolicy(Model): + """Details of the policy. + + :param id: Id of the policy + :type id: str + :param last_modified_by: + :type last_modified_by: + ~azure.mgmt.authorization.v2020_10_01_preview.models.Principal + :param last_modified_date_time: The last modified date time. + :type last_modified_date_time: datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'Principal'}, + 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(PolicyAssignmentPropertiesPolicy, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_date_time = kwargs.get('last_modified_date_time', None) + + +class PolicyAssignmentPropertiesRoleDefinition(Model): + """Details of role definition. + + :param id: Id of the role definition + :type id: str + :param display_name: Display name of the role definition + :type display_name: str + :param type: Type of the role definition + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyAssignmentPropertiesRoleDefinition, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + + +class PolicyAssignmentPropertiesScope(Model): + """Details of the resource scope. + + :param id: Scope id of the resource + :type id: str + :param display_name: Display name of the resource + :type display_name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyAssignmentPropertiesScope, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + + +class PolicyProperties(Model): + """PolicyProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar scope: Details of the resource scope + :vartype scope: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyPropertiesScope + """ + + _validation = { + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'PolicyPropertiesScope'}, + } + + def __init__(self, **kwargs): + super(PolicyProperties, self).__init__(**kwargs) + self.scope = None + + +class PolicyPropertiesScope(Model): + """Details of the resource scope. + + :param id: Scope id of the resource + :type id: str + :param display_name: Display name of the resource + :type display_name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyPropertiesScope, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + + +class Principal(Model): + """The name of the entity last modified it. + + :param id: The id of the principal made changes + :type id: str + :param display_name: The name of the principal made changes + :type display_name: str + :param type: Type of principal such as user , group etc + :type type: str + :param email: Email of principal + :type email: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Principal, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + self.email = kwargs.get('email', None) + + +class RoleAssignment(Model): + """Role Assignments. + + 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. + + :ivar id: The role assignment ID. + :vartype id: str + :ivar name: The role assignment name. + :vartype name: str + :ivar type: The role assignment type. + :vartype type: str + :ivar scope: The role assignment scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device'. Default value: "User" . + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param description: Description of role assignment + :type description: str + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: Time it was created + :vartype created_on: datetime + :ivar updated_on: Time it was updated + :vartype updated_on: datetime + :ivar created_by: Id of the user who created the assignment + :vartype created_by: str + :ivar updated_by: Id of the user who updated the assignment + :vartype updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'created_on': {'readonly': True}, + 'updated_on': {'readonly': True}, + 'created_by': {'readonly': True}, + 'updated_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + '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): + super(RoleAssignment, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = None + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = kwargs.get('principal_type', "User") + self.description = kwargs.get('description', None) + self.condition = kwargs.get('condition', None) + self.condition_version = kwargs.get('condition_version', None) + self.created_on = None + self.updated_on = None + self.created_by = None + self.updated_by = None + self.delegated_managed_identity_resource_id = kwargs.get('delegated_managed_identity_resource_id', None) + + +class RoleAssignmentCreateParameters(Model): + """Role assignment create parameters. + + 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. + + :ivar scope: The role assignment scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device'. Default value: "User" . + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param description: Description of role assignment + :type description: str + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: Time it was created + :vartype created_on: datetime + :ivar updated_on: Time it was updated + :vartype updated_on: datetime + :ivar created_by: Id of the user who created the assignment + :vartype created_by: str + :ivar updated_by: Id of the user who updated the assignment + :vartype updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str + """ + + _validation = { + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'created_on': {'readonly': True}, + 'updated_on': {'readonly': True}, + 'created_by': {'readonly': True}, + 'updated_by': {'readonly': True}, + } + + _attribute_map = { + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + '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): + super(RoleAssignmentCreateParameters, self).__init__(**kwargs) + self.scope = None + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = kwargs.get('principal_type', "User") + self.description = kwargs.get('description', None) + self.condition = kwargs.get('condition', None) + self.condition_version = kwargs.get('condition_version', None) + self.created_on = None + self.updated_on = None + self.created_by = None + self.updated_by = None + self.delegated_managed_identity_resource_id = kwargs.get('delegated_managed_identity_resource_id', None) + + +class RoleAssignmentFilter(Model): + """Role Assignments filter. + + :param principal_id: Returns role assignment of the specific principal. + :type principal_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + + +class RoleAssignmentSchedule(Model): + """Role Assignment schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment schedule Id. + :vartype id: str + :ivar name: The role assignment schedule name. + :vartype name: str + :ivar type: The role assignment schedule type. + :vartype type: str + :param scope: The role assignment schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_assignment_schedule_request_id: The id of + roleAssignmentScheduleRequest used to create this roleAssignmentSchedule + :type role_assignment_schedule_request_id: str + :param linked_role_eligibility_schedule_id: The id of + roleEligibilitySchedule used to activated this roleAssignmentSchedule + :type linked_role_eligibility_schedule_id: str + :param assignment_type: Assignment type of the role assignment schedule. + Possible values include: 'Activated', 'Assigned' + :type assignment_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.AssignmentType + :param member_type: Membership type of the role assignment schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :param status: The status of the role assignment schedule. Possible values + include: 'Accepted', 'PendingEvaluation', 'Granted', 'Denied', + 'PendingProvisioning', 'Provisioned', 'PendingRevocation', 'Revoked', + 'Canceled', 'Failed', 'PendingApprovalProvisioning', 'PendingApproval', + 'FailedAsResourceIsLocked', 'PendingAdminDecision', 'AdminApproved', + 'AdminDenied', 'TimedOut', 'ProvisioningStarted', 'Invalid', + 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: Start DateTime when role assignment schedule + :type start_date_time: datetime + :param end_date_time: End DateTime when role assignment schedule + :type end_date_time: datetime + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role assignment schedule was created + :type created_on: datetime + :param updated_on: DateTime when role assignment schedule was modified + :type updated_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_assignment_schedule_request_id': {'key': 'properties.roleAssignmentScheduleRequestId', 'type': 'str'}, + 'linked_role_eligibility_schedule_id': {'key': 'properties.linkedRoleEligibilityScheduleId', 'type': 'str'}, + 'assignment_type': {'key': 'properties.assignmentType', 'type': 'str'}, + 'member_type': {'key': 'properties.memberType', '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'}, + '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'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = kwargs.get('scope', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.role_assignment_schedule_request_id = kwargs.get('role_assignment_schedule_request_id', None) + self.linked_role_eligibility_schedule_id = kwargs.get('linked_role_eligibility_schedule_id', None) + self.assignment_type = kwargs.get('assignment_type', None) + self.member_type = kwargs.get('member_type', None) + self.status = kwargs.get('status', None) + self.start_date_time = kwargs.get('start_date_time', None) + self.end_date_time = kwargs.get('end_date_time', 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.expanded_properties = kwargs.get('expanded_properties', None) + + +class RoleAssignmentScheduleFilter(Model): + """Role assignment schedule filter. + + :param principal_id: Returns role assignment schedule of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role assignment schedule of the + specific role definition. + :type role_definition_id: str + :param status: Returns role assignment schedule instances of the specific + status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.status = kwargs.get('status', None) + + +class RoleAssignmentScheduleInstance(Model): + """Information about current or upcoming role assignment schedule instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment schedule instance ID. + :vartype id: str + :ivar name: The role assignment schedule instance name. + :vartype name: str + :ivar type: The role assignment schedule instance type. + :vartype type: str + :param scope: The role assignment schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_assignment_schedule_id: Id of the master role assignment + schedule + :type role_assignment_schedule_id: str + :param origin_role_assignment_id: Role Assignment Id in external system + :type origin_role_assignment_id: str + :param status: The status of the role assignment schedule instance. + Possible values include: 'Accepted', 'PendingEvaluation', 'Granted', + 'Denied', 'PendingProvisioning', 'Provisioned', 'PendingRevocation', + 'Revoked', 'Canceled', 'Failed', 'PendingApprovalProvisioning', + 'PendingApproval', 'FailedAsResourceIsLocked', 'PendingAdminDecision', + 'AdminApproved', 'AdminDenied', 'TimedOut', 'ProvisioningStarted', + 'Invalid', 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: The startDateTime of the role assignment schedule + instance + :type start_date_time: datetime + :param end_date_time: The endDateTime of the role assignment schedule + instance + :type end_date_time: datetime + :param linked_role_eligibility_schedule_id: roleEligibilityScheduleId used + to activate + :type linked_role_eligibility_schedule_id: str + :param linked_role_eligibility_schedule_instance_id: + roleEligibilityScheduleInstanceId linked to this + roleAssignmentScheduleInstance + :type linked_role_eligibility_schedule_instance_id: str + :param assignment_type: Assignment type of the role assignment schedule. + Possible values include: 'Activated', 'Assigned' + :type assignment_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.AssignmentType + :param member_type: Membership type of the role assignment schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role assignment schedule was created + :type created_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_assignment_schedule_id': {'key': 'properties.roleAssignmentScheduleId', 'type': 'str'}, + 'origin_role_assignment_id': {'key': 'properties.originRoleAssignmentId', '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'}, + 'linked_role_eligibility_schedule_id': {'key': 'properties.linkedRoleEligibilityScheduleId', 'type': 'str'}, + 'linked_role_eligibility_schedule_instance_id': {'key': 'properties.linkedRoleEligibilityScheduleInstanceId', 'type': 'str'}, + 'assignment_type': {'key': 'properties.assignmentType', 'type': 'str'}, + 'member_type': {'key': 'properties.memberType', 'type': 'str'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleInstance, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = kwargs.get('scope', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.role_assignment_schedule_id = kwargs.get('role_assignment_schedule_id', None) + self.origin_role_assignment_id = kwargs.get('origin_role_assignment_id', None) + self.status = kwargs.get('status', None) + self.start_date_time = kwargs.get('start_date_time', None) + self.end_date_time = kwargs.get('end_date_time', None) + self.linked_role_eligibility_schedule_id = kwargs.get('linked_role_eligibility_schedule_id', None) + self.linked_role_eligibility_schedule_instance_id = kwargs.get('linked_role_eligibility_schedule_instance_id', None) + self.assignment_type = kwargs.get('assignment_type', None) + self.member_type = kwargs.get('member_type', None) + self.condition = kwargs.get('condition', None) + self.condition_version = kwargs.get('condition_version', None) + self.created_on = kwargs.get('created_on', None) + self.expanded_properties = kwargs.get('expanded_properties', None) + + +class RoleAssignmentScheduleInstanceFilter(Model): + """Role assignment schedule instance filter. + + :param principal_id: Returns role assignment schedule instances of the + specific principal. + :type principal_id: str + :param role_definition_id: Returns role assignment schedule instances of + the specific role definition. + :type role_definition_id: str + :param status: Returns role assignment schedule instances of the specific + status. + :type status: str + :param role_assignment_schedule_id: Returns role assignment schedule + instances belonging to a specific role assignment schedule. + :type role_assignment_schedule_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'role_assignment_schedule_id': {'key': 'roleAssignmentScheduleId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleInstanceFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.status = kwargs.get('status', None) + self.role_assignment_schedule_id = kwargs.get('role_assignment_schedule_id', None) + + +class RoleAssignmentScheduleRequest(Model): + """Role Assignment schedule request. + + 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. + + :ivar id: The role assignment schedule request ID. + :vartype id: str + :ivar name: The role assignment schedule request name. + :vartype name: str + :ivar type: The role assignment schedule request type. + :vartype type: str + :ivar scope: The role assignment schedule request scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :ivar principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param request_type: Required. The type of the role assignment schedule + request. Eg: SelfActivate, AdminAssign etc. Possible values include: + 'AdminAssign', 'AdminRemove', 'AdminUpdate', 'AdminExtend', 'AdminRenew', + 'SelfActivate', 'SelfDeactivate', 'SelfExtend', 'SelfRenew' + :type request_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.RequestType + :ivar status: The status of the role assignment schedule request. Possible + values include: 'Accepted', 'PendingEvaluation', 'Granted', 'Denied', + 'PendingProvisioning', 'Provisioned', 'PendingRevocation', 'Revoked', + 'Canceled', 'Failed', 'PendingApprovalProvisioning', 'PendingApproval', + 'FailedAsResourceIsLocked', 'PendingAdminDecision', 'AdminApproved', + 'AdminDenied', 'TimedOut', 'ProvisioningStarted', 'Invalid', + 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :vartype status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :ivar approval_id: The approvalId of the role assignment schedule request. + :vartype approval_id: str + :param target_role_assignment_schedule_id: The resultant role assignment + schedule id or the role assignment schedule id being updated + :type target_role_assignment_schedule_id: str + :param target_role_assignment_schedule_instance_id: The role assignment + schedule instance id being updated + :type target_role_assignment_schedule_instance_id: str + :param schedule_info: Schedule info of the role assignment schedule + :type schedule_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo + :param linked_role_eligibility_schedule_id: The linked role eligibility + schedule id - to activate an eligibility. + :type linked_role_eligibility_schedule_id: str + :param justification: Justification for the role assignment + :type justification: str + :param ticket_info: Ticket Info of the role assignment + :type ticket_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPropertiesTicketInfo + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: DateTime when role assignment schedule request was + created + :vartype created_on: datetime + :ivar requestor_id: Id of the user who created this request + :vartype requestor_id: str + :ivar expanded_properties: Additional properties of principal, scope and + role definition + :vartype expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'principal_type': {'readonly': True}, + 'request_type': {'required': True}, + 'status': {'readonly': True}, + 'approval_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'requestor_id': {'readonly': True}, + 'expanded_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'approval_id': {'key': 'properties.approvalId', 'type': 'str'}, + 'target_role_assignment_schedule_id': {'key': 'properties.targetRoleAssignmentScheduleId', 'type': 'str'}, + 'target_role_assignment_schedule_instance_id': {'key': 'properties.targetRoleAssignmentScheduleInstanceId', 'type': 'str'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'RoleAssignmentScheduleRequestPropertiesScheduleInfo'}, + 'linked_role_eligibility_schedule_id': {'key': 'properties.linkedRoleEligibilityScheduleId', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + 'ticket_info': {'key': 'properties.ticketInfo', 'type': 'RoleAssignmentScheduleRequestPropertiesTicketInfo'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'requestor_id': {'key': 'properties.requestorId', 'type': 'str'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleRequest, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = None + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = None + self.request_type = kwargs.get('request_type', None) + self.status = None + self.approval_id = None + self.target_role_assignment_schedule_id = kwargs.get('target_role_assignment_schedule_id', None) + self.target_role_assignment_schedule_instance_id = kwargs.get('target_role_assignment_schedule_instance_id', None) + self.schedule_info = kwargs.get('schedule_info', None) + self.linked_role_eligibility_schedule_id = kwargs.get('linked_role_eligibility_schedule_id', None) + self.justification = kwargs.get('justification', None) + self.ticket_info = kwargs.get('ticket_info', None) + self.condition = kwargs.get('condition', None) + self.condition_version = kwargs.get('condition_version', None) + self.created_on = None + self.requestor_id = None + self.expanded_properties = None + + +class RoleAssignmentScheduleRequestFilter(Model): + """Role assignment schedule request filter. + + :param principal_id: Returns role assignment requests of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role assignment requests of the + specific role definition. + :type role_definition_id: str + :param requestor_id: Returns role assignment requests created by specific + principal. + :type requestor_id: str + :param status: Returns role assignment requests of specific status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'requestor_id': {'key': 'requestorId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleRequestFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.requestor_id = kwargs.get('requestor_id', None) + self.status = kwargs.get('status', None) + + +class RoleAssignmentScheduleRequestPropertiesScheduleInfo(Model): + """Schedule info of the role assignment schedule. + + :param start_date_time: Start DateTime of the role assignment schedule. + :type start_date_time: datetime + :param expiration: Expiration of the role assignment schedule + :type expiration: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + """ + + _attribute_map = { + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'expiration': {'key': 'expiration', 'type': 'RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleRequestPropertiesScheduleInfo, self).__init__(**kwargs) + self.start_date_time = kwargs.get('start_date_time', None) + self.expiration = kwargs.get('expiration', None) + + +class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(Model): + """Expiration of the role assignment schedule. + + :param type: Type of the role assignment schedule expiration. Possible + values include: 'AfterDuration', 'AfterDateTime', 'NoExpiration' + :type type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Type + :param end_date_time: End DateTime of the role assignment schedule. + :type end_date_time: datetime + :param duration: Duration of the role assignment schedule in TimeSpan. + :type duration: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.end_date_time = kwargs.get('end_date_time', None) + self.duration = kwargs.get('duration', None) + + +class RoleAssignmentScheduleRequestPropertiesTicketInfo(Model): + """Ticket Info of the role assignment. + + :param ticket_number: Ticket number for the role assignment + :type ticket_number: str + :param ticket_system: Ticket system name for the role assignment + :type ticket_system: str + """ + + _attribute_map = { + 'ticket_number': {'key': 'ticketNumber', 'type': 'str'}, + 'ticket_system': {'key': 'ticketSystem', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentScheduleRequestPropertiesTicketInfo, self).__init__(**kwargs) + self.ticket_number = kwargs.get('ticket_number', None) + self.ticket_system = kwargs.get('ticket_system', None) + + +class RoleEligibilitySchedule(Model): + """Role eligibility schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role eligibility schedule Id. + :vartype id: str + :ivar name: The role eligibility schedule name. + :vartype name: str + :ivar type: The role eligibility schedule type. + :vartype type: str + :param scope: The role eligibility schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_eligibility_schedule_request_id: The id of + roleEligibilityScheduleRequest used to create this roleAssignmentSchedule + :type role_eligibility_schedule_request_id: str + :param member_type: Membership type of the role eligibility schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :param status: The status of the role eligibility schedule. Possible + values include: 'Accepted', 'PendingEvaluation', 'Granted', 'Denied', + 'PendingProvisioning', 'Provisioned', 'PendingRevocation', 'Revoked', + 'Canceled', 'Failed', 'PendingApprovalProvisioning', 'PendingApproval', + 'FailedAsResourceIsLocked', 'PendingAdminDecision', 'AdminApproved', + 'AdminDenied', 'TimedOut', 'ProvisioningStarted', 'Invalid', + 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: Start DateTime when role eligibility schedule + :type start_date_time: datetime + :param end_date_time: End DateTime when role eligibility schedule + :type end_date_time: datetime + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role eligibility schedule was created + :type created_on: datetime + :param updated_on: DateTime when role eligibility schedule was modified + :type updated_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_eligibility_schedule_request_id': {'key': 'properties.roleEligibilityScheduleRequestId', 'type': 'str'}, + 'member_type': {'key': 'properties.memberType', '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'}, + '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'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilitySchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = kwargs.get('scope', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.role_eligibility_schedule_request_id = kwargs.get('role_eligibility_schedule_request_id', None) + self.member_type = kwargs.get('member_type', None) + self.status = kwargs.get('status', None) + self.start_date_time = kwargs.get('start_date_time', None) + self.end_date_time = kwargs.get('end_date_time', 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.expanded_properties = kwargs.get('expanded_properties', None) + + +class RoleEligibilityScheduleFilter(Model): + """Role eligibility schedule filter. + + :param principal_id: Returns role eligibility schedule of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role eligibility schedule of the + specific role definition. + :type role_definition_id: str + :param status: Returns role eligibility schedule of the specific status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.status = kwargs.get('status', None) + + +class RoleEligibilityScheduleInstance(Model): + """Information about current or upcoming role eligibility schedule instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role eligibility schedule instance ID. + :vartype id: str + :ivar name: The role eligibility schedule instance name. + :vartype name: str + :ivar type: The role eligibility schedule instance type. + :vartype type: str + :param scope: The role eligibility schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_eligibility_schedule_id: Id of the master role eligibility + schedule + :type role_eligibility_schedule_id: str + :param status: The status of the role eligibility schedule instance. + Possible values include: 'Accepted', 'PendingEvaluation', 'Granted', + 'Denied', 'PendingProvisioning', 'Provisioned', 'PendingRevocation', + 'Revoked', 'Canceled', 'Failed', 'PendingApprovalProvisioning', + 'PendingApproval', 'FailedAsResourceIsLocked', 'PendingAdminDecision', + 'AdminApproved', 'AdminDenied', 'TimedOut', 'ProvisioningStarted', + 'Invalid', 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: The startDateTime of the role eligibility schedule + instance + :type start_date_time: datetime + :param end_date_time: The endDateTime of the role eligibility schedule + instance + :type end_date_time: datetime + :param member_type: Membership type of the role eligibility schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role eligibility schedule was created + :type created_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_eligibility_schedule_id': {'key': 'properties.roleEligibilityScheduleId', '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'}, + 'member_type': {'key': 'properties.memberType', 'type': 'str'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleInstance, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = kwargs.get('scope', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.role_eligibility_schedule_id = kwargs.get('role_eligibility_schedule_id', None) + self.status = kwargs.get('status', None) + self.start_date_time = kwargs.get('start_date_time', None) + self.end_date_time = kwargs.get('end_date_time', None) + self.member_type = kwargs.get('member_type', None) + self.condition = kwargs.get('condition', None) + self.condition_version = kwargs.get('condition_version', None) + self.created_on = kwargs.get('created_on', None) + self.expanded_properties = kwargs.get('expanded_properties', None) + + +class RoleEligibilityScheduleInstanceFilter(Model): + """Role eligibility schedule instance filter. + + :param principal_id: Returns role eligibility schedule instances of the + specific principal. + :type principal_id: str + :param role_definition_id: Returns role eligibility schedule instances of + the specific role definition. + :type role_definition_id: str + :param status: Returns role eligibility schedule instances of the specific + status. + :type status: str + :param role_eligibility_schedule_id: Returns role eligibility schedule + instances belonging to a specific role eligibility schedule. + :type role_eligibility_schedule_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'role_eligibility_schedule_id': {'key': 'roleEligibilityScheduleId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleInstanceFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.status = kwargs.get('status', None) + self.role_eligibility_schedule_id = kwargs.get('role_eligibility_schedule_id', None) + + +class RoleEligibilityScheduleRequest(Model): + """Role Eligibility schedule request. + + 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. + + :ivar id: The role eligibility schedule request ID. + :vartype id: str + :ivar name: The role eligibility schedule request name. + :vartype name: str + :ivar type: The role eligibility schedule request type. + :vartype type: str + :ivar scope: The role eligibility schedule request scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :ivar principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param request_type: Required. The type of the role assignment schedule + request. Eg: SelfActivate, AdminAssign etc. Possible values include: + 'AdminAssign', 'AdminRemove', 'AdminUpdate', 'AdminExtend', 'AdminRenew', + 'SelfActivate', 'SelfDeactivate', 'SelfExtend', 'SelfRenew' + :type request_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.RequestType + :ivar status: The status of the role eligibility schedule request. + Possible values include: 'Accepted', 'PendingEvaluation', 'Granted', + 'Denied', 'PendingProvisioning', 'Provisioned', 'PendingRevocation', + 'Revoked', 'Canceled', 'Failed', 'PendingApprovalProvisioning', + 'PendingApproval', 'FailedAsResourceIsLocked', 'PendingAdminDecision', + 'AdminApproved', 'AdminDenied', 'TimedOut', 'ProvisioningStarted', + 'Invalid', 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :vartype status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :ivar approval_id: The approvalId of the role eligibility schedule + request. + :vartype approval_id: str + :param schedule_info: Schedule info of the role eligibility schedule + :type schedule_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo + :param target_role_eligibility_schedule_id: The resultant role eligibility + schedule id or the role eligibility schedule id being updated + :type target_role_eligibility_schedule_id: str + :param target_role_eligibility_schedule_instance_id: The role eligibility + schedule instance id being updated + :type target_role_eligibility_schedule_instance_id: str + :param justification: Justification for the role eligibility + :type justification: str + :param ticket_info: Ticket Info of the role eligibility + :type ticket_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPropertiesTicketInfo + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: DateTime when role eligibility schedule request was + created + :vartype created_on: datetime + :ivar requestor_id: Id of the user who created this request + :vartype requestor_id: str + :ivar expanded_properties: Additional properties of principal, scope and + role definition + :vartype expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'principal_type': {'readonly': True}, + 'request_type': {'required': True}, + 'status': {'readonly': True}, + 'approval_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'requestor_id': {'readonly': True}, + 'expanded_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'approval_id': {'key': 'properties.approvalId', 'type': 'str'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'RoleEligibilityScheduleRequestPropertiesScheduleInfo'}, + 'target_role_eligibility_schedule_id': {'key': 'properties.targetRoleEligibilityScheduleId', 'type': 'str'}, + 'target_role_eligibility_schedule_instance_id': {'key': 'properties.targetRoleEligibilityScheduleInstanceId', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + 'ticket_info': {'key': 'properties.ticketInfo', 'type': 'RoleEligibilityScheduleRequestPropertiesTicketInfo'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'requestor_id': {'key': 'properties.requestorId', 'type': 'str'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleRequest, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = None + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.principal_type = None + self.request_type = kwargs.get('request_type', None) + self.status = None + self.approval_id = None + self.schedule_info = kwargs.get('schedule_info', None) + self.target_role_eligibility_schedule_id = kwargs.get('target_role_eligibility_schedule_id', None) + self.target_role_eligibility_schedule_instance_id = kwargs.get('target_role_eligibility_schedule_instance_id', None) + self.justification = kwargs.get('justification', None) + self.ticket_info = kwargs.get('ticket_info', None) + self.condition = kwargs.get('condition', None) + self.condition_version = kwargs.get('condition_version', None) + self.created_on = None + self.requestor_id = None + self.expanded_properties = None + + +class RoleEligibilityScheduleRequestFilter(Model): + """Role eligibility schedule request filter. + + :param principal_id: Returns role eligibility requests of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role eligibility requests of the + specific role definition. + :type role_definition_id: str + :param requestor_id: Returns role eligibility requests created by specific + principal. + :type requestor_id: str + :param status: Returns role eligibility requests of specific status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'requestor_id': {'key': 'requestorId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleRequestFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.requestor_id = kwargs.get('requestor_id', None) + self.status = kwargs.get('status', None) + + +class RoleEligibilityScheduleRequestPropertiesScheduleInfo(Model): + """Schedule info of the role eligibility schedule. + + :param start_date_time: Start DateTime of the role eligibility schedule. + :type start_date_time: datetime + :param expiration: Expiration of the role eligibility schedule + :type expiration: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + """ + + _attribute_map = { + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'expiration': {'key': 'expiration', 'type': 'RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleRequestPropertiesScheduleInfo, self).__init__(**kwargs) + self.start_date_time = kwargs.get('start_date_time', None) + self.expiration = kwargs.get('expiration', None) + + +class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(Model): + """Expiration of the role eligibility schedule. + + :param type: Type of the role eligibility schedule expiration. Possible + values include: 'AfterDuration', 'AfterDateTime', 'NoExpiration' + :type type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Type + :param end_date_time: End DateTime of the role eligibility schedule. + :type end_date_time: datetime + :param duration: Duration of the role eligibility schedule in TimeSpan. + :type duration: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.end_date_time = kwargs.get('end_date_time', None) + self.duration = kwargs.get('duration', None) + + +class RoleEligibilityScheduleRequestPropertiesTicketInfo(Model): + """Ticket Info of the role eligibility. + + :param ticket_number: Ticket number for the role eligibility + :type ticket_number: str + :param ticket_system: Ticket system name for the role eligibility + :type ticket_system: str + """ + + _attribute_map = { + 'ticket_number': {'key': 'ticketNumber', 'type': 'str'}, + 'ticket_system': {'key': 'ticketSystem', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleEligibilityScheduleRequestPropertiesTicketInfo, self).__init__(**kwargs) + self.ticket_number = kwargs.get('ticket_number', None) + self.ticket_system = kwargs.get('ticket_system', None) + + +class RoleManagementPolicy(Model): + """Role management policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role management policy Id. + :vartype id: str + :ivar name: The role management policy name. + :vartype name: str + :ivar type: The role management policy type. + :vartype type: str + :param scope: The role management policy scope. + :type scope: str + :param display_name: The role management policy display name. + :type display_name: str + :param description: The role management policy description. + :type description: str + :param is_organization_default: The role management policy is default + policy. + :type is_organization_default: bool + :param last_modified_by: + :type last_modified_by: + ~azure.mgmt.authorization.v2020_10_01_preview.models.Principal + :ivar last_modified_date_time: The last modified date time. + :vartype last_modified_date_time: datetime + :param rules: The rule applied to the policy. + :type rules: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRule] + :ivar effective_rules: The readonly computed rule applied to the policy. + :vartype effective_rules: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRule] + :ivar policy_properties: Additional properties of scope + :vartype policy_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_date_time': {'readonly': True}, + 'effective_rules': {'readonly': True}, + 'policy_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_organization_default': {'key': 'properties.isOrganizationDefault', 'type': 'bool'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'Principal'}, + 'last_modified_date_time': {'key': 'properties.lastModifiedDateTime', 'type': 'iso-8601'}, + 'rules': {'key': 'properties.rules', 'type': '[RoleManagementPolicyRule]'}, + 'effective_rules': {'key': 'properties.effectiveRules', 'type': '[RoleManagementPolicyRule]'}, + 'policy_properties': {'key': 'properties.policyProperties', 'type': 'PolicyProperties'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicy, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = kwargs.get('scope', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.is_organization_default = kwargs.get('is_organization_default', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_date_time = None + self.rules = kwargs.get('rules', None) + self.effective_rules = None + self.policy_properties = None + + +class RoleManagementPolicyRule(Model): + """The role management policy rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RoleManagementPolicyApprovalRule, + RoleManagementPolicyAuthenticationContextRule, + RoleManagementPolicyEnablementRule, RoleManagementPolicyExpirationRule, + RoleManagementPolicyNotificationRule + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + _subtype_map = { + 'rule_type': {'RoleManagementPolicyApprovalRule': 'RoleManagementPolicyApprovalRule', 'RoleManagementPolicyAuthenticationContextRule': 'RoleManagementPolicyAuthenticationContextRule', 'RoleManagementPolicyEnablementRule': 'RoleManagementPolicyEnablementRule', 'RoleManagementPolicyExpirationRule': 'RoleManagementPolicyExpirationRule', 'RoleManagementPolicyNotificationRule': 'RoleManagementPolicyNotificationRule'} + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.target = kwargs.get('target', None) + self.rule_type = None + + +class RoleManagementPolicyApprovalRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param setting: The approval setting + :type setting: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ApprovalSettings + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'setting': {'key': 'setting', 'type': 'ApprovalSettings'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyApprovalRule, self).__init__(**kwargs) + self.setting = kwargs.get('setting', None) + self.rule_type = 'RoleManagementPolicyApprovalRule' + + +class RoleManagementPolicyAssignment(Model): + """Role management policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role management policy Id. + :vartype id: str + :ivar name: The role management policy name. + :vartype name: str + :ivar type: The role management policy type. + :vartype type: str + :param scope: The role management policy scope. + :type scope: str + :param role_definition_id: The role definition of management policy + assignment. + :type role_definition_id: str + :param policy_id: The policy id role management policy assignment. + :type policy_id: str + :ivar policy_assignment_properties: Additional properties of scope, role + definition and policy + :vartype policy_assignment_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_assignment_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'policy_assignment_properties': {'key': 'properties.policyAssignmentProperties', 'type': 'PolicyAssignmentProperties'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyAssignment, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = kwargs.get('scope', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.policy_id = kwargs.get('policy_id', None) + self.policy_assignment_properties = None + + +class RoleManagementPolicyAuthenticationContextRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param is_enabled: The value indicating if rule is enabled. + :type is_enabled: bool + :param claim_value: The claim value. + :type claim_value: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'claim_value': {'key': 'claimValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyAuthenticationContextRule, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) + self.claim_value = kwargs.get('claim_value', None) + self.rule_type = 'RoleManagementPolicyAuthenticationContextRule' + + +class RoleManagementPolicyEnablementRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param enabled_rules: The list of enabled rules. + :type enabled_rules: list[str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.EnablementRules] + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'enabled_rules': {'key': 'enabledRules', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyEnablementRule, self).__init__(**kwargs) + self.enabled_rules = kwargs.get('enabled_rules', None) + self.rule_type = 'RoleManagementPolicyEnablementRule' + + +class RoleManagementPolicyExpirationRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param is_expiration_required: The value indicating whether expiration is + required. + :type is_expiration_required: bool + :param maximum_duration: The maximum duration of expiration in timespan. + :type maximum_duration: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'is_expiration_required': {'key': 'isExpirationRequired', 'type': 'bool'}, + 'maximum_duration': {'key': 'maximumDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyExpirationRule, self).__init__(**kwargs) + self.is_expiration_required = kwargs.get('is_expiration_required', None) + self.maximum_duration = kwargs.get('maximum_duration', None) + self.rule_type = 'RoleManagementPolicyExpirationRule' + + +class RoleManagementPolicyNotificationRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param notification_type: The type of notification. Possible values + include: 'Email' + :type notification_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.NotificationDeliveryMechanism + :param notification_level: The notification level. Possible values + include: 'None', 'Critical', 'All' + :type notification_level: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.NotificationLevel + :param recipient_type: The recipient type. Possible values include: + 'Requestor', 'Approver', 'Admin' + :type recipient_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.RecipientType + :param notification_recipients: The list notification recipients. + :type notification_recipients: list[str] + :param is_default_recipients_enabled: Its value determine if the + notification need to be sent to the recipient type specified in policy + rule. + :type is_default_recipients_enabled: bool + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'notification_type': {'key': 'notificationType', 'type': 'str'}, + 'notification_level': {'key': 'notificationLevel', 'type': 'str'}, + 'recipient_type': {'key': 'recipientType', 'type': 'str'}, + 'notification_recipients': {'key': 'notificationRecipients', 'type': '[str]'}, + 'is_default_recipients_enabled': {'key': 'isDefaultRecipientsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyNotificationRule, self).__init__(**kwargs) + self.notification_type = kwargs.get('notification_type', None) + self.notification_level = kwargs.get('notification_level', None) + self.recipient_type = kwargs.get('recipient_type', None) + self.notification_recipients = kwargs.get('notification_recipients', None) + self.is_default_recipients_enabled = kwargs.get('is_default_recipients_enabled', None) + self.rule_type = 'RoleManagementPolicyNotificationRule' + + +class RoleManagementPolicyRuleTarget(Model): + """The role management policy rule target. + + :param caller: The caller of the setting. + :type caller: str + :param operations: The type of operation. + :type operations: list[str] + :param level: The assignment level to which it is applied. + :type level: str + :param target_objects: The list of target objects. + :type target_objects: list[str] + :param inheritable_settings: The list of inheritable settings. + :type inheritable_settings: list[str] + :param enforced_settings: The list of enforced settings. + :type enforced_settings: list[str] + """ + + _attribute_map = { + 'caller': {'key': 'caller', 'type': 'str'}, + 'operations': {'key': 'operations', 'type': '[str]'}, + 'level': {'key': 'level', 'type': 'str'}, + 'target_objects': {'key': 'targetObjects', 'type': '[str]'}, + 'inheritable_settings': {'key': 'inheritableSettings', 'type': '[str]'}, + 'enforced_settings': {'key': 'enforcedSettings', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RoleManagementPolicyRuleTarget, self).__init__(**kwargs) + self.caller = kwargs.get('caller', None) + self.operations = kwargs.get('operations', None) + self.level = kwargs.get('level', None) + self.target_objects = kwargs.get('target_objects', None) + self.inheritable_settings = kwargs.get('inheritable_settings', None) + self.enforced_settings = kwargs.get('enforced_settings', None) + + +class UserSet(Model): + """The detail of a user. + + :param user_type: The type of user. Possible values include: 'User', + 'Group' + :type user_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.UserType + :param is_backup: The value indicating whether the user is a backup + fallback approver + :type is_backup: bool + :param id: The object id of the user. + :type id: str + :param description: The description of the user. + :type description: str + """ + + _attribute_map = { + 'user_type': {'key': 'userType', 'type': 'str'}, + 'is_backup': {'key': 'isBackup', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserSet, self).__init__(**kwargs) + self.user_type = kwargs.get('user_type', None) + self.is_backup = kwargs.get('is_backup', None) + self.id = kwargs.get('id', None) + self.description = kwargs.get('description', None) + + +class ValidationResponse(Model): + """Validation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_valid: Whether or not validation succeeded + :vartype is_valid: bool + :param error_info: Failed validation result details + :type error_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ValidationResponseErrorInfo + """ + + _validation = { + 'is_valid': {'readonly': True}, + } + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'error_info': {'key': 'errorInfo', 'type': 'ValidationResponseErrorInfo'}, + } + + def __init__(self, **kwargs): + super(ValidationResponse, self).__init__(**kwargs) + self.is_valid = None + self.error_info = kwargs.get('error_info', None) + + +class ValidationResponseErrorInfo(Model): + """Failed validation result details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code indicating why validation failed + :vartype code: str + :ivar message: Message indicating why validation failed + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidationResponseErrorInfo, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..6a0076dfaa34 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_models_py3.py @@ -0,0 +1,2322 @@ +# 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 ApprovalSettings(Model): + """The approval settings. + + :param is_approval_required: Determine whether approval is required or + not. + :type is_approval_required: bool + :param is_approval_required_for_extension: Determine whether approval is + required for assignment extension. + :type is_approval_required_for_extension: bool + :param is_requestor_justification_required: Determine whether requestor + justification required. + :type is_requestor_justification_required: bool + :param approval_mode: The type of rule. Possible values include: + 'SingleStage', 'Serial', 'Parallel', 'NoApproval' + :type approval_mode: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.ApprovalMode + :param approval_stages: The approval stages of the request. + :type approval_stages: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.ApprovalStage] + """ + + _attribute_map = { + 'is_approval_required': {'key': 'isApprovalRequired', 'type': 'bool'}, + 'is_approval_required_for_extension': {'key': 'isApprovalRequiredForExtension', 'type': 'bool'}, + 'is_requestor_justification_required': {'key': 'isRequestorJustificationRequired', 'type': 'bool'}, + 'approval_mode': {'key': 'approvalMode', 'type': 'str'}, + 'approval_stages': {'key': 'approvalStages', 'type': '[ApprovalStage]'}, + } + + def __init__(self, *, is_approval_required: bool=None, is_approval_required_for_extension: bool=None, is_requestor_justification_required: bool=None, approval_mode=None, approval_stages=None, **kwargs) -> None: + super(ApprovalSettings, self).__init__(**kwargs) + self.is_approval_required = is_approval_required + self.is_approval_required_for_extension = is_approval_required_for_extension + self.is_requestor_justification_required = is_requestor_justification_required + self.approval_mode = approval_mode + self.approval_stages = approval_stages + + +class ApprovalStage(Model): + """The approval stage. + + :param approval_stage_time_out_in_days: The time in days when approval + request would be timed out. + :type approval_stage_time_out_in_days: int + :param is_approver_justification_required: Determine whether approver need + to provide justification for his decision. + :type is_approver_justification_required: bool + :param escalation_time_in_minutes: The time in minutes when the approval + request would be escalated if the primary approver does not approves. + :type escalation_time_in_minutes: int + :param primary_approvers: The primary approver of the request. + :type primary_approvers: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.UserSet] + :param is_escalation_enabled: The value determine whether escalation + feature is enabled. + :type is_escalation_enabled: bool + :param escalation_approvers: The escalation approver of the request. + :type escalation_approvers: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.UserSet] + """ + + _attribute_map = { + 'approval_stage_time_out_in_days': {'key': 'approvalStageTimeOutInDays', 'type': 'int'}, + 'is_approver_justification_required': {'key': 'isApproverJustificationRequired', 'type': 'bool'}, + 'escalation_time_in_minutes': {'key': 'escalationTimeInMinutes', 'type': 'int'}, + 'primary_approvers': {'key': 'primaryApprovers', 'type': '[UserSet]'}, + 'is_escalation_enabled': {'key': 'isEscalationEnabled', 'type': 'bool'}, + 'escalation_approvers': {'key': 'escalationApprovers', 'type': '[UserSet]'}, + } + + def __init__(self, *, approval_stage_time_out_in_days: int=None, is_approver_justification_required: bool=None, escalation_time_in_minutes: int=None, primary_approvers=None, is_escalation_enabled: bool=None, escalation_approvers=None, **kwargs) -> None: + super(ApprovalStage, self).__init__(**kwargs) + self.approval_stage_time_out_in_days = approval_stage_time_out_in_days + self.is_approver_justification_required = is_approver_justification_required + self.escalation_time_in_minutes = escalation_time_in_minutes + self.primary_approvers = primary_approvers + self.is_escalation_enabled = is_escalation_enabled + self.escalation_approvers = escalation_approvers + + +class CloudError(Model): + """An error response from the service. + + :param error: + :type error: + ~azure.mgmt.authorization.v2020_10_01_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + + +class EligibleChildResource(Model): + """Eligible child resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource scope Id. + :vartype id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(EligibleChildResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +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_10_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2020_10_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_10_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 ExpandedProperties(Model): + """ExpandedProperties. + + :param scope: Details of the resource scope + :type scope: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedPropertiesScope + :param role_definition: Details of role definition + :type role_definition: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedPropertiesRoleDefinition + :param principal: Details of the principal + :type principal: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedPropertiesPrincipal + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'ExpandedPropertiesScope'}, + 'role_definition': {'key': 'roleDefinition', 'type': 'ExpandedPropertiesRoleDefinition'}, + 'principal': {'key': 'principal', 'type': 'ExpandedPropertiesPrincipal'}, + } + + def __init__(self, *, scope=None, role_definition=None, principal=None, **kwargs) -> None: + super(ExpandedProperties, self).__init__(**kwargs) + self.scope = scope + self.role_definition = role_definition + self.principal = principal + + +class ExpandedPropertiesPrincipal(Model): + """Details of the principal. + + :param id: Id of the principal + :type id: str + :param display_name: Display name of the principal + :type display_name: str + :param email: Email id of the principal + :type email: str + :param type: Type of the principal + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, email: str=None, type: str=None, **kwargs) -> None: + super(ExpandedPropertiesPrincipal, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.email = email + self.type = type + + +class ExpandedPropertiesRoleDefinition(Model): + """Details of role definition. + + :param id: Id of the role definition + :type id: str + :param display_name: Display name of the role definition + :type display_name: str + :param type: Type of the role definition + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, type: str=None, **kwargs) -> None: + super(ExpandedPropertiesRoleDefinition, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.type = type + + +class ExpandedPropertiesScope(Model): + """Details of the resource scope. + + :param id: Scope id of the resource + :type id: str + :param display_name: Display name of the resource + :type display_name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, type: str=None, **kwargs) -> None: + super(ExpandedPropertiesScope, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.type = type + + +class PolicyAssignmentProperties(Model): + """PolicyAssignmentProperties. + + :param scope: Details of the resource scope + :type scope: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentPropertiesScope + :param role_definition: Details of role definition + :type role_definition: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentPropertiesRoleDefinition + :param policy: Details of the policy + :type policy: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentPropertiesPolicy + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'PolicyAssignmentPropertiesScope'}, + 'role_definition': {'key': 'roleDefinition', 'type': 'PolicyAssignmentPropertiesRoleDefinition'}, + 'policy': {'key': 'policy', 'type': 'PolicyAssignmentPropertiesPolicy'}, + } + + def __init__(self, *, scope=None, role_definition=None, policy=None, **kwargs) -> None: + super(PolicyAssignmentProperties, self).__init__(**kwargs) + self.scope = scope + self.role_definition = role_definition + self.policy = policy + + +class PolicyAssignmentPropertiesPolicy(Model): + """Details of the policy. + + :param id: Id of the policy + :type id: str + :param last_modified_by: + :type last_modified_by: + ~azure.mgmt.authorization.v2020_10_01_preview.models.Principal + :param last_modified_date_time: The last modified date time. + :type last_modified_date_time: datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'Principal'}, + 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, id: str=None, last_modified_by=None, last_modified_date_time=None, **kwargs) -> None: + super(PolicyAssignmentPropertiesPolicy, self).__init__(**kwargs) + self.id = id + self.last_modified_by = last_modified_by + self.last_modified_date_time = last_modified_date_time + + +class PolicyAssignmentPropertiesRoleDefinition(Model): + """Details of role definition. + + :param id: Id of the role definition + :type id: str + :param display_name: Display name of the role definition + :type display_name: str + :param type: Type of the role definition + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, type: str=None, **kwargs) -> None: + super(PolicyAssignmentPropertiesRoleDefinition, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.type = type + + +class PolicyAssignmentPropertiesScope(Model): + """Details of the resource scope. + + :param id: Scope id of the resource + :type id: str + :param display_name: Display name of the resource + :type display_name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, type: str=None, **kwargs) -> None: + super(PolicyAssignmentPropertiesScope, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.type = type + + +class PolicyProperties(Model): + """PolicyProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar scope: Details of the resource scope + :vartype scope: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyPropertiesScope + """ + + _validation = { + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'PolicyPropertiesScope'}, + } + + def __init__(self, **kwargs) -> None: + super(PolicyProperties, self).__init__(**kwargs) + self.scope = None + + +class PolicyPropertiesScope(Model): + """Details of the resource scope. + + :param id: Scope id of the resource + :type id: str + :param display_name: Display name of the resource + :type display_name: str + :param type: Type of the resource + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, type: str=None, **kwargs) -> None: + super(PolicyPropertiesScope, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.type = type + + +class Principal(Model): + """The name of the entity last modified it. + + :param id: The id of the principal made changes + :type id: str + :param display_name: The name of the principal made changes + :type display_name: str + :param type: Type of principal such as user , group etc + :type type: str + :param email: Email of principal + :type email: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, display_name: str=None, type: str=None, email: str=None, **kwargs) -> None: + super(Principal, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.type = type + self.email = email + + +class RoleAssignment(Model): + """Role Assignments. + + 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. + + :ivar id: The role assignment ID. + :vartype id: str + :ivar name: The role assignment name. + :vartype name: str + :ivar type: The role assignment type. + :vartype type: str + :ivar scope: The role assignment scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device'. Default value: "User" . + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param description: Description of role assignment + :type description: str + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: Time it was created + :vartype created_on: datetime + :ivar updated_on: Time it was updated + :vartype updated_on: datetime + :ivar created_by: Id of the user who created the assignment + :vartype created_by: str + :ivar updated_by: Id of the user who updated the assignment + :vartype updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'created_on': {'readonly': True}, + 'updated_on': {'readonly': True}, + 'created_by': {'readonly': True}, + 'updated_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + '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, *, role_definition_id: str, principal_id: str, principal_type="User", description: str=None, condition: str=None, condition_version: str=None, delegated_managed_identity_resource_id: str=None, **kwargs) -> None: + super(RoleAssignment, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = None + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = principal_type + self.description = description + self.condition = condition + self.condition_version = condition_version + self.created_on = None + self.updated_on = None + self.created_by = None + self.updated_by = None + self.delegated_managed_identity_resource_id = delegated_managed_identity_resource_id + + +class RoleAssignmentCreateParameters(Model): + """Role assignment create parameters. + + 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. + + :ivar scope: The role assignment scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device'. Default value: "User" . + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param description: Description of role assignment + :type description: str + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: Time it was created + :vartype created_on: datetime + :ivar updated_on: Time it was updated + :vartype updated_on: datetime + :ivar created_by: Id of the user who created the assignment + :vartype created_by: str + :ivar updated_by: Id of the user who updated the assignment + :vartype updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str + """ + + _validation = { + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'created_on': {'readonly': True}, + 'updated_on': {'readonly': True}, + 'created_by': {'readonly': True}, + 'updated_by': {'readonly': True}, + } + + _attribute_map = { + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + '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, *, role_definition_id: str, principal_id: str, principal_type="User", description: str=None, condition: str=None, condition_version: str=None, delegated_managed_identity_resource_id: str=None, **kwargs) -> None: + super(RoleAssignmentCreateParameters, self).__init__(**kwargs) + self.scope = None + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = principal_type + self.description = description + self.condition = condition + self.condition_version = condition_version + self.created_on = None + self.updated_on = None + self.created_by = None + self.updated_by = None + self.delegated_managed_identity_resource_id = delegated_managed_identity_resource_id + + +class RoleAssignmentFilter(Model): + """Role Assignments filter. + + :param principal_id: Returns role assignment of the specific principal. + :type principal_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, **kwargs) -> None: + super(RoleAssignmentFilter, self).__init__(**kwargs) + self.principal_id = principal_id + + +class RoleAssignmentSchedule(Model): + """Role Assignment schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment schedule Id. + :vartype id: str + :ivar name: The role assignment schedule name. + :vartype name: str + :ivar type: The role assignment schedule type. + :vartype type: str + :param scope: The role assignment schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_assignment_schedule_request_id: The id of + roleAssignmentScheduleRequest used to create this roleAssignmentSchedule + :type role_assignment_schedule_request_id: str + :param linked_role_eligibility_schedule_id: The id of + roleEligibilitySchedule used to activated this roleAssignmentSchedule + :type linked_role_eligibility_schedule_id: str + :param assignment_type: Assignment type of the role assignment schedule. + Possible values include: 'Activated', 'Assigned' + :type assignment_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.AssignmentType + :param member_type: Membership type of the role assignment schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :param status: The status of the role assignment schedule. Possible values + include: 'Accepted', 'PendingEvaluation', 'Granted', 'Denied', + 'PendingProvisioning', 'Provisioned', 'PendingRevocation', 'Revoked', + 'Canceled', 'Failed', 'PendingApprovalProvisioning', 'PendingApproval', + 'FailedAsResourceIsLocked', 'PendingAdminDecision', 'AdminApproved', + 'AdminDenied', 'TimedOut', 'ProvisioningStarted', 'Invalid', + 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: Start DateTime when role assignment schedule + :type start_date_time: datetime + :param end_date_time: End DateTime when role assignment schedule + :type end_date_time: datetime + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role assignment schedule was created + :type created_on: datetime + :param updated_on: DateTime when role assignment schedule was modified + :type updated_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_assignment_schedule_request_id': {'key': 'properties.roleAssignmentScheduleRequestId', 'type': 'str'}, + 'linked_role_eligibility_schedule_id': {'key': 'properties.linkedRoleEligibilityScheduleId', 'type': 'str'}, + 'assignment_type': {'key': 'properties.assignmentType', 'type': 'str'}, + 'member_type': {'key': 'properties.memberType', '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'}, + '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'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, role_assignment_schedule_request_id: str=None, linked_role_eligibility_schedule_id: str=None, assignment_type=None, member_type=None, status=None, start_date_time=None, end_date_time=None, condition: str=None, condition_version: str=None, created_on=None, updated_on=None, expanded_properties=None, **kwargs) -> None: + super(RoleAssignmentSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = principal_type + self.role_assignment_schedule_request_id = role_assignment_schedule_request_id + self.linked_role_eligibility_schedule_id = linked_role_eligibility_schedule_id + self.assignment_type = assignment_type + self.member_type = member_type + self.status = status + self.start_date_time = start_date_time + self.end_date_time = end_date_time + self.condition = condition + self.condition_version = condition_version + self.created_on = created_on + self.updated_on = updated_on + self.expanded_properties = expanded_properties + + +class RoleAssignmentScheduleFilter(Model): + """Role assignment schedule filter. + + :param principal_id: Returns role assignment schedule of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role assignment schedule of the + specific role definition. + :type role_definition_id: str + :param status: Returns role assignment schedule instances of the specific + status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, role_definition_id: str=None, status: str=None, **kwargs) -> None: + super(RoleAssignmentScheduleFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + self.status = status + + +class RoleAssignmentScheduleInstance(Model): + """Information about current or upcoming role assignment schedule instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment schedule instance ID. + :vartype id: str + :ivar name: The role assignment schedule instance name. + :vartype name: str + :ivar type: The role assignment schedule instance type. + :vartype type: str + :param scope: The role assignment schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_assignment_schedule_id: Id of the master role assignment + schedule + :type role_assignment_schedule_id: str + :param origin_role_assignment_id: Role Assignment Id in external system + :type origin_role_assignment_id: str + :param status: The status of the role assignment schedule instance. + Possible values include: 'Accepted', 'PendingEvaluation', 'Granted', + 'Denied', 'PendingProvisioning', 'Provisioned', 'PendingRevocation', + 'Revoked', 'Canceled', 'Failed', 'PendingApprovalProvisioning', + 'PendingApproval', 'FailedAsResourceIsLocked', 'PendingAdminDecision', + 'AdminApproved', 'AdminDenied', 'TimedOut', 'ProvisioningStarted', + 'Invalid', 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: The startDateTime of the role assignment schedule + instance + :type start_date_time: datetime + :param end_date_time: The endDateTime of the role assignment schedule + instance + :type end_date_time: datetime + :param linked_role_eligibility_schedule_id: roleEligibilityScheduleId used + to activate + :type linked_role_eligibility_schedule_id: str + :param linked_role_eligibility_schedule_instance_id: + roleEligibilityScheduleInstanceId linked to this + roleAssignmentScheduleInstance + :type linked_role_eligibility_schedule_instance_id: str + :param assignment_type: Assignment type of the role assignment schedule. + Possible values include: 'Activated', 'Assigned' + :type assignment_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.AssignmentType + :param member_type: Membership type of the role assignment schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role assignment schedule was created + :type created_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_assignment_schedule_id': {'key': 'properties.roleAssignmentScheduleId', 'type': 'str'}, + 'origin_role_assignment_id': {'key': 'properties.originRoleAssignmentId', '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'}, + 'linked_role_eligibility_schedule_id': {'key': 'properties.linkedRoleEligibilityScheduleId', 'type': 'str'}, + 'linked_role_eligibility_schedule_instance_id': {'key': 'properties.linkedRoleEligibilityScheduleInstanceId', 'type': 'str'}, + 'assignment_type': {'key': 'properties.assignmentType', 'type': 'str'}, + 'member_type': {'key': 'properties.memberType', 'type': 'str'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, role_assignment_schedule_id: str=None, origin_role_assignment_id: str=None, status=None, start_date_time=None, end_date_time=None, linked_role_eligibility_schedule_id: str=None, linked_role_eligibility_schedule_instance_id: str=None, assignment_type=None, member_type=None, condition: str=None, condition_version: str=None, created_on=None, expanded_properties=None, **kwargs) -> None: + super(RoleAssignmentScheduleInstance, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = principal_type + self.role_assignment_schedule_id = role_assignment_schedule_id + self.origin_role_assignment_id = origin_role_assignment_id + self.status = status + self.start_date_time = start_date_time + self.end_date_time = end_date_time + self.linked_role_eligibility_schedule_id = linked_role_eligibility_schedule_id + self.linked_role_eligibility_schedule_instance_id = linked_role_eligibility_schedule_instance_id + self.assignment_type = assignment_type + self.member_type = member_type + self.condition = condition + self.condition_version = condition_version + self.created_on = created_on + self.expanded_properties = expanded_properties + + +class RoleAssignmentScheduleInstanceFilter(Model): + """Role assignment schedule instance filter. + + :param principal_id: Returns role assignment schedule instances of the + specific principal. + :type principal_id: str + :param role_definition_id: Returns role assignment schedule instances of + the specific role definition. + :type role_definition_id: str + :param status: Returns role assignment schedule instances of the specific + status. + :type status: str + :param role_assignment_schedule_id: Returns role assignment schedule + instances belonging to a specific role assignment schedule. + :type role_assignment_schedule_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'role_assignment_schedule_id': {'key': 'roleAssignmentScheduleId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, role_definition_id: str=None, status: str=None, role_assignment_schedule_id: str=None, **kwargs) -> None: + super(RoleAssignmentScheduleInstanceFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + self.status = status + self.role_assignment_schedule_id = role_assignment_schedule_id + + +class RoleAssignmentScheduleRequest(Model): + """Role Assignment schedule request. + + 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. + + :ivar id: The role assignment schedule request ID. + :vartype id: str + :ivar name: The role assignment schedule request name. + :vartype name: str + :ivar type: The role assignment schedule request type. + :vartype type: str + :ivar scope: The role assignment schedule request scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :ivar principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param request_type: Required. The type of the role assignment schedule + request. Eg: SelfActivate, AdminAssign etc. Possible values include: + 'AdminAssign', 'AdminRemove', 'AdminUpdate', 'AdminExtend', 'AdminRenew', + 'SelfActivate', 'SelfDeactivate', 'SelfExtend', 'SelfRenew' + :type request_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.RequestType + :ivar status: The status of the role assignment schedule request. Possible + values include: 'Accepted', 'PendingEvaluation', 'Granted', 'Denied', + 'PendingProvisioning', 'Provisioned', 'PendingRevocation', 'Revoked', + 'Canceled', 'Failed', 'PendingApprovalProvisioning', 'PendingApproval', + 'FailedAsResourceIsLocked', 'PendingAdminDecision', 'AdminApproved', + 'AdminDenied', 'TimedOut', 'ProvisioningStarted', 'Invalid', + 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :vartype status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :ivar approval_id: The approvalId of the role assignment schedule request. + :vartype approval_id: str + :param target_role_assignment_schedule_id: The resultant role assignment + schedule id or the role assignment schedule id being updated + :type target_role_assignment_schedule_id: str + :param target_role_assignment_schedule_instance_id: The role assignment + schedule instance id being updated + :type target_role_assignment_schedule_instance_id: str + :param schedule_info: Schedule info of the role assignment schedule + :type schedule_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo + :param linked_role_eligibility_schedule_id: The linked role eligibility + schedule id - to activate an eligibility. + :type linked_role_eligibility_schedule_id: str + :param justification: Justification for the role assignment + :type justification: str + :param ticket_info: Ticket Info of the role assignment + :type ticket_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPropertiesTicketInfo + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: DateTime when role assignment schedule request was + created + :vartype created_on: datetime + :ivar requestor_id: Id of the user who created this request + :vartype requestor_id: str + :ivar expanded_properties: Additional properties of principal, scope and + role definition + :vartype expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'principal_type': {'readonly': True}, + 'request_type': {'required': True}, + 'status': {'readonly': True}, + 'approval_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'requestor_id': {'readonly': True}, + 'expanded_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'approval_id': {'key': 'properties.approvalId', 'type': 'str'}, + 'target_role_assignment_schedule_id': {'key': 'properties.targetRoleAssignmentScheduleId', 'type': 'str'}, + 'target_role_assignment_schedule_instance_id': {'key': 'properties.targetRoleAssignmentScheduleInstanceId', 'type': 'str'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'RoleAssignmentScheduleRequestPropertiesScheduleInfo'}, + 'linked_role_eligibility_schedule_id': {'key': 'properties.linkedRoleEligibilityScheduleId', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + 'ticket_info': {'key': 'properties.ticketInfo', 'type': 'RoleAssignmentScheduleRequestPropertiesTicketInfo'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'requestor_id': {'key': 'properties.requestorId', 'type': 'str'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, *, role_definition_id: str, principal_id: str, request_type, target_role_assignment_schedule_id: str=None, target_role_assignment_schedule_instance_id: str=None, schedule_info=None, linked_role_eligibility_schedule_id: str=None, justification: str=None, ticket_info=None, condition: str=None, condition_version: str=None, **kwargs) -> None: + super(RoleAssignmentScheduleRequest, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = None + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = None + self.request_type = request_type + self.status = None + self.approval_id = None + self.target_role_assignment_schedule_id = target_role_assignment_schedule_id + self.target_role_assignment_schedule_instance_id = target_role_assignment_schedule_instance_id + self.schedule_info = schedule_info + self.linked_role_eligibility_schedule_id = linked_role_eligibility_schedule_id + self.justification = justification + self.ticket_info = ticket_info + self.condition = condition + self.condition_version = condition_version + self.created_on = None + self.requestor_id = None + self.expanded_properties = None + + +class RoleAssignmentScheduleRequestFilter(Model): + """Role assignment schedule request filter. + + :param principal_id: Returns role assignment requests of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role assignment requests of the + specific role definition. + :type role_definition_id: str + :param requestor_id: Returns role assignment requests created by specific + principal. + :type requestor_id: str + :param status: Returns role assignment requests of specific status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'requestor_id': {'key': 'requestorId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, role_definition_id: str=None, requestor_id: str=None, status: str=None, **kwargs) -> None: + super(RoleAssignmentScheduleRequestFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + self.requestor_id = requestor_id + self.status = status + + +class RoleAssignmentScheduleRequestPropertiesScheduleInfo(Model): + """Schedule info of the role assignment schedule. + + :param start_date_time: Start DateTime of the role assignment schedule. + :type start_date_time: datetime + :param expiration: Expiration of the role assignment schedule + :type expiration: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + """ + + _attribute_map = { + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'expiration': {'key': 'expiration', 'type': 'RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration'}, + } + + def __init__(self, *, start_date_time=None, expiration=None, **kwargs) -> None: + super(RoleAssignmentScheduleRequestPropertiesScheduleInfo, self).__init__(**kwargs) + self.start_date_time = start_date_time + self.expiration = expiration + + +class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(Model): + """Expiration of the role assignment schedule. + + :param type: Type of the role assignment schedule expiration. Possible + values include: 'AfterDuration', 'AfterDateTime', 'NoExpiration' + :type type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Type + :param end_date_time: End DateTime of the role assignment schedule. + :type end_date_time: datetime + :param duration: Duration of the role assignment schedule in TimeSpan. + :type duration: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, *, type=None, end_date_time=None, duration: str=None, **kwargs) -> None: + super(RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration, self).__init__(**kwargs) + self.type = type + self.end_date_time = end_date_time + self.duration = duration + + +class RoleAssignmentScheduleRequestPropertiesTicketInfo(Model): + """Ticket Info of the role assignment. + + :param ticket_number: Ticket number for the role assignment + :type ticket_number: str + :param ticket_system: Ticket system name for the role assignment + :type ticket_system: str + """ + + _attribute_map = { + 'ticket_number': {'key': 'ticketNumber', 'type': 'str'}, + 'ticket_system': {'key': 'ticketSystem', 'type': 'str'}, + } + + def __init__(self, *, ticket_number: str=None, ticket_system: str=None, **kwargs) -> None: + super(RoleAssignmentScheduleRequestPropertiesTicketInfo, self).__init__(**kwargs) + self.ticket_number = ticket_number + self.ticket_system = ticket_system + + +class RoleEligibilitySchedule(Model): + """Role eligibility schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role eligibility schedule Id. + :vartype id: str + :ivar name: The role eligibility schedule name. + :vartype name: str + :ivar type: The role eligibility schedule type. + :vartype type: str + :param scope: The role eligibility schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_eligibility_schedule_request_id: The id of + roleEligibilityScheduleRequest used to create this roleAssignmentSchedule + :type role_eligibility_schedule_request_id: str + :param member_type: Membership type of the role eligibility schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :param status: The status of the role eligibility schedule. Possible + values include: 'Accepted', 'PendingEvaluation', 'Granted', 'Denied', + 'PendingProvisioning', 'Provisioned', 'PendingRevocation', 'Revoked', + 'Canceled', 'Failed', 'PendingApprovalProvisioning', 'PendingApproval', + 'FailedAsResourceIsLocked', 'PendingAdminDecision', 'AdminApproved', + 'AdminDenied', 'TimedOut', 'ProvisioningStarted', 'Invalid', + 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: Start DateTime when role eligibility schedule + :type start_date_time: datetime + :param end_date_time: End DateTime when role eligibility schedule + :type end_date_time: datetime + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role eligibility schedule was created + :type created_on: datetime + :param updated_on: DateTime when role eligibility schedule was modified + :type updated_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_eligibility_schedule_request_id': {'key': 'properties.roleEligibilityScheduleRequestId', 'type': 'str'}, + 'member_type': {'key': 'properties.memberType', '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'}, + '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'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, role_eligibility_schedule_request_id: str=None, member_type=None, status=None, start_date_time=None, end_date_time=None, condition: str=None, condition_version: str=None, created_on=None, updated_on=None, expanded_properties=None, **kwargs) -> None: + super(RoleEligibilitySchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = principal_type + self.role_eligibility_schedule_request_id = role_eligibility_schedule_request_id + self.member_type = member_type + self.status = status + self.start_date_time = start_date_time + self.end_date_time = end_date_time + self.condition = condition + self.condition_version = condition_version + self.created_on = created_on + self.updated_on = updated_on + self.expanded_properties = expanded_properties + + +class RoleEligibilityScheduleFilter(Model): + """Role eligibility schedule filter. + + :param principal_id: Returns role eligibility schedule of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role eligibility schedule of the + specific role definition. + :type role_definition_id: str + :param status: Returns role eligibility schedule of the specific status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, role_definition_id: str=None, status: str=None, **kwargs) -> None: + super(RoleEligibilityScheduleFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + self.status = status + + +class RoleEligibilityScheduleInstance(Model): + """Information about current or upcoming role eligibility schedule instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role eligibility schedule instance ID. + :vartype id: str + :ivar name: The role eligibility schedule instance name. + :vartype name: str + :ivar type: The role eligibility schedule instance type. + :vartype type: str + :param scope: The role eligibility schedule scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :type principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param role_eligibility_schedule_id: Id of the master role eligibility + schedule + :type role_eligibility_schedule_id: str + :param status: The status of the role eligibility schedule instance. + Possible values include: 'Accepted', 'PendingEvaluation', 'Granted', + 'Denied', 'PendingProvisioning', 'Provisioned', 'PendingRevocation', + 'Revoked', 'Canceled', 'Failed', 'PendingApprovalProvisioning', + 'PendingApproval', 'FailedAsResourceIsLocked', 'PendingAdminDecision', + 'AdminApproved', 'AdminDenied', 'TimedOut', 'ProvisioningStarted', + 'Invalid', 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :type status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :param start_date_time: The startDateTime of the role eligibility schedule + instance + :type start_date_time: datetime + :param end_date_time: The endDateTime of the role eligibility schedule + instance + :type end_date_time: datetime + :param member_type: Membership type of the role eligibility schedule. + Possible values include: 'Inherited', 'Direct', 'Group' + :type member_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.MemberType + :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. Currently accepted + value is '2.0' + :type condition_version: str + :param created_on: DateTime when role eligibility schedule was created + :type created_on: datetime + :param expanded_properties: Additional properties of principal, scope and + role definition + :type expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _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'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'role_eligibility_schedule_id': {'key': 'properties.roleEligibilityScheduleId', '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'}, + 'member_type': {'key': 'properties.memberType', 'type': 'str'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, role_eligibility_schedule_id: str=None, status=None, start_date_time=None, end_date_time=None, member_type=None, condition: str=None, condition_version: str=None, created_on=None, expanded_properties=None, **kwargs) -> None: + super(RoleEligibilityScheduleInstance, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = principal_type + self.role_eligibility_schedule_id = role_eligibility_schedule_id + self.status = status + self.start_date_time = start_date_time + self.end_date_time = end_date_time + self.member_type = member_type + self.condition = condition + self.condition_version = condition_version + self.created_on = created_on + self.expanded_properties = expanded_properties + + +class RoleEligibilityScheduleInstanceFilter(Model): + """Role eligibility schedule instance filter. + + :param principal_id: Returns role eligibility schedule instances of the + specific principal. + :type principal_id: str + :param role_definition_id: Returns role eligibility schedule instances of + the specific role definition. + :type role_definition_id: str + :param status: Returns role eligibility schedule instances of the specific + status. + :type status: str + :param role_eligibility_schedule_id: Returns role eligibility schedule + instances belonging to a specific role eligibility schedule. + :type role_eligibility_schedule_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'role_eligibility_schedule_id': {'key': 'roleEligibilityScheduleId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, role_definition_id: str=None, status: str=None, role_eligibility_schedule_id: str=None, **kwargs) -> None: + super(RoleEligibilityScheduleInstanceFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + self.status = status + self.role_eligibility_schedule_id = role_eligibility_schedule_id + + +class RoleEligibilityScheduleRequest(Model): + """Role Eligibility schedule request. + + 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. + + :ivar id: The role eligibility schedule request ID. + :vartype id: str + :ivar name: The role eligibility schedule request name. + :vartype name: str + :ivar type: The role eligibility schedule request type. + :vartype type: str + :ivar scope: The role eligibility schedule request scope. + :vartype scope: str + :param role_definition_id: Required. The role definition ID. + :type role_definition_id: str + :param principal_id: Required. The principal ID. + :type principal_id: str + :ivar principal_type: The principal type of the assigned principal ID. + Possible values include: 'User', 'Group', 'ServicePrincipal', 'Unknown', + 'DirectoryRoleTemplate', 'ForeignGroup', 'Application', 'MSI', + 'DirectoryObjectOrGroup', 'Everyone', 'Device' + :vartype principal_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.PrincipalType + :param request_type: Required. The type of the role assignment schedule + request. Eg: SelfActivate, AdminAssign etc. Possible values include: + 'AdminAssign', 'AdminRemove', 'AdminUpdate', 'AdminExtend', 'AdminRenew', + 'SelfActivate', 'SelfDeactivate', 'SelfExtend', 'SelfRenew' + :type request_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.RequestType + :ivar status: The status of the role eligibility schedule request. + Possible values include: 'Accepted', 'PendingEvaluation', 'Granted', + 'Denied', 'PendingProvisioning', 'Provisioned', 'PendingRevocation', + 'Revoked', 'Canceled', 'Failed', 'PendingApprovalProvisioning', + 'PendingApproval', 'FailedAsResourceIsLocked', 'PendingAdminDecision', + 'AdminApproved', 'AdminDenied', 'TimedOut', 'ProvisioningStarted', + 'Invalid', 'PendingScheduleCreation', 'ScheduleCreated', + 'PendingExternalProvisioning' + :vartype status: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Status + :ivar approval_id: The approvalId of the role eligibility schedule + request. + :vartype approval_id: str + :param schedule_info: Schedule info of the role eligibility schedule + :type schedule_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo + :param target_role_eligibility_schedule_id: The resultant role eligibility + schedule id or the role eligibility schedule id being updated + :type target_role_eligibility_schedule_id: str + :param target_role_eligibility_schedule_instance_id: The role eligibility + schedule instance id being updated + :type target_role_eligibility_schedule_instance_id: str + :param justification: Justification for the role eligibility + :type justification: str + :param ticket_info: Ticket Info of the role eligibility + :type ticket_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPropertiesTicketInfo + :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. Currently accepted + value is '2.0' + :type condition_version: str + :ivar created_on: DateTime when role eligibility schedule request was + created + :vartype created_on: datetime + :ivar requestor_id: Id of the user who created this request + :vartype requestor_id: str + :ivar expanded_properties: Additional properties of principal, scope and + role definition + :vartype expanded_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ExpandedProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope': {'readonly': True}, + 'role_definition_id': {'required': True}, + 'principal_id': {'required': True}, + 'principal_type': {'readonly': True}, + 'request_type': {'required': True}, + 'status': {'readonly': True}, + 'approval_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'requestor_id': {'readonly': True}, + 'expanded_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'approval_id': {'key': 'properties.approvalId', 'type': 'str'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'RoleEligibilityScheduleRequestPropertiesScheduleInfo'}, + 'target_role_eligibility_schedule_id': {'key': 'properties.targetRoleEligibilityScheduleId', 'type': 'str'}, + 'target_role_eligibility_schedule_instance_id': {'key': 'properties.targetRoleEligibilityScheduleInstanceId', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + 'ticket_info': {'key': 'properties.ticketInfo', 'type': 'RoleEligibilityScheduleRequestPropertiesTicketInfo'}, + 'condition': {'key': 'properties.condition', 'type': 'str'}, + 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'requestor_id': {'key': 'properties.requestorId', 'type': 'str'}, + 'expanded_properties': {'key': 'properties.expandedProperties', 'type': 'ExpandedProperties'}, + } + + def __init__(self, *, role_definition_id: str, principal_id: str, request_type, schedule_info=None, target_role_eligibility_schedule_id: str=None, target_role_eligibility_schedule_instance_id: str=None, justification: str=None, ticket_info=None, condition: str=None, condition_version: str=None, **kwargs) -> None: + super(RoleEligibilityScheduleRequest, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = None + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.principal_type = None + self.request_type = request_type + self.status = None + self.approval_id = None + self.schedule_info = schedule_info + self.target_role_eligibility_schedule_id = target_role_eligibility_schedule_id + self.target_role_eligibility_schedule_instance_id = target_role_eligibility_schedule_instance_id + self.justification = justification + self.ticket_info = ticket_info + self.condition = condition + self.condition_version = condition_version + self.created_on = None + self.requestor_id = None + self.expanded_properties = None + + +class RoleEligibilityScheduleRequestFilter(Model): + """Role eligibility schedule request filter. + + :param principal_id: Returns role eligibility requests of the specific + principal. + :type principal_id: str + :param role_definition_id: Returns role eligibility requests of the + specific role definition. + :type role_definition_id: str + :param requestor_id: Returns role eligibility requests created by specific + principal. + :type requestor_id: str + :param status: Returns role eligibility requests of specific status. + :type status: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'requestor_id': {'key': 'requestorId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, role_definition_id: str=None, requestor_id: str=None, status: str=None, **kwargs) -> None: + super(RoleEligibilityScheduleRequestFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + self.requestor_id = requestor_id + self.status = status + + +class RoleEligibilityScheduleRequestPropertiesScheduleInfo(Model): + """Schedule info of the role eligibility schedule. + + :param start_date_time: Start DateTime of the role eligibility schedule. + :type start_date_time: datetime + :param expiration: Expiration of the role eligibility schedule + :type expiration: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + """ + + _attribute_map = { + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'expiration': {'key': 'expiration', 'type': 'RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration'}, + } + + def __init__(self, *, start_date_time=None, expiration=None, **kwargs) -> None: + super(RoleEligibilityScheduleRequestPropertiesScheduleInfo, self).__init__(**kwargs) + self.start_date_time = start_date_time + self.expiration = expiration + + +class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(Model): + """Expiration of the role eligibility schedule. + + :param type: Type of the role eligibility schedule expiration. Possible + values include: 'AfterDuration', 'AfterDateTime', 'NoExpiration' + :type type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.Type + :param end_date_time: End DateTime of the role eligibility schedule. + :type end_date_time: datetime + :param duration: Duration of the role eligibility schedule in TimeSpan. + :type duration: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, *, type=None, end_date_time=None, duration: str=None, **kwargs) -> None: + super(RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration, self).__init__(**kwargs) + self.type = type + self.end_date_time = end_date_time + self.duration = duration + + +class RoleEligibilityScheduleRequestPropertiesTicketInfo(Model): + """Ticket Info of the role eligibility. + + :param ticket_number: Ticket number for the role eligibility + :type ticket_number: str + :param ticket_system: Ticket system name for the role eligibility + :type ticket_system: str + """ + + _attribute_map = { + 'ticket_number': {'key': 'ticketNumber', 'type': 'str'}, + 'ticket_system': {'key': 'ticketSystem', 'type': 'str'}, + } + + def __init__(self, *, ticket_number: str=None, ticket_system: str=None, **kwargs) -> None: + super(RoleEligibilityScheduleRequestPropertiesTicketInfo, self).__init__(**kwargs) + self.ticket_number = ticket_number + self.ticket_system = ticket_system + + +class RoleManagementPolicy(Model): + """Role management policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role management policy Id. + :vartype id: str + :ivar name: The role management policy name. + :vartype name: str + :ivar type: The role management policy type. + :vartype type: str + :param scope: The role management policy scope. + :type scope: str + :param display_name: The role management policy display name. + :type display_name: str + :param description: The role management policy description. + :type description: str + :param is_organization_default: The role management policy is default + policy. + :type is_organization_default: bool + :param last_modified_by: + :type last_modified_by: + ~azure.mgmt.authorization.v2020_10_01_preview.models.Principal + :ivar last_modified_date_time: The last modified date time. + :vartype last_modified_date_time: datetime + :param rules: The rule applied to the policy. + :type rules: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRule] + :ivar effective_rules: The readonly computed rule applied to the policy. + :vartype effective_rules: + list[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRule] + :ivar policy_properties: Additional properties of scope + :vartype policy_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_date_time': {'readonly': True}, + 'effective_rules': {'readonly': True}, + 'policy_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_organization_default': {'key': 'properties.isOrganizationDefault', 'type': 'bool'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'Principal'}, + 'last_modified_date_time': {'key': 'properties.lastModifiedDateTime', 'type': 'iso-8601'}, + 'rules': {'key': 'properties.rules', 'type': '[RoleManagementPolicyRule]'}, + 'effective_rules': {'key': 'properties.effectiveRules', 'type': '[RoleManagementPolicyRule]'}, + 'policy_properties': {'key': 'properties.policyProperties', 'type': 'PolicyProperties'}, + } + + def __init__(self, *, scope: str=None, display_name: str=None, description: str=None, is_organization_default: bool=None, last_modified_by=None, rules=None, **kwargs) -> None: + super(RoleManagementPolicy, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.display_name = display_name + self.description = description + self.is_organization_default = is_organization_default + self.last_modified_by = last_modified_by + self.last_modified_date_time = None + self.rules = rules + self.effective_rules = None + self.policy_properties = None + + +class RoleManagementPolicyRule(Model): + """The role management policy rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RoleManagementPolicyApprovalRule, + RoleManagementPolicyAuthenticationContextRule, + RoleManagementPolicyEnablementRule, RoleManagementPolicyExpirationRule, + RoleManagementPolicyNotificationRule + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + _subtype_map = { + 'rule_type': {'RoleManagementPolicyApprovalRule': 'RoleManagementPolicyApprovalRule', 'RoleManagementPolicyAuthenticationContextRule': 'RoleManagementPolicyAuthenticationContextRule', 'RoleManagementPolicyEnablementRule': 'RoleManagementPolicyEnablementRule', 'RoleManagementPolicyExpirationRule': 'RoleManagementPolicyExpirationRule', 'RoleManagementPolicyNotificationRule': 'RoleManagementPolicyNotificationRule'} + } + + def __init__(self, *, id: str=None, target=None, **kwargs) -> None: + super(RoleManagementPolicyRule, self).__init__(**kwargs) + self.id = id + self.target = target + self.rule_type = None + + +class RoleManagementPolicyApprovalRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param setting: The approval setting + :type setting: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ApprovalSettings + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'setting': {'key': 'setting', 'type': 'ApprovalSettings'}, + } + + def __init__(self, *, id: str=None, target=None, setting=None, **kwargs) -> None: + super(RoleManagementPolicyApprovalRule, self).__init__(id=id, target=target, **kwargs) + self.setting = setting + self.rule_type = 'RoleManagementPolicyApprovalRule' + + +class RoleManagementPolicyAssignment(Model): + """Role management policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role management policy Id. + :vartype id: str + :ivar name: The role management policy name. + :vartype name: str + :ivar type: The role management policy type. + :vartype type: str + :param scope: The role management policy scope. + :type scope: str + :param role_definition_id: The role definition of management policy + assignment. + :type role_definition_id: str + :param policy_id: The policy id role management policy assignment. + :type policy_id: str + :ivar policy_assignment_properties: Additional properties of scope, role + definition and policy + :vartype policy_assignment_properties: + ~azure.mgmt.authorization.v2020_10_01_preview.models.PolicyAssignmentProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_assignment_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'policy_assignment_properties': {'key': 'properties.policyAssignmentProperties', 'type': 'PolicyAssignmentProperties'}, + } + + def __init__(self, *, scope: str=None, role_definition_id: str=None, policy_id: str=None, **kwargs) -> None: + super(RoleManagementPolicyAssignment, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.role_definition_id = role_definition_id + self.policy_id = policy_id + self.policy_assignment_properties = None + + +class RoleManagementPolicyAuthenticationContextRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param is_enabled: The value indicating if rule is enabled. + :type is_enabled: bool + :param claim_value: The claim value. + :type claim_value: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'claim_value': {'key': 'claimValue', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, target=None, is_enabled: bool=None, claim_value: str=None, **kwargs) -> None: + super(RoleManagementPolicyAuthenticationContextRule, self).__init__(id=id, target=target, **kwargs) + self.is_enabled = is_enabled + self.claim_value = claim_value + self.rule_type = 'RoleManagementPolicyAuthenticationContextRule' + + +class RoleManagementPolicyEnablementRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param enabled_rules: The list of enabled rules. + :type enabled_rules: list[str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.EnablementRules] + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'enabled_rules': {'key': 'enabledRules', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, target=None, enabled_rules=None, **kwargs) -> None: + super(RoleManagementPolicyEnablementRule, self).__init__(id=id, target=target, **kwargs) + self.enabled_rules = enabled_rules + self.rule_type = 'RoleManagementPolicyEnablementRule' + + +class RoleManagementPolicyExpirationRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param is_expiration_required: The value indicating whether expiration is + required. + :type is_expiration_required: bool + :param maximum_duration: The maximum duration of expiration in timespan. + :type maximum_duration: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'is_expiration_required': {'key': 'isExpirationRequired', 'type': 'bool'}, + 'maximum_duration': {'key': 'maximumDuration', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, target=None, is_expiration_required: bool=None, maximum_duration: str=None, **kwargs) -> None: + super(RoleManagementPolicyExpirationRule, self).__init__(id=id, target=target, **kwargs) + self.is_expiration_required = is_expiration_required + self.maximum_duration = maximum_duration + self.rule_type = 'RoleManagementPolicyExpirationRule' + + +class RoleManagementPolicyNotificationRule(RoleManagementPolicyRule): + """The role management policy rule. + + All required parameters must be populated in order to send to Azure. + + :param id: The id of the rule. + :type id: str + :param target: The target of the current rule. + :type target: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyRuleTarget + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :param notification_type: The type of notification. Possible values + include: 'Email' + :type notification_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.NotificationDeliveryMechanism + :param notification_level: The notification level. Possible values + include: 'None', 'Critical', 'All' + :type notification_level: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.NotificationLevel + :param recipient_type: The recipient type. Possible values include: + 'Requestor', 'Approver', 'Admin' + :type recipient_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.RecipientType + :param notification_recipients: The list notification recipients. + :type notification_recipients: list[str] + :param is_default_recipients_enabled: Its value determine if the + notification need to be sent to the recipient type specified in policy + rule. + :type is_default_recipients_enabled: bool + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'RoleManagementPolicyRuleTarget'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'notification_type': {'key': 'notificationType', 'type': 'str'}, + 'notification_level': {'key': 'notificationLevel', 'type': 'str'}, + 'recipient_type': {'key': 'recipientType', 'type': 'str'}, + 'notification_recipients': {'key': 'notificationRecipients', 'type': '[str]'}, + 'is_default_recipients_enabled': {'key': 'isDefaultRecipientsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, target=None, notification_type=None, notification_level=None, recipient_type=None, notification_recipients=None, is_default_recipients_enabled: bool=None, **kwargs) -> None: + super(RoleManagementPolicyNotificationRule, self).__init__(id=id, target=target, **kwargs) + self.notification_type = notification_type + self.notification_level = notification_level + self.recipient_type = recipient_type + self.notification_recipients = notification_recipients + self.is_default_recipients_enabled = is_default_recipients_enabled + self.rule_type = 'RoleManagementPolicyNotificationRule' + + +class RoleManagementPolicyRuleTarget(Model): + """The role management policy rule target. + + :param caller: The caller of the setting. + :type caller: str + :param operations: The type of operation. + :type operations: list[str] + :param level: The assignment level to which it is applied. + :type level: str + :param target_objects: The list of target objects. + :type target_objects: list[str] + :param inheritable_settings: The list of inheritable settings. + :type inheritable_settings: list[str] + :param enforced_settings: The list of enforced settings. + :type enforced_settings: list[str] + """ + + _attribute_map = { + 'caller': {'key': 'caller', 'type': 'str'}, + 'operations': {'key': 'operations', 'type': '[str]'}, + 'level': {'key': 'level', 'type': 'str'}, + 'target_objects': {'key': 'targetObjects', 'type': '[str]'}, + 'inheritable_settings': {'key': 'inheritableSettings', 'type': '[str]'}, + 'enforced_settings': {'key': 'enforcedSettings', 'type': '[str]'}, + } + + def __init__(self, *, caller: str=None, operations=None, level: str=None, target_objects=None, inheritable_settings=None, enforced_settings=None, **kwargs) -> None: + super(RoleManagementPolicyRuleTarget, self).__init__(**kwargs) + self.caller = caller + self.operations = operations + self.level = level + self.target_objects = target_objects + self.inheritable_settings = inheritable_settings + self.enforced_settings = enforced_settings + + +class UserSet(Model): + """The detail of a user. + + :param user_type: The type of user. Possible values include: 'User', + 'Group' + :type user_type: str or + ~azure.mgmt.authorization.v2020_10_01_preview.models.UserType + :param is_backup: The value indicating whether the user is a backup + fallback approver + :type is_backup: bool + :param id: The object id of the user. + :type id: str + :param description: The description of the user. + :type description: str + """ + + _attribute_map = { + 'user_type': {'key': 'userType', 'type': 'str'}, + 'is_backup': {'key': 'isBackup', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, user_type=None, is_backup: bool=None, id: str=None, description: str=None, **kwargs) -> None: + super(UserSet, self).__init__(**kwargs) + self.user_type = user_type + self.is_backup = is_backup + self.id = id + self.description = description + + +class ValidationResponse(Model): + """Validation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_valid: Whether or not validation succeeded + :vartype is_valid: bool + :param error_info: Failed validation result details + :type error_info: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ValidationResponseErrorInfo + """ + + _validation = { + 'is_valid': {'readonly': True}, + } + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'error_info': {'key': 'errorInfo', 'type': 'ValidationResponseErrorInfo'}, + } + + def __init__(self, *, error_info=None, **kwargs) -> None: + super(ValidationResponse, self).__init__(**kwargs) + self.is_valid = None + self.error_info = error_info + + +class ValidationResponseErrorInfo(Model): + """Failed validation result details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code indicating why validation failed + :vartype code: str + :ivar message: Message indicating why validation failed + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ValidationResponseErrorInfo, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_paged_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..b82c4a0ea164 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/models/_paged_models.py @@ -0,0 +1,144 @@ +# 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 RoleAssignmentSchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleAssignmentSchedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleAssignmentSchedule]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleAssignmentSchedulePaged, self).__init__(*args, **kwargs) +class RoleAssignmentScheduleInstancePaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleAssignmentScheduleInstance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleAssignmentScheduleInstance]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleAssignmentScheduleInstancePaged, self).__init__(*args, **kwargs) +class RoleAssignmentScheduleRequestPaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleAssignmentScheduleRequest ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleAssignmentScheduleRequest]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleAssignmentScheduleRequestPaged, self).__init__(*args, **kwargs) +class RoleEligibilitySchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleEligibilitySchedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleEligibilitySchedule]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleEligibilitySchedulePaged, self).__init__(*args, **kwargs) +class RoleEligibilityScheduleInstancePaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleEligibilityScheduleInstance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleEligibilityScheduleInstance]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleEligibilityScheduleInstancePaged, self).__init__(*args, **kwargs) +class RoleEligibilityScheduleRequestPaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleEligibilityScheduleRequest ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleEligibilityScheduleRequest]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleEligibilityScheduleRequestPaged, self).__init__(*args, **kwargs) +class RoleManagementPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleManagementPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleManagementPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleManagementPolicyPaged, self).__init__(*args, **kwargs) +class RoleManagementPolicyAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleManagementPolicyAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleManagementPolicyAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleManagementPolicyAssignmentPaged, self).__init__(*args, **kwargs) +class EligibleChildResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`EligibleChildResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EligibleChildResource]'} + } + + def __init__(self, *args, **kwargs): + + super(EligibleChildResourcePaged, self).__init__(*args, **kwargs) +class RoleAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleAssignmentPaged, self).__init__(*args, **kwargs) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/__init__.py new file mode 100644 index 000000000000..3b11d041a46e --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/__init__.py @@ -0,0 +1,34 @@ +# 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 ._role_assignment_schedules_operations import RoleAssignmentSchedulesOperations +from ._role_assignment_schedule_instances_operations import RoleAssignmentScheduleInstancesOperations +from ._role_assignment_schedule_requests_operations import RoleAssignmentScheduleRequestsOperations +from ._role_eligibility_schedules_operations import RoleEligibilitySchedulesOperations +from ._role_eligibility_schedule_instances_operations import RoleEligibilityScheduleInstancesOperations +from ._role_eligibility_schedule_requests_operations import RoleEligibilityScheduleRequestsOperations +from ._role_management_policies_operations import RoleManagementPoliciesOperations +from ._role_management_policy_assignments_operations import RoleManagementPolicyAssignmentsOperations +from ._eligible_child_resources_operations import EligibleChildResourcesOperations +from ._role_assignments_operations import RoleAssignmentsOperations + +__all__ = [ + 'RoleAssignmentSchedulesOperations', + 'RoleAssignmentScheduleInstancesOperations', + 'RoleAssignmentScheduleRequestsOperations', + 'RoleEligibilitySchedulesOperations', + 'RoleEligibilityScheduleInstancesOperations', + 'RoleEligibilityScheduleRequestsOperations', + 'RoleManagementPoliciesOperations', + 'RoleManagementPolicyAssignmentsOperations', + 'EligibleChildResourcesOperations', + 'RoleAssignmentsOperations', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_eligible_child_resources_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_eligible_child_resources_operations.py new file mode 100644 index 000000000000..25e397cafbae --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_eligible_child_resources_operations.py @@ -0,0 +1,117 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class EligibleChildResourcesOperations(object): + """EligibleChildResourcesOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def get( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Get the child resources of a resource on which user has eligible + access. + + :param scope: The scope of the role management policy. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=resourceType+eq+'Subscription' to filter on only resource of + type = 'Subscription'. Use + $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' + to filter on resource of type = 'Subscription' or 'ResourceGroup' + :type filter: 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 EligibleChildResource + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.EligibleChildResourcePaged[~azure.mgmt.authorization.v2020_10_01_preview.models.EligibleChildResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.EligibleChildResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/eligibleChildResources'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_instances_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_instances_operations.py new file mode 100644 index 000000000000..ee1a4810cd02 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_instances_operations.py @@ -0,0 +1,182 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleAssignmentScheduleInstancesOperations(object): + """RoleAssignmentScheduleInstancesOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def list_for_scope( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets role assignment schedule instances of a role assignment schedule. + + :param scope: The scope of the role assignment schedule. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignment schedules at or above + the scope. Use $filter=principalId eq {id} to return all role + assignment schedules at, above or below the scope for the specified + principal. Use $filter=assignedTo('{userId}') to return all role + assignment schedule instances for the user. Use $filter=asTarget() to + return all role assignment schedule instances created for the current + user. + :type filter: 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 RoleAssignmentScheduleInstance + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleInstancePaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleInstance] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentScheduleInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances'} + + def get( + self, scope, role_assignment_schedule_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified role assignment schedule instance. + + :param scope: The scope of the role assignments schedules. + :type scope: str + :param role_assignment_schedule_instance_name: The name (hash of + schedule name + time) of the role assignment schedule to get. + :type role_assignment_schedule_instance_name: 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: RoleAssignmentScheduleInstance or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleInstance + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentScheduleInstanceName': self._serialize.url("role_assignment_schedule_instance_name", role_assignment_schedule_instance_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignmentScheduleInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_requests_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_requests_operations.py new file mode 100644 index 000000000000..f47c386a25ea --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedule_requests_operations.py @@ -0,0 +1,315 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleAssignmentScheduleRequestsOperations(object): + """RoleAssignmentScheduleRequestsOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def create( + self, scope, role_assignment_schedule_request_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates a role assignment schedule request. + + :param scope: The scope of the role assignment schedule request to + create. The scope can be any REST resource instance. For example, use + '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' + for a subscription, + '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + for a resource group, and + '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + for a resource. + :type scope: str + :param role_assignment_schedule_request_name: The name of the role + assignment to create. It can be any valid GUID. + :type role_assignment_schedule_request_name: str + :param parameters: Parameters for the role assignment schedule + request. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequest + :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: RoleAssignmentScheduleRequest or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequest + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentScheduleRequestName': self._serialize.url("role_assignment_schedule_request_name", role_assignment_schedule_request_name, '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', min_length=1) + + # 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(parameters, 'RoleAssignmentScheduleRequest') + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('RoleAssignmentScheduleRequest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'} + + def get( + self, scope, role_assignment_schedule_request_name, custom_headers=None, raw=False, **operation_config): + """Get the specified role assignment schedule request. + + :param scope: The scope of the role assignment schedule request. + :type scope: str + :param role_assignment_schedule_request_name: The name (guid) of the + role assignment schedule request to get. + :type role_assignment_schedule_request_name: 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: RoleAssignmentScheduleRequest or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequest + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentScheduleRequestName': self._serialize.url("role_assignment_schedule_request_name", role_assignment_schedule_request_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignmentScheduleRequest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'} + + def list_for_scope( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets role assignment schedule requests for a scope. + + :param scope: The scope of the role assignments schedule requests. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignment schedule requests at + or above the scope. Use $filter=principalId eq {id} to return all role + assignment schedule requests at, above or below the scope for the + specified principal. Use $filter=asRequestor() to return all role + assignment schedule requests requested by the current user. Use + $filter=asTarget() to return all role assignment schedule requests + created for the current user. Use $filter=asApprover() to return all + role assignment schedule requests where the current user is an + approver. + :type filter: 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 RoleAssignmentScheduleRequest + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequestPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentScheduleRequest] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentScheduleRequestPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'} + + def cancel( + self, scope, role_assignment_schedule_request_name, custom_headers=None, raw=False, **operation_config): + """Cancels a pending role assignment schedule request. + + :param scope: The scope of the role assignment request to cancel. + :type scope: str + :param role_assignment_schedule_request_name: The name of the role + assignment request to cancel. + :type role_assignment_schedule_request_name: 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:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentScheduleRequestName': self._serialize.url("role_assignment_schedule_request_name", role_assignment_schedule_request_name, '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', min_length=1) + + # 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 [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedules_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedules_operations.py new file mode 100644 index 000000000000..ad39968ee0f8 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignment_schedules_operations.py @@ -0,0 +1,180 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleAssignmentSchedulesOperations(object): + """RoleAssignmentSchedulesOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def get( + self, scope, role_assignment_schedule_name, custom_headers=None, raw=False, **operation_config): + """Get the specified role assignment schedule for a resource scope. + + :param scope: The scope of the role assignment schedule. + :type scope: str + :param role_assignment_schedule_name: The name (guid) of the role + assignment schedule to get. + :type role_assignment_schedule_name: 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: RoleAssignmentSchedule or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentSchedule + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentScheduleName': self._serialize.url("role_assignment_schedule_name", role_assignment_schedule_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignmentSchedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'} + + def list_for_scope( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets role assignment schedules for a resource scope. + + :param scope: The scope of the role assignments schedules. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignment schedules at or above + the scope. Use $filter=principalId eq {id} to return all role + assignment schedules at, above or below the scope for the specified + principal. Use $filter=assignedTo('{userId}') to return all role + assignment schedules for the current user. Use $filter=asTarget() to + return all role assignment schedules created for the current user. + :type filter: 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 RoleAssignmentSchedule + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentSchedulePaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentSchedule] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentSchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignments_operations.py new file mode 100644 index 000000000000..43ff107f2f3f --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_assignments_operations.py @@ -0,0 +1,926 @@ +# 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 RoleAssignmentsOperations(object): + """RoleAssignmentsOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def list_for_subscription( + self, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """List all role assignments that apply to a subscription. + + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignments at or above the + scope. Use $filter=principalId eq {id} to return all role assignments + at, above or below the scope for the specified principal. + :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 RoleAssignment + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments'} + + def list_for_resource_group( + self, resource_group_name, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """List all role assignments that apply to a resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignments at or above the + scope. Use $filter=principalId eq {id} to return all role assignments + at, above or below the scope for the specified principal. + :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 RoleAssignment + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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', min_length=1) + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments'} + + def list_for_resource( + self, resource_group_name, resource_provider_namespace, resource_type, resource_name, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """List all role assignments that apply to a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param resource_type: The resource type name. For example the type + name of a web app is 'sites' (from Microsoft.Web/sites). + :type resource_type: str + :param resource_name: The resource name. + :type resource_name: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignments at or above the + scope. Use $filter=principalId eq {id} to return all role assignments + at, above or below the scope for the specified principal. + :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 RoleAssignment + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str', skip_quote=True), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', skip_quote=True) + } + 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', min_length=1) + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments'} + + def get( + self, scope, role_assignment_name, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """Get a role assignment by scope and name. + + :param scope: The scope of the operation or resource. Valid scopes + are: subscription (format: '/subscriptions/{subscriptionId}'), + resource group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param role_assignment_name: The name of the role assignment. It can + be any valid GUID. + :type role_assignment_name: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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: RoleAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentName': self._serialize.url("role_assignment_name", role_assignment_name, 'str', skip_quote=True) + } + 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', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'} + + def create( + self, scope, role_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a role assignment by scope and name. + + :param scope: The scope of the operation or resource. Valid scopes + are: subscription (format: '/subscriptions/{subscriptionId}'), + resource group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param role_assignment_name: The name of the role assignment. It can + be any valid GUID. + :type role_assignment_name: str + :param parameters: Parameters for the role assignment. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentCreateParameters + :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: RoleAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentName': self._serialize.url("role_assignment_name", role_assignment_name, 'str', skip_quote=True) + } + 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', min_length=1) + + # 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(parameters, 'RoleAssignmentCreateParameters') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignment', response) + if response.status_code == 201: + deserialized = self._deserialize('RoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'} + + def delete( + self, scope, role_assignment_name, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """Delete a role assignment by scope and name. + + :param scope: The scope of the operation or resource. Valid scopes + are: subscription (format: '/subscriptions/{subscriptionId}'), + resource group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param role_assignment_name: The name of the role assignment. It can + be any valid GUID. + :type role_assignment_name: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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: RoleAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentName': self._serialize.url("role_assignment_name", role_assignment_name, 'str', skip_quote=True) + } + 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', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}'} + + def validate( + self, scope, role_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): + """Validate a role assignment create or update operation by scope and + name. + + :param scope: The scope of the operation or resource. Valid scopes + are: subscription (format: '/subscriptions/{subscriptionId}'), + resource group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param role_assignment_name: The name of the role assignment. It can + be any valid GUID. + :type role_assignment_name: str + :param parameters: Parameters for the role assignment. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentCreateParameters + :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: ValidationResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ValidationResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleAssignmentName': self._serialize.url("role_assignment_name", role_assignment_name, 'str', skip_quote=True) + } + 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', min_length=1) + + # 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(parameters, 'RoleAssignmentCreateParameters') + + # Construct and send request + request = self._client.post(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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ValidationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}/validate'} + + def list_for_scope( + self, scope, filter=None, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """List all role assignments that apply to a scope. + + :param scope: The scope of the operation or resource. Valid scopes + are: subscription (format: '/subscriptions/{subscriptionId}'), + resource group (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', + or resource (format: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignments at or above the + scope. Use $filter=principalId eq {id} to return all role assignments + at, above or below the scope for the specified principal. + :type filter: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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 RoleAssignment + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments'} + + def get_by_id( + self, role_assignment_id, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """Get a role assignment by ID. + + :param role_assignment_id: The fully qualified ID of the role + assignment including scope, resource name, and resource type. Format: + /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + Example: + /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ + :type role_assignment_id: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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: RoleAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + } + 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', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{roleAssignmentId}'} + + def create_by_id( + self, role_assignment_id, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a role assignment by ID. + + :param role_assignment_id: The fully qualified ID of the role + assignment including scope, resource name, and resource type. Format: + /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + Example: + /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ + :type role_assignment_id: str + :param parameters: Parameters for the role assignment. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentCreateParameters + :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: RoleAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_by_id.metadata['url'] + path_format_arguments = { + 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + } + 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', min_length=1) + + # 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(parameters, 'RoleAssignmentCreateParameters') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignment', response) + if response.status_code == 201: + deserialized = self._deserialize('RoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_by_id.metadata = {'url': '/{roleAssignmentId}'} + + def delete_by_id( + self, role_assignment_id, tenant_id=None, custom_headers=None, raw=False, **operation_config): + """Delete a role assignment by ID. + + :param role_assignment_id: The fully qualified ID of the role + assignment including scope, resource name, and resource type. Format: + /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + Example: + /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ + :type role_assignment_id: str + :param tenant_id: Tenant ID for cross-tenant request + :type tenant_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: RoleAssignment or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_id.metadata['url'] + path_format_arguments = { + 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + } + 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', min_length=1) + if tenant_id is not None: + query_parameters['tenantId'] = self._serialize.query("tenant_id", tenant_id, '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.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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_by_id.metadata = {'url': '/{roleAssignmentId}'} + + def validate_by_id( + self, role_assignment_id, parameters, custom_headers=None, raw=False, **operation_config): + """Validate a role assignment create or update operation by ID. + + :param role_assignment_id: The fully qualified ID of the role + assignment including scope, resource name, and resource type. Format: + /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + Example: + /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ + :type role_assignment_id: str + :param parameters: Parameters for the role assignment. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleAssignmentCreateParameters + :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: ValidationResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.ValidationResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.validate_by_id.metadata['url'] + path_format_arguments = { + 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + } + 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', min_length=1) + + # 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(parameters, 'RoleAssignmentCreateParameters') + + # Construct and send request + request = self._client.post(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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ValidationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_by_id.metadata = {'url': '/{roleAssignmentId}/validate'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_instances_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_instances_operations.py new file mode 100644 index 000000000000..339491e5dc86 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_instances_operations.py @@ -0,0 +1,182 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleEligibilityScheduleInstancesOperations(object): + """RoleEligibilityScheduleInstancesOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def list_for_scope( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets role eligibility schedule instances of a role eligibility + schedule. + + :param scope: The scope of the role eligibility schedule. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role assignment schedules at or above + the scope. Use $filter=principalId eq {id} to return all role + assignment schedules at, above or below the scope for the specified + principal. Use $filter=assignedTo('{userId}') to return all role + eligibility schedules for the user. Use $filter=asTarget() to return + all role eligibility schedules created for the current user. + :type filter: 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 RoleEligibilityScheduleInstance + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleInstancePaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleInstance] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleEligibilityScheduleInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'} + + def get( + self, scope, role_eligibility_schedule_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified role eligibility schedule instance. + + :param scope: The scope of the role eligibility schedules. + :type scope: str + :param role_eligibility_schedule_instance_name: The name (hash of + schedule name + time) of the role eligibility schedule to get. + :type role_eligibility_schedule_instance_name: 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: RoleEligibilityScheduleInstance or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleInstance + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleEligibilityScheduleInstanceName': self._serialize.url("role_eligibility_schedule_instance_name", role_eligibility_schedule_instance_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleEligibilityScheduleInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_requests_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_requests_operations.py new file mode 100644 index 000000000000..e435af952882 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedule_requests_operations.py @@ -0,0 +1,315 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleEligibilityScheduleRequestsOperations(object): + """RoleEligibilityScheduleRequestsOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def create( + self, scope, role_eligibility_schedule_request_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates a role eligibility schedule request. + + :param scope: The scope of the role eligibility schedule request to + create. The scope can be any REST resource instance. For example, use + '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' + for a subscription, + '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + for a resource group, and + '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + for a resource. + :type scope: str + :param role_eligibility_schedule_request_name: The name of the role + eligibility to create. It can be any valid GUID. + :type role_eligibility_schedule_request_name: str + :param parameters: Parameters for the role eligibility schedule + request. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequest + :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: RoleEligibilityScheduleRequest or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequest + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleEligibilityScheduleRequestName': self._serialize.url("role_eligibility_schedule_request_name", role_eligibility_schedule_request_name, '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', min_length=1) + + # 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(parameters, 'RoleEligibilityScheduleRequest') + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('RoleEligibilityScheduleRequest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'} + + def get( + self, scope, role_eligibility_schedule_request_name, custom_headers=None, raw=False, **operation_config): + """Get the specified role eligibility schedule request. + + :param scope: The scope of the role eligibility schedule request. + :type scope: str + :param role_eligibility_schedule_request_name: The name (guid) of the + role eligibility schedule request to get. + :type role_eligibility_schedule_request_name: 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: RoleEligibilityScheduleRequest or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequest + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleEligibilityScheduleRequestName': self._serialize.url("role_eligibility_schedule_request_name", role_eligibility_schedule_request_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleEligibilityScheduleRequest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'} + + def list_for_scope( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets role eligibility schedule requests for a scope. + + :param scope: The scope of the role eligibility schedule requests. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role eligibility schedule requests at + or above the scope. Use $filter=principalId eq {id} to return all role + eligibility schedule requests at, above or below the scope for the + specified principal. Use $filter=asRequestor() to return all role + eligibility schedule requests requested by the current user. Use + $filter=asTarget() to return all role eligibility schedule requests + created for the current user. Use $filter=asApprover() to return all + role eligibility schedule requests where the current user is an + approver. + :type filter: 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 RoleEligibilityScheduleRequest + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequestPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilityScheduleRequest] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleEligibilityScheduleRequestPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'} + + def cancel( + self, scope, role_eligibility_schedule_request_name, custom_headers=None, raw=False, **operation_config): + """Cancels a pending role eligibility schedule request. + + :param scope: The scope of the role eligibility request to cancel. + :type scope: str + :param role_eligibility_schedule_request_name: The name of the role + eligibility request to cancel. + :type role_eligibility_schedule_request_name: 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:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleEligibilityScheduleRequestName': self._serialize.url("role_eligibility_schedule_request_name", role_eligibility_schedule_request_name, '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', min_length=1) + + # 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 [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedules_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedules_operations.py new file mode 100644 index 000000000000..ad7b9082c25e --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_eligibility_schedules_operations.py @@ -0,0 +1,180 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleEligibilitySchedulesOperations(object): + """RoleEligibilitySchedulesOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def get( + self, scope, role_eligibility_schedule_name, custom_headers=None, raw=False, **operation_config): + """Get the specified role eligibility schedule for a resource scope. + + :param scope: The scope of the role eligibility schedule. + :type scope: str + :param role_eligibility_schedule_name: The name (guid) of the role + eligibility schedule to get. + :type role_eligibility_schedule_name: 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: RoleEligibilitySchedule or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilitySchedule + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleEligibilityScheduleName': self._serialize.url("role_eligibility_schedule_name", role_eligibility_schedule_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleEligibilitySchedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'} + + def list_for_scope( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets role eligibility schedules for a resource scope. + + :param scope: The scope of the role eligibility schedules. + :type scope: str + :param filter: The filter to apply on the operation. Use + $filter=atScope() to return all role eligibility schedules at or above + the scope. Use $filter=principalId eq {id} to return all role + eligibility schedules at, above or below the scope for the specified + principal. Use $filter=assignedTo('{userId}') to return all role + eligibility schedules for the user. Use $filter=asTarget() to return + all role eligibility schedules created for the current user. + :type filter: 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 RoleEligibilitySchedule + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilitySchedulePaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleEligibilitySchedule] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleEligibilitySchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policies_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policies_operations.py new file mode 100644 index 000000000000..3f4d163a351c --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policies_operations.py @@ -0,0 +1,292 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleManagementPoliciesOperations(object): + """RoleManagementPoliciesOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def get( + self, scope, role_management_policy_name, custom_headers=None, raw=False, **operation_config): + """Get the specified role management policy for a resource scope. + + :param scope: The scope of the role management policy. + :type scope: str + :param role_management_policy_name: The name (guid) of the role + management policy to get. + :type role_management_policy_name: 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: RoleManagementPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleManagementPolicyName': self._serialize.url("role_management_policy_name", role_management_policy_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'} + + def update( + self, scope, role_management_policy_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a role management policy. + + :param scope: The scope of the role management policy to upsert. + :type scope: str + :param role_management_policy_name: The name (guid) of the role + management policy to upsert. + :type role_management_policy_name: str + :param parameters: Parameters for the role management policy. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicy + :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: RoleManagementPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleManagementPolicyName': self._serialize.url("role_management_policy_name", role_management_policy_name, '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', min_length=1) + + # 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(parameters, 'RoleManagementPolicy') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'} + + def delete( + self, scope, role_management_policy_name, custom_headers=None, raw=False, **operation_config): + """Delete a role management policy. + + :param scope: The scope of the role management policy to upsert. + :type scope: str + :param role_management_policy_name: The name (guid) of the role + management policy to upsert. + :type role_management_policy_name: 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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleManagementPolicyName': self._serialize.url("role_management_policy_name", role_management_policy_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'} + + def list_for_scope( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets role management policies for a resource scope. + + :param scope: The scope of the role management policy. + :type scope: 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 RoleManagementPolicy + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicy] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleManagementPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policy_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policy_assignments_operations.py new file mode 100644 index 000000000000..f0a5b3e6256c --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/operations/_role_management_policy_assignments_operations.py @@ -0,0 +1,298 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RoleManagementPolicyAssignmentsOperations(object): + """RoleManagementPolicyAssignmentsOperations 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 use for this operation. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def get( + self, scope, role_management_policy_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the specified role management policy assignment for a resource + scope. + + :param scope: The scope of the role management policy. + :type scope: str + :param role_management_policy_assignment_name: The name of format + {guid_guid} the role management policy assignment to get. + :type role_management_policy_assignment_name: 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: RoleManagementPolicyAssignment or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyAssignment + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleManagementPolicyAssignmentName': self._serialize.url("role_management_policy_assignment_name", role_management_policy_assignment_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RoleManagementPolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'} + + def create( + self, scope, role_management_policy_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a role management policy assignment. + + :param scope: The scope of the role management policy assignment to + upsert. + :type scope: str + :param role_management_policy_assignment_name: The name of format + {guid_guid} the role management policy assignment to upsert. + :type role_management_policy_assignment_name: str + :param parameters: Parameters for the role management policy + assignment. + :type parameters: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyAssignment + :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: RoleManagementPolicyAssignment or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyAssignment + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleManagementPolicyAssignmentName': self._serialize.url("role_management_policy_assignment_name", role_management_policy_assignment_name, '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', min_length=1) + + # 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(parameters, 'RoleManagementPolicyAssignment') + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('RoleManagementPolicyAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'} + + def delete( + self, scope, role_management_policy_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete a role management policy assignment. + + :param scope: The scope of the role management policy assignment to + delete. + :type scope: str + :param role_management_policy_assignment_name: The name of format + {guid_guid} the role management policy assignment to delete. + :type role_management_policy_assignment_name: 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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'roleManagementPolicyAssignmentName': self._serialize.url("role_management_policy_assignment_name", role_management_policy_assignment_name, '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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'} + + def list_for_scope( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets role management assignment policies for a resource scope. + + :param scope: The scope of the role management policy. + :type scope: 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 RoleManagementPolicyAssignment + :rtype: + ~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyAssignmentPaged[~azure.mgmt.authorization.v2020_10_01_preview.models.RoleManagementPolicyAssignment] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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', min_length=1) + + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RoleManagementPolicyAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/version.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_01_preview/version.py new file mode 100644 index 000000000000..078fbbef4525 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_10_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 = "2020-10-01-preview" + diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/__init__.py new file mode 100644 index 000000000000..e8714b719dfc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_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/v2021_01_01_preview/_authorization_management_client.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/_authorization_management_client.py new file mode 100644 index 000000000000..f3c588762ac3 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/_authorization_management_client.py @@ -0,0 +1,79 @@ +# 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 RoleAssignmentApprovalOperations +from .operations import RoleAssignmentApprovalStepsOperations +from .operations import RoleAssignmentApprovalStepOperations +from .operations import ScopeRoleAssignmentApprovalOperations +from .operations import ScopeRoleAssignmentApprovalStepsOperations +from .operations import ScopeRoleAssignmentApprovalStepOperations +from . import models + + +class AuthorizationManagementClient(SDKClient): + """Request Approvals service provides the workflow for running request approvals on different kind of resources. + + :ivar config: Configuration for client. + :vartype config: AuthorizationManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.authorization.v2021_01_01_preview.operations.Operations + :ivar role_assignment_approval: RoleAssignmentApproval operations + :vartype role_assignment_approval: azure.mgmt.authorization.v2021_01_01_preview.operations.RoleAssignmentApprovalOperations + :ivar role_assignment_approval_steps: RoleAssignmentApprovalSteps operations + :vartype role_assignment_approval_steps: azure.mgmt.authorization.v2021_01_01_preview.operations.RoleAssignmentApprovalStepsOperations + :ivar role_assignment_approval_step: RoleAssignmentApprovalStep operations + :vartype role_assignment_approval_step: azure.mgmt.authorization.v2021_01_01_preview.operations.RoleAssignmentApprovalStepOperations + :ivar scope_role_assignment_approval: ScopeRoleAssignmentApproval operations + :vartype scope_role_assignment_approval: azure.mgmt.authorization.v2021_01_01_preview.operations.ScopeRoleAssignmentApprovalOperations + :ivar scope_role_assignment_approval_steps: ScopeRoleAssignmentApprovalSteps operations + :vartype scope_role_assignment_approval_steps: azure.mgmt.authorization.v2021_01_01_preview.operations.ScopeRoleAssignmentApprovalStepsOperations + :ivar scope_role_assignment_approval_step: ScopeRoleAssignmentApprovalStep operations + :vartype scope_role_assignment_approval_step: azure.mgmt.authorization.v2021_01_01_preview.operations.ScopeRoleAssignmentApprovalStepOperations + + :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 = '2021-01-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.role_assignment_approval = RoleAssignmentApprovalOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_assignment_approval_steps = RoleAssignmentApprovalStepsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.role_assignment_approval_step = RoleAssignmentApprovalStepOperations( + self._client, self.config, self._serialize, self._deserialize) + self.scope_role_assignment_approval = ScopeRoleAssignmentApprovalOperations( + self._client, self.config, self._serialize, self._deserialize) + self.scope_role_assignment_approval_steps = ScopeRoleAssignmentApprovalStepsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.scope_role_assignment_approval_step = ScopeRoleAssignmentApprovalStepOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/_configuration.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/_configuration.py new file mode 100644 index 000000000000..c192b8088f15 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_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/v2021_01_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/__init__.py new file mode 100644 index 000000000000..d773ca1dce27 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/__init__.py @@ -0,0 +1,52 @@ +# 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 ErrorDefinition, ErrorDefinitionException + from ._models_py3 import ErrorDefinitionProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import RoleAssignmentApproval + from ._models_py3 import RoleAssignmentApprovalStep + from ._models_py3 import RoleAssignmentApprovalStepListResult + from ._models_py3 import RoleAssignmentApprovalStepProperties +except (SyntaxError, ImportError): + from ._models import ErrorDefinition, ErrorDefinitionException + from ._models import ErrorDefinitionProperties + from ._models import Operation + from ._models import OperationDisplay + from ._models import RoleAssignmentApproval + from ._models import RoleAssignmentApprovalStep + from ._models import RoleAssignmentApprovalStepListResult + from ._models import RoleAssignmentApprovalStepProperties +from ._paged_models import OperationPaged +from ._paged_models import RoleAssignmentApprovalPaged +from ._authorization_management_client_enums import ( + RoleAssignmentApprovalActorIdentityType, + RoleAssignmentApprovalStepStatus, + RoleAssignmentApprovalStepReviewResult, +) + +__all__ = [ + 'ErrorDefinition', 'ErrorDefinitionException', + 'ErrorDefinitionProperties', + 'Operation', + 'OperationDisplay', + 'RoleAssignmentApproval', + 'RoleAssignmentApprovalStep', + 'RoleAssignmentApprovalStepListResult', + 'RoleAssignmentApprovalStepProperties', + 'OperationPaged', + 'RoleAssignmentApprovalPaged', + 'RoleAssignmentApprovalActorIdentityType', + 'RoleAssignmentApprovalStepStatus', + 'RoleAssignmentApprovalStepReviewResult', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_authorization_management_client_enums.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_authorization_management_client_enums.py new file mode 100644 index 000000000000..05fee236c4d4 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_authorization_management_client_enums.py @@ -0,0 +1,37 @@ +# 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 RoleAssignmentApprovalActorIdentityType(str, Enum): + + user = "user" + service_principal = "servicePrincipal" + + +class RoleAssignmentApprovalStepStatus(str, Enum): + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + expired = "Expired" + initializing = "Initializing" + escalating = "Escalating" + completing = "Completing" + escalated = "Escalated" + + +class RoleAssignmentApprovalStepReviewResult(str, Enum): + + approve = "Approve" + deny = "Deny" + not_reviewed = "NotReviewed" diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models.py new file mode 100644 index 000000000000..611284ae6725 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models.py @@ -0,0 +1,379 @@ +# 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 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.v2021_01_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.v2021_01_01_preview.models.OperationDisplay + :param origin: Origin of the operation. Values include + user|system|user,system + :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 RoleAssignmentApproval(Model): + """Role Assignment Approval. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment approval id. + :vartype id: str + :ivar name: The role assignment approval unique id. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param stages: This is the collection of stages returned when one does an + expand on it. + :type stages: + list[~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep] + """ + + _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'}, + 'stages': {'key': 'properties.stages', 'type': '[RoleAssignmentApprovalStep]'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentApproval, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.stages = kwargs.get('stages', None) + + +class RoleAssignmentApprovalStep(Model): + """Role assignment approval stage properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment approval stage id. + :vartype id: str + :ivar name: The role assignment approval stage name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param display_name: The display name for the approval stage. + :type display_name: str + :ivar status: This read-only field specifies the status of an approval. + Possible values include: 'NotStarted', 'InProgress', 'Completed', + 'Expired', 'Initializing', 'Escalating', 'Completing', 'Escalated' + :vartype status: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepStatus + :ivar assigned_to_me: Indicates whether the stage is assigned to me for + review + :vartype assigned_to_me: bool + :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.v2021_01_01_preview.models.RoleAssignmentApprovalActorIdentityType + :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 reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :param review_result: The decision on the approval stage. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed' + :type review_result: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'assigned_to_me': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'reviewed_date_time': {'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'}, + 'assigned_to_me': {'key': 'properties.assignedToMe', 'type': 'bool'}, + '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'}, + 'reviewed_date_time': {'key': 'properties.reviewedDateTime', 'type': 'iso-8601'}, + 'review_result': {'key': 'properties.reviewResult', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentApprovalStep, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.display_name = kwargs.get('display_name', None) + self.status = None + self.assigned_to_me = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.reviewed_date_time = None + self.review_result = kwargs.get('review_result', None) + self.justification = kwargs.get('justification', None) + + +class RoleAssignmentApprovalStepListResult(Model): + """List of role assignment approval stage list. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: Role Assignment Approval Step list. + :type value: + list[~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RoleAssignmentApprovalStep]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentApprovalStepListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class RoleAssignmentApprovalStepProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: The display name for the approval stage. + :type display_name: str + :ivar status: This read-only field specifies the status of an approval. + Possible values include: 'NotStarted', 'InProgress', 'Completed', + 'Expired', 'Initializing', 'Escalating', 'Completing', 'Escalated' + :vartype status: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepStatus + :ivar assigned_to_me: Indicates whether the stage is assigned to me for + review + :vartype assigned_to_me: bool + :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.v2021_01_01_preview.models.RoleAssignmentApprovalActorIdentityType + :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 reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :param review_result: The decision on the approval stage. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed' + :type review_result: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + """ + + _validation = { + 'status': {'readonly': True}, + 'assigned_to_me': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'reviewed_date_time': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'assigned_to_me': {'key': 'assignedToMe', 'type': 'bool'}, + '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'}, + 'reviewed_date_time': {'key': 'reviewedDateTime', 'type': 'iso-8601'}, + 'review_result': {'key': 'reviewResult', 'type': 'str'}, + 'justification': {'key': 'justification', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentApprovalStepProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.status = None + self.assigned_to_me = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.reviewed_date_time = None + self.review_result = kwargs.get('review_result', None) + self.justification = kwargs.get('justification', None) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..6d5e77a73d1e --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_models_py3.py @@ -0,0 +1,379 @@ +# 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 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.v2021_01_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.v2021_01_01_preview.models.OperationDisplay + :param origin: Origin of the operation. Values include + user|system|user,system + :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 RoleAssignmentApproval(Model): + """Role Assignment Approval. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment approval id. + :vartype id: str + :ivar name: The role assignment approval unique id. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param stages: This is the collection of stages returned when one does an + expand on it. + :type stages: + list[~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep] + """ + + _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'}, + 'stages': {'key': 'properties.stages', 'type': '[RoleAssignmentApprovalStep]'}, + } + + def __init__(self, *, stages=None, **kwargs) -> None: + super(RoleAssignmentApproval, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.stages = stages + + +class RoleAssignmentApprovalStep(Model): + """Role assignment approval stage properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment approval stage id. + :vartype id: str + :ivar name: The role assignment approval stage name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param display_name: The display name for the approval stage. + :type display_name: str + :ivar status: This read-only field specifies the status of an approval. + Possible values include: 'NotStarted', 'InProgress', 'Completed', + 'Expired', 'Initializing', 'Escalating', 'Completing', 'Escalated' + :vartype status: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepStatus + :ivar assigned_to_me: Indicates whether the stage is assigned to me for + review + :vartype assigned_to_me: bool + :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.v2021_01_01_preview.models.RoleAssignmentApprovalActorIdentityType + :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 reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :param review_result: The decision on the approval stage. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed' + :type review_result: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'assigned_to_me': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'reviewed_date_time': {'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'}, + 'assigned_to_me': {'key': 'properties.assignedToMe', 'type': 'bool'}, + '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'}, + 'reviewed_date_time': {'key': 'properties.reviewedDateTime', 'type': 'iso-8601'}, + 'review_result': {'key': 'properties.reviewResult', 'type': 'str'}, + 'justification': {'key': 'properties.justification', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, review_result=None, justification: str=None, **kwargs) -> None: + super(RoleAssignmentApprovalStep, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.display_name = display_name + self.status = None + self.assigned_to_me = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.reviewed_date_time = None + self.review_result = review_result + self.justification = justification + + +class RoleAssignmentApprovalStepListResult(Model): + """List of role assignment approval stage list. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: Role Assignment Approval Step list. + :type value: + list[~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RoleAssignmentApprovalStep]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(RoleAssignmentApprovalStepListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class RoleAssignmentApprovalStepProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: The display name for the approval stage. + :type display_name: str + :ivar status: This read-only field specifies the status of an approval. + Possible values include: 'NotStarted', 'InProgress', 'Completed', + 'Expired', 'Initializing', 'Escalating', 'Completing', 'Escalated' + :vartype status: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepStatus + :ivar assigned_to_me: Indicates whether the stage is assigned to me for + review + :vartype assigned_to_me: bool + :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.v2021_01_01_preview.models.RoleAssignmentApprovalActorIdentityType + :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 reviewed_date_time: Date Time when a decision was taken. + :vartype reviewed_date_time: datetime + :param review_result: The decision on the approval stage. This value is + initially set to NotReviewed. Approvers can take action of Approve/Deny. + Possible values include: 'Approve', 'Deny', 'NotReviewed' + :type review_result: str or + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepReviewResult + :param justification: Justification provided by approvers for their action + :type justification: str + """ + + _validation = { + 'status': {'readonly': True}, + 'assigned_to_me': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'principal_type': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'user_principal_name': {'readonly': True}, + 'reviewed_date_time': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'assigned_to_me': {'key': 'assignedToMe', 'type': 'bool'}, + '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'}, + 'reviewed_date_time': {'key': 'reviewedDateTime', 'type': 'iso-8601'}, + 'review_result': {'key': 'reviewResult', 'type': 'str'}, + 'justification': {'key': 'justification', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, review_result=None, justification: str=None, **kwargs) -> None: + super(RoleAssignmentApprovalStepProperties, self).__init__(**kwargs) + self.display_name = display_name + self.status = None + self.assigned_to_me = None + self.principal_id = None + self.principal_type = None + self.principal_name = None + self.user_principal_name = None + self.reviewed_date_time = None + self.review_result = review_result + self.justification = justification diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_paged_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..08ac7fd27e21 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/models/_paged_models.py @@ -0,0 +1,40 @@ +# 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 RoleAssignmentApprovalPaged(Paged): + """ + A paging container for iterating over a list of :class:`RoleAssignmentApproval ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoleAssignmentApproval]'} + } + + def __init__(self, *args, **kwargs): + + super(RoleAssignmentApprovalPaged, self).__init__(*args, **kwargs) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/__init__.py new file mode 100644 index 000000000000..bda557459f8c --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/__init__.py @@ -0,0 +1,28 @@ +# 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 ._role_assignment_approval_operations import RoleAssignmentApprovalOperations +from ._role_assignment_approval_steps_operations import RoleAssignmentApprovalStepsOperations +from ._role_assignment_approval_step_operations import RoleAssignmentApprovalStepOperations +from ._scope_role_assignment_approval_operations import ScopeRoleAssignmentApprovalOperations +from ._scope_role_assignment_approval_steps_operations import ScopeRoleAssignmentApprovalStepsOperations +from ._scope_role_assignment_approval_step_operations import ScopeRoleAssignmentApprovalStepOperations + +__all__ = [ + 'Operations', + 'RoleAssignmentApprovalOperations', + 'RoleAssignmentApprovalStepsOperations', + 'RoleAssignmentApprovalStepOperations', + 'ScopeRoleAssignmentApprovalOperations', + 'ScopeRoleAssignmentApprovalStepsOperations', + 'ScopeRoleAssignmentApprovalStepOperations', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_operations.py new file mode 100644 index 000000000000..7ab9c841925b --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-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.v2021_01_01_preview.models.OperationPaged[~azure.mgmt.authorization.v2021_01_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/v2021_01_01_preview/operations/_role_assignment_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_operations.py new file mode 100644 index 000000000000..b69581d93f4f --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_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 RoleAssignmentApprovalOperations(object): + """RoleAssignmentApprovalOperations 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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Get role assignment approvals. + + :param filter: The filter to apply on the operation. Valid values for + $filter are: 'asApprover()', 'asCreatedBy()' and 'asTarget()'. If + $filter is not provided, no filtering is performed. If + $filter=asApprover() is provided, the returned list only includes all + role assignment approvals that the calling user is assigned as an + approver for. If $filter=asCreatedBy() is provided, the returned list + only includes all role assignment approvals that the calling user + created requests for. If $filter=asTarget() is provided, the returned + list only includes all role assignment approvals that the calling user + has requests targeted for. + :type filter: 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 RoleAssignmentApproval + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalPaged[~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApproval] + :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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.RoleAssignmentApprovalPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/roleAssignmentApprovals'} + + def get_by_id( + self, approval_id, custom_headers=None, raw=False, **operation_config): + """Get role assignment approval. + + :param approval_id: The id of the role assignment approval. + :type approval_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: RoleAssignmentApproval or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApproval + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_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('RoleAssignmentApproval', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_step_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_step_operations.py new file mode 100644 index 000000000000..be072e642c6a --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_step_operations.py @@ -0,0 +1,233 @@ +# 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 RoleAssignmentApprovalStepOperations(object): + """RoleAssignmentApprovalStepOperations 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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def get_by_id( + self, approval_id, stage_id, custom_headers=None, raw=False, **operation_config): + """Get role assignment approval. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param stage_id: The id of the role assignment approval stage. + :type stage_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: RoleAssignmentApprovalStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'stageId': self._serialize.url("stage_id", stage_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('RoleAssignmentApprovalStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages/{stageId}'} + + def patch( + self, approval_id, stage_id, properties, custom_headers=None, raw=False, **operation_config): + """Record a decision. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param stage_id: The id of the role assignment approval stage. + :type stage_id: str + :param properties: Role Assignment Approval stage properties to patch. + :type properties: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepProperties + :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: RoleAssignmentApprovalStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.patch.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'stageId': self._serialize.url("stage_id", stage_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, 'RoleAssignmentApprovalStepProperties') + + # 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('RoleAssignmentApprovalStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages/{stageId}'} + + def put( + self, approval_id, stage_id, properties, custom_headers=None, raw=False, **operation_config): + """Record a decision. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param stage_id: The id of the role assignment approval stage. + :type stage_id: str + :param properties: Role Assignment Approval stage properties to put. + :type properties: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepProperties + :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: RoleAssignmentApprovalStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'stageId': self._serialize.url("stage_id", stage_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, 'RoleAssignmentApprovalStepProperties') + + # 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('RoleAssignmentApprovalStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages/{stageId}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_steps_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_steps_operations.py new file mode 100644 index 000000000000..56d0177d9bef --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_role_assignment_approval_steps_operations.py @@ -0,0 +1,97 @@ +# 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 RoleAssignmentApprovalStepsOperations(object): + """RoleAssignmentApprovalStepsOperations 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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list( + self, approval_id, custom_headers=None, raw=False, **operation_config): + """Get role assignment approval. + + :param approval_id: The id of the role assignment approval. + :type approval_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: RoleAssignmentApprovalStepListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_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('RoleAssignmentApprovalStepListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_operations.py new file mode 100644 index 000000000000..626b3f5408b2 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_operations.py @@ -0,0 +1,179 @@ +# 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 ScopeRoleAssignmentApprovalOperations(object): + """ScopeRoleAssignmentApprovalOperations 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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list( + self, scope, filter=None, custom_headers=None, raw=False, **operation_config): + """Get role assignment approvals. + + :param scope: The scope of the resource. + :type scope: str + :param filter: The filter to apply on the operation. Valid values for + $filter are: 'asApprover()', 'asCreatedBy()' and 'asTarget()'. If + $filter is not provided, no filtering is performed. If + $filter=asApprover() is provided, the returned list only includes all + role assignment approvals that the calling user is assigned as an + approver for. If $filter=asCreatedBy() is provided, the returned list + only includes all role assignment approvals that the calling user + created requests for. If $filter=asTarget() is provided, the returned + list only includes all role assignment approvals that the calling user + has requests targeted for. + :type filter: 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 RoleAssignmentApproval + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalPaged[~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApproval] + :raises: + :class:`ErrorDefinitionException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.RoleAssignmentApprovalPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentApprovals'} + + def get_by_id( + self, approval_id, scope, custom_headers=None, raw=False, **operation_config): + """Get role assignment approval. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param scope: The scope of the resource. + :type scope: 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: RoleAssignmentApproval or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApproval + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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('RoleAssignmentApproval', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_step_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_step_operations.py new file mode 100644 index 000000000000..ae5117bc5407 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_step_operations.py @@ -0,0 +1,242 @@ +# 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 ScopeRoleAssignmentApprovalStepOperations(object): + """ScopeRoleAssignmentApprovalStepOperations 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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def get_by_id( + self, approval_id, stage_id, scope, custom_headers=None, raw=False, **operation_config): + """Get role assignment approval. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param stage_id: The id of the role assignment approval stage. + :type stage_id: str + :param scope: The scope of the resource. + :type scope: 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: RoleAssignmentApprovalStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'stageId': self._serialize.url("stage_id", stage_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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('RoleAssignmentApprovalStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages/{stageId}'} + + def patch( + self, approval_id, stage_id, properties, scope, custom_headers=None, raw=False, **operation_config): + """Record a decision. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param stage_id: The id of the role assignment approval stage. + :type stage_id: str + :param properties: Role Assignment Approval stage properties to patch. + :type properties: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepProperties + :param scope: The scope of the resource. + :type scope: 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: RoleAssignmentApprovalStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.patch.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'stageId': self._serialize.url("stage_id", stage_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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, 'RoleAssignmentApprovalStepProperties') + + # 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('RoleAssignmentApprovalStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages/{stageId}'} + + def put( + self, approval_id, stage_id, properties, scope, custom_headers=None, raw=False, **operation_config): + """Record a decision. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param stage_id: The id of the role assignment approval stage. + :type stage_id: str + :param properties: Role Assignment Approval stage properties to put. + :type properties: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepProperties + :param scope: The scope of the resource. + :type scope: 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: RoleAssignmentApprovalStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStep + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'stageId': self._serialize.url("stage_id", stage_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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, 'RoleAssignmentApprovalStepProperties') + + # 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('RoleAssignmentApprovalStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages/{stageId}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_steps_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_steps_operations.py new file mode 100644 index 000000000000..8b63aeb68e91 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/operations/_scope_role_assignment_approval_steps_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 ScopeRoleAssignmentApprovalStepsOperations(object): + """ScopeRoleAssignmentApprovalStepsOperations 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: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list( + self, approval_id, scope, custom_headers=None, raw=False, **operation_config): + """Get role assignment approval. + + :param approval_id: The id of the role assignment approval. + :type approval_id: str + :param scope: The scope of the resource. + :type scope: 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: RoleAssignmentApprovalStepListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.authorization.v2021_01_01_preview.models.RoleAssignmentApprovalStepListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'approvalId': self._serialize.url("approval_id", approval_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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('RoleAssignmentApprovalStepListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignmentApprovals/{approvalId}/stages'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/version.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_01_preview/version.py new file mode 100644 index 000000000000..1b04b3564954 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_01_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 = "2021-01-01-preview" + diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/__init__.py new file mode 100644 index 000000000000..e8714b719dfc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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/v2021_03_01_preview/_authorization_management_client.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/_authorization_management_client.py new file mode 100644 index 000000000000..40e22f7865c1 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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.v2021_03_01_preview.operations.Operations + :ivar access_review_schedule_definitions: AccessReviewScheduleDefinitions operations + :vartype access_review_schedule_definitions: azure.mgmt.authorization.v2021_03_01_preview.operations.AccessReviewScheduleDefinitionsOperations + :ivar access_review_instances: AccessReviewInstances operations + :vartype access_review_instances: azure.mgmt.authorization.v2021_03_01_preview.operations.AccessReviewInstancesOperations + :ivar access_review_instance: AccessReviewInstance operations + :vartype access_review_instance: azure.mgmt.authorization.v2021_03_01_preview.operations.AccessReviewInstanceOperations + :ivar access_review_instance_decisions: AccessReviewInstanceDecisions operations + :vartype access_review_instance_decisions: azure.mgmt.authorization.v2021_03_01_preview.operations.AccessReviewInstanceDecisionsOperations + :ivar access_review_default_settings: AccessReviewDefaultSettings operations + :vartype access_review_default_settings: azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_01_preview.operations.AccessReviewInstancesAssignedForMyApprovalOperations + :ivar access_review_instance_my_decisions: AccessReviewInstanceMyDecisions operations + :vartype access_review_instance_my_decisions: azure.mgmt.authorization.v2021_03_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 = '2021-03-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/v2021_03_01_preview/_configuration.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/_configuration.py new file mode 100644 index 000000000000..c192b8088f15 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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/v2021_03_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/__init__.py new file mode 100644 index 000000000000..e70e2bf103f2 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/__init__.py @@ -0,0 +1,97 @@ +# 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 AccessReviewDecisionIdentity + from ._models_py3 import AccessReviewDecisionProperties + from ._models_py3 import AccessReviewDecisionServicePrincipalIdentity + from ._models_py3 import AccessReviewDecisionUserIdentity + 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 +except (SyntaxError, ImportError): + from ._models import AccessReviewDecision + from ._models import AccessReviewDecisionIdentity + from ._models import AccessReviewDecisionProperties + from ._models import AccessReviewDecisionServicePrincipalIdentity + from ._models import AccessReviewDecisionUserIdentity + 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 ._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, + AccessReviewScopeAssignmentState, + AccessReviewReviewerType, + AccessReviewScheduleDefinitionReviewersType, + AccessReviewInstanceStatus, + AccessRecommendationType, + AccessReviewResult, + AccessReviewApplyResult, +) + +__all__ = [ + 'AccessReviewDecision', + 'AccessReviewDecisionIdentity', + 'AccessReviewDecisionProperties', + 'AccessReviewDecisionServicePrincipalIdentity', + 'AccessReviewDecisionUserIdentity', + 'AccessReviewDefaultSettings', + 'AccessReviewInstance', + 'AccessReviewReviewer', + 'AccessReviewScheduleDefinition', + 'AccessReviewScheduleDefinitionProperties', + 'AccessReviewScheduleSettings', + 'ErrorDefinition', 'ErrorDefinitionException', + 'ErrorDefinitionProperties', + 'Operation', + 'OperationDisplay', + 'OperationPaged', + 'AccessReviewScheduleDefinitionPaged', + 'AccessReviewInstancePaged', + 'AccessReviewDecisionPaged', + 'AccessReviewScheduleDefinitionStatus', + 'AccessReviewActorIdentityType', + 'DefaultDecisionType', + 'AccessReviewRecurrencePatternType', + 'AccessReviewRecurrenceRangeType', + 'AccessReviewScopePrincipalType', + 'AccessReviewScopeAssignmentState', + 'AccessReviewReviewerType', + 'AccessReviewScheduleDefinitionReviewersType', + 'AccessReviewInstanceStatus', + 'AccessRecommendationType', + 'AccessReviewResult', + 'AccessReviewApplyResult', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_authorization_management_client_enums.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_authorization_management_client_enums.py new file mode 100644 index 000000000000..54157301f6b4 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_authorization_management_client_enums.py @@ -0,0 +1,120 @@ +# 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" + guest_user = "guestUser" + service_principal = "servicePrincipal" + + +class AccessReviewScopeAssignmentState(str, Enum): + + eligible = "eligible" + active = "active" + + +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/v2021_03_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models.py new file mode 100644 index 000000000000..937701d45f8f --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models.py @@ -0,0 +1,1190 @@ +# 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 id1: The id of principal whose access was reviewed. + :vartype id1: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id2: The id of resource associated with a decision record. + :vartype id2: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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}, + 'id1': {'readonly': True}, + 'display_name': {'readonly': True}, + 'id2': {'readonly': True}, + 'display_name1': {'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'}, + 'id1': {'key': 'properties.principal.id', 'type': 'str'}, + 'display_name': {'key': 'properties.principal.displayName', 'type': 'str'}, + 'id2': {'key': 'properties.resource.id', 'type': 'str'}, + 'display_name1': {'key': 'properties.resource.displayName', '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.id1 = None + self.display_name = None + self.id2 = None + self.display_name1 = 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 AccessReviewDecisionIdentity(Model): + """Target of the decision. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AccessReviewDecisionUserIdentity, + AccessReviewDecisionServicePrincipalIdentity + + 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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'user': 'AccessReviewDecisionUserIdentity', 'servicePrincipal': 'AccessReviewDecisionServicePrincipalIdentity'} + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionIdentity, self).__init__(**kwargs) + self.id = None + self.display_name = None + self.type = None + + +class AccessReviewDecisionProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id1: The id of resource associated with a decision record. + :vartype id1: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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}, + 'display_name': {'readonly': True}, + 'id1': {'readonly': True}, + 'display_name1': {'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': 'principal.id', 'type': 'str'}, + 'display_name': {'key': 'principal.displayName', 'type': 'str'}, + 'id1': {'key': 'resource.id', 'type': 'str'}, + 'display_name1': {'key': 'resource.displayName', 'type': 'str'}, + '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.id = None + self.display_name = None + self.id1 = None + self.display_name1 = 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 AccessReviewDecisionServicePrincipalIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar app_id: The appId for the service principal entity being reviewed + :vartype app_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'app_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionServicePrincipalIdentity, self).__init__(**kwargs) + self.app_id = None + self.type = 'servicePrincipal' + + +class AccessReviewDecisionUserIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar user_principal_name: The user principal name of the user whose + access was reviewed. + :vartype user_principal_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'user_principal_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionUserIdentity, self).__init__(**kwargs) + self.user_principal_name = None + self.type = 'user' + + +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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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', 'guestUser', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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}, + 'assignment_state': {'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'}, + 'assignment_state': {'key': 'properties.scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'properties.scope.inactiveDuration', 'type': 'duration'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'properties.backupReviewers', '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.assignment_state = None + self.inactive_duration = kwargs.get('inactive_duration', None) + self.reviewers = kwargs.get('reviewers', None) + self.backup_reviewers = kwargs.get('backup_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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', 'guestUser', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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}, + 'assignment_state': {'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'}, + 'assignment_state': {'key': 'scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'scope.inactiveDuration', 'type': 'duration'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'backupReviewers', '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.assignment_state = None + self.inactive_duration = kwargs.get('inactive_duration', None) + self.reviewers = kwargs.get('reviewers', None) + self.backup_reviewers = kwargs.get('backup_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..7b38ad1e0ab4 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_models_py3.py @@ -0,0 +1,1190 @@ +# 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 id1: The id of principal whose access was reviewed. + :vartype id1: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id2: The id of resource associated with a decision record. + :vartype id2: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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}, + 'id1': {'readonly': True}, + 'display_name': {'readonly': True}, + 'id2': {'readonly': True}, + 'display_name1': {'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'}, + 'id1': {'key': 'properties.principal.id', 'type': 'str'}, + 'display_name': {'key': 'properties.principal.displayName', 'type': 'str'}, + 'id2': {'key': 'properties.resource.id', 'type': 'str'}, + 'display_name1': {'key': 'properties.resource.displayName', '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.id1 = None + self.display_name = None + self.id2 = None + self.display_name1 = 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 AccessReviewDecisionIdentity(Model): + """Target of the decision. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AccessReviewDecisionUserIdentity, + AccessReviewDecisionServicePrincipalIdentity + + 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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'user': 'AccessReviewDecisionUserIdentity', 'servicePrincipal': 'AccessReviewDecisionServicePrincipalIdentity'} + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionIdentity, self).__init__(**kwargs) + self.id = None + self.display_name = None + self.type = None + + +class AccessReviewDecisionProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id1: The id of resource associated with a decision record. + :vartype id1: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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}, + 'display_name': {'readonly': True}, + 'id1': {'readonly': True}, + 'display_name1': {'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': 'principal.id', 'type': 'str'}, + 'display_name': {'key': 'principal.displayName', 'type': 'str'}, + 'id1': {'key': 'resource.id', 'type': 'str'}, + 'display_name1': {'key': 'resource.displayName', 'type': 'str'}, + '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.id = None + self.display_name = None + self.id1 = None + self.display_name1 = 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 AccessReviewDecisionServicePrincipalIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar app_id: The appId for the service principal entity being reviewed + :vartype app_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'app_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionServicePrincipalIdentity, self).__init__(**kwargs) + self.app_id = None + self.type = 'servicePrincipal' + + +class AccessReviewDecisionUserIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar user_principal_name: The user principal name of the user whose + access was reviewed. + :vartype user_principal_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'user_principal_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionUserIdentity, self).__init__(**kwargs) + self.user_principal_name = None + self.type = 'user' + + +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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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', 'guestUser', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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}, + 'assignment_state': {'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'}, + 'assignment_state': {'key': 'properties.scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'properties.scope.inactiveDuration', 'type': 'duration'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'properties.backupReviewers', '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, inactive_duration=None, reviewers=None, backup_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.assignment_state = None + self.inactive_duration = inactive_duration + self.reviewers = reviewers + self.backup_reviewers = backup_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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', 'guestUser', 'servicePrincipal' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_03_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.v2021_03_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.v2021_03_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}, + 'assignment_state': {'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'}, + 'assignment_state': {'key': 'scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'scope.inactiveDuration', 'type': 'duration'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'backupReviewers', '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, inactive_duration=None, reviewers=None, backup_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.assignment_state = None + self.inactive_duration = inactive_duration + self.reviewers = reviewers + self.backup_reviewers = backup_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.v2021_03_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.v2021_03_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.v2021_03_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.v2021_03_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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_paged_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..3b6ab8b57061 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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/v2021_03_01_preview/operations/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/__init__.py new file mode 100644 index 000000000000..cba7f42add55 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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/v2021_03_01_preview/operations/_access_review_default_settings_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_default_settings_operations.py new file mode 100644 index 000000000000..cf8200384587 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-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.v2021_03_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.v2021_03_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.v2021_03_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/v2021_03_01_preview/operations/_access_review_instance_decisions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_decisions_operations.py new file mode 100644 index 000000000000..f8fefe74b4b7 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_decisions_operations.py @@ -0,0 +1,119 @@ +# 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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_03_01_preview.models.AccessReviewDecisionPaged[~azure.mgmt.authorization.v2021_03_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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/v2021_03_01_preview/operations/_access_review_instance_my_decisions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_my_decisions_operations.py new file mode 100644 index 000000000000..07629574ed51 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_my_decisions_operations.py @@ -0,0 +1,261 @@ +# 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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_03_01_preview.models.AccessReviewDecisionPaged[~azure.mgmt.authorization.v2021_03_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_03_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.v2021_03_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.v2021_03_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/v2021_03_01_preview/operations/_access_review_instance_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instance_operations.py new file mode 100644 index 000000000000..252c12b3082a --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-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/v2021_03_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py new file mode 100644 index 000000000000..701d705fc539 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py @@ -0,0 +1,176 @@ +# 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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_03_01_preview.models.AccessReviewInstancePaged[~azure.mgmt.authorization.v2021_03_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_03_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/v2021_03_01_preview/operations/_access_review_instances_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instances_operations.py new file mode 100644 index 000000000000..b6ef187af416 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_instances_operations.py @@ -0,0 +1,178 @@ +# 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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_03_01_preview.models.AccessReviewInstancePaged[~azure.mgmt.authorization.v2021_03_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_03_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/v2021_03_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py new file mode 100644 index 000000000000..9b53f1b36383 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py @@ -0,0 +1,108 @@ +# 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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Get access review instances assigned for my approval. + + :param filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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 AccessReviewScheduleDefinition + :rtype: + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScheduleDefinitionPaged[~azure.mgmt.authorization.v2021_03_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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/v2021_03_01_preview/operations/_access_review_schedule_definitions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_schedule_definitions_operations.py new file mode 100644 index 000000000000..e799e0c6cda3 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_access_review_schedule_definitions_operations.py @@ -0,0 +1,339 @@ +# 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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Get access review schedule definitions. + + :param filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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 AccessReviewScheduleDefinition + :rtype: + ~azure.mgmt.authorization.v2021_03_01_preview.models.AccessReviewScheduleDefinitionPaged[~azure.mgmt.authorization.v2021_03_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_03_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.v2021_03_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.v2021_03_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/v2021_03_01_preview/operations/_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/operations/_operations.py new file mode 100644 index 000000000000..7fce20e4321e --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-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.v2021_03_01_preview.models.OperationPaged[~azure.mgmt.authorization.v2021_03_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/v2021_03_01_preview/version.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_01_preview/version.py new file mode 100644 index 000000000000..5eb1b1093d5c --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_03_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 = "2021-03-01-preview" + diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/__init__.py new file mode 100644 index 000000000000..e8714b719dfc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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/v2021_07_01_preview/_authorization_management_client.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/_authorization_management_client.py new file mode 100644 index 000000000000..7b9fa3baf0ab --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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.v2021_07_01_preview.operations.Operations + :ivar access_review_schedule_definitions: AccessReviewScheduleDefinitions operations + :vartype access_review_schedule_definitions: azure.mgmt.authorization.v2021_07_01_preview.operations.AccessReviewScheduleDefinitionsOperations + :ivar access_review_instances: AccessReviewInstances operations + :vartype access_review_instances: azure.mgmt.authorization.v2021_07_01_preview.operations.AccessReviewInstancesOperations + :ivar access_review_instance: AccessReviewInstance operations + :vartype access_review_instance: azure.mgmt.authorization.v2021_07_01_preview.operations.AccessReviewInstanceOperations + :ivar access_review_instance_decisions: AccessReviewInstanceDecisions operations + :vartype access_review_instance_decisions: azure.mgmt.authorization.v2021_07_01_preview.operations.AccessReviewInstanceDecisionsOperations + :ivar access_review_default_settings: AccessReviewDefaultSettings operations + :vartype access_review_default_settings: azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_01_preview.operations.AccessReviewInstancesAssignedForMyApprovalOperations + :ivar access_review_instance_my_decisions: AccessReviewInstanceMyDecisions operations + :vartype access_review_instance_my_decisions: azure.mgmt.authorization.v2021_07_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 = '2021-07-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/v2021_07_01_preview/_configuration.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/_configuration.py new file mode 100644 index 000000000000..c192b8088f15 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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/v2021_07_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/__init__.py new file mode 100644 index 000000000000..a60c00f1bd65 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/__init__.py @@ -0,0 +1,102 @@ +# 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 AccessReviewDecisionIdentity + from ._models_py3 import AccessReviewDecisionProperties + from ._models_py3 import AccessReviewDecisionServicePrincipalIdentity + from ._models_py3 import AccessReviewDecisionUserIdentity + from ._models_py3 import AccessReviewDefaultSettings + from ._models_py3 import AccessReviewInstance + from ._models_py3 import AccessReviewInstanceProperties + 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 +except (SyntaxError, ImportError): + from ._models import AccessReviewDecision + from ._models import AccessReviewDecisionIdentity + from ._models import AccessReviewDecisionProperties + from ._models import AccessReviewDecisionServicePrincipalIdentity + from ._models import AccessReviewDecisionUserIdentity + from ._models import AccessReviewDefaultSettings + from ._models import AccessReviewInstance + from ._models import AccessReviewInstanceProperties + 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 ._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, + AccessReviewScopeAssignmentState, + AccessReviewReviewerType, + AccessReviewScheduleDefinitionReviewersType, + AccessReviewInstanceStatus, + AccessReviewInstanceReviewersType, + AccessRecommendationType, + AccessReviewResult, + AccessReviewApplyResult, +) + +__all__ = [ + 'AccessReviewDecision', + 'AccessReviewDecisionIdentity', + 'AccessReviewDecisionProperties', + 'AccessReviewDecisionServicePrincipalIdentity', + 'AccessReviewDecisionUserIdentity', + 'AccessReviewDefaultSettings', + 'AccessReviewInstance', + 'AccessReviewInstanceProperties', + 'AccessReviewReviewer', + 'AccessReviewScheduleDefinition', + 'AccessReviewScheduleDefinitionProperties', + 'AccessReviewScheduleSettings', + 'ErrorDefinition', 'ErrorDefinitionException', + 'ErrorDefinitionProperties', + 'Operation', + 'OperationDisplay', + 'OperationPaged', + 'AccessReviewScheduleDefinitionPaged', + 'AccessReviewInstancePaged', + 'AccessReviewDecisionPaged', + 'AccessReviewScheduleDefinitionStatus', + 'AccessReviewActorIdentityType', + 'DefaultDecisionType', + 'AccessReviewRecurrencePatternType', + 'AccessReviewRecurrenceRangeType', + 'AccessReviewScopePrincipalType', + 'AccessReviewScopeAssignmentState', + 'AccessReviewReviewerType', + 'AccessReviewScheduleDefinitionReviewersType', + 'AccessReviewInstanceStatus', + 'AccessReviewInstanceReviewersType', + 'AccessRecommendationType', + 'AccessReviewResult', + 'AccessReviewApplyResult', +] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_authorization_management_client_enums.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_authorization_management_client_enums.py new file mode 100644 index 000000000000..0f7d2ba3277a --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_authorization_management_client_enums.py @@ -0,0 +1,128 @@ +# 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" + guest_user = "guestUser" + service_principal = "servicePrincipal" + usergroup = "user,group" + + +class AccessReviewScopeAssignmentState(str, Enum): + + eligible = "eligible" + active = "active" + + +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 AccessReviewInstanceReviewersType(str, Enum): + + assigned = "Assigned" + self_enum = "Self" + managers = "Managers" + + +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/v2021_07_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models.py new file mode 100644 index 000000000000..ed87eed742d8 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models.py @@ -0,0 +1,1327 @@ +# 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 id1: The id of principal whose access was reviewed. + :vartype id1: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id2: The id of resource associated with a decision record. + :vartype id2: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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}, + 'id1': {'readonly': True}, + 'display_name': {'readonly': True}, + 'id2': {'readonly': True}, + 'display_name1': {'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'}, + 'id1': {'key': 'properties.principal.id', 'type': 'str'}, + 'display_name': {'key': 'properties.principal.displayName', 'type': 'str'}, + 'id2': {'key': 'properties.resource.id', 'type': 'str'}, + 'display_name1': {'key': 'properties.resource.displayName', '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.id1 = None + self.display_name = None + self.id2 = None + self.display_name1 = 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 AccessReviewDecisionIdentity(Model): + """Target of the decision. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AccessReviewDecisionUserIdentity, + AccessReviewDecisionServicePrincipalIdentity + + 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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'user': 'AccessReviewDecisionUserIdentity', 'servicePrincipal': 'AccessReviewDecisionServicePrincipalIdentity'} + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionIdentity, self).__init__(**kwargs) + self.id = None + self.display_name = None + self.type = None + + +class AccessReviewDecisionProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id1: The id of resource associated with a decision record. + :vartype id1: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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}, + 'display_name': {'readonly': True}, + 'id1': {'readonly': True}, + 'display_name1': {'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': 'principal.id', 'type': 'str'}, + 'display_name': {'key': 'principal.displayName', 'type': 'str'}, + 'id1': {'key': 'resource.id', 'type': 'str'}, + 'display_name1': {'key': 'resource.displayName', 'type': 'str'}, + '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.id = None + self.display_name = None + self.id1 = None + self.display_name1 = 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 AccessReviewDecisionServicePrincipalIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar app_id: The appId for the service principal entity being reviewed + :vartype app_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'app_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionServicePrincipalIdentity, self).__init__(**kwargs) + self.app_id = None + self.type = 'servicePrincipal' + + +class AccessReviewDecisionUserIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar user_principal_name: The user principal name of the user whose + access was reviewed. + :vartype user_principal_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'user_principal_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewDecisionUserIdentity, self).__init__(**kwargs) + self.user_principal_name = None + self.type = 'user' + + +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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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.v2021_07_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'}, + 'recommendation_look_back_duration': {'key': 'properties.recommendationLookBackDuration', 'type': 'duration'}, + '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.recommendation_look_back_duration = kwargs.get('recommendation_look_back_duration', 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.v2021_07_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 + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_01_preview.models.AccessReviewInstanceReviewersType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'reviewers_type': {'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'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'properties.backupReviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'properties.reviewersType', 'type': 'str'}, + } + + 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) + self.reviewers = kwargs.get('reviewers', None) + self.backup_reviewers = kwargs.get('backup_reviewers', None) + self.reviewers_type = None + + +class AccessReviewInstanceProperties(Model): + """Access Review Instance properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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.v2021_07_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 + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_01_preview.models.AccessReviewInstanceReviewersType + """ + + _validation = { + 'status': {'readonly': True}, + 'reviewers_type': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'backupReviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'reviewersType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessReviewInstanceProperties, self).__init__(**kwargs) + self.status = None + self.start_date_time = kwargs.get('start_date_time', None) + self.end_date_time = kwargs.get('end_date_time', None) + self.reviewers = kwargs.get('reviewers', None) + self.backup_reviewers = kwargs.get('backup_reviewers', None) + self.reviewers_type = 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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.v2021_07_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', 'guestUser', 'servicePrincipal', + 'user,group' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param expand_nested_memberships: Flag to indicate whether to expand + nested memberships or not. + :type expand_nested_memberships: bool + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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}, + 'assignment_state': {'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'}, + 'recommendation_look_back_duration': {'key': 'properties.settings.recommendationLookBackDuration', 'type': 'duration'}, + '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'}, + 'assignment_state': {'key': 'properties.scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'properties.scope.inactiveDuration', 'type': 'duration'}, + 'expand_nested_memberships': {'key': 'properties.scope.expandNestedMemberships', 'type': 'bool'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'properties.backupReviewers', '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.recommendation_look_back_duration = kwargs.get('recommendation_look_back_duration', 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.assignment_state = None + self.inactive_duration = kwargs.get('inactive_duration', None) + self.expand_nested_memberships = kwargs.get('expand_nested_memberships', None) + self.reviewers = kwargs.get('reviewers', None) + self.backup_reviewers = kwargs.get('backup_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.v2021_07_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.v2021_07_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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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.v2021_07_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', 'guestUser', 'servicePrincipal', + 'user,group' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param expand_nested_memberships: Flag to indicate whether to expand + nested memberships or not. + :type expand_nested_memberships: bool + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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}, + 'assignment_state': {'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'}, + 'recommendation_look_back_duration': {'key': 'settings.recommendationLookBackDuration', 'type': 'duration'}, + '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'}, + 'assignment_state': {'key': 'scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'scope.inactiveDuration', 'type': 'duration'}, + 'expand_nested_memberships': {'key': 'scope.expandNestedMemberships', 'type': 'bool'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'backupReviewers', '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.recommendation_look_back_duration = kwargs.get('recommendation_look_back_duration', 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.assignment_state = None + self.inactive_duration = kwargs.get('inactive_duration', None) + self.expand_nested_memberships = kwargs.get('expand_nested_memberships', None) + self.reviewers = kwargs.get('reviewers', None) + self.backup_reviewers = kwargs.get('backup_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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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'}, + 'recommendation_look_back_duration': {'key': 'recommendationLookBackDuration', 'type': 'duration'}, + '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.recommendation_look_back_duration = kwargs.get('recommendation_look_back_duration', 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.v2021_07_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.v2021_07_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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..10ae03e985bc --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_models_py3.py @@ -0,0 +1,1327 @@ +# 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 id1: The id of principal whose access was reviewed. + :vartype id1: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id2: The id of resource associated with a decision record. + :vartype id2: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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}, + 'id1': {'readonly': True}, + 'display_name': {'readonly': True}, + 'id2': {'readonly': True}, + 'display_name1': {'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'}, + 'id1': {'key': 'properties.principal.id', 'type': 'str'}, + 'display_name': {'key': 'properties.principal.displayName', 'type': 'str'}, + 'id2': {'key': 'properties.resource.id', 'type': 'str'}, + 'display_name1': {'key': 'properties.resource.displayName', '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.id1 = None + self.display_name = None + self.id2 = None + self.display_name1 = 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 AccessReviewDecisionIdentity(Model): + """Target of the decision. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AccessReviewDecisionUserIdentity, + AccessReviewDecisionServicePrincipalIdentity + + 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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'user': 'AccessReviewDecisionUserIdentity', 'servicePrincipal': 'AccessReviewDecisionServicePrincipalIdentity'} + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionIdentity, self).__init__(**kwargs) + self.id = None + self.display_name = None + self.type = None + + +class AccessReviewDecisionProperties(Model): + """Approval Step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :ivar id1: The id of resource associated with a decision record. + :vartype id1: str + :ivar display_name1: The display name of resource associated with a + decision record. + :vartype display_name1: str + :ivar recommendation: The feature- generated recommendation shown to the + reviewer. Possible values include: 'Approve', 'Deny', 'NoInfoAvailable' + :vartype recommendation: str or + ~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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}, + 'display_name': {'readonly': True}, + 'id1': {'readonly': True}, + 'display_name1': {'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': 'principal.id', 'type': 'str'}, + 'display_name': {'key': 'principal.displayName', 'type': 'str'}, + 'id1': {'key': 'resource.id', 'type': 'str'}, + 'display_name1': {'key': 'resource.displayName', 'type': 'str'}, + '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.id = None + self.display_name = None + self.id1 = None + self.display_name1 = 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 AccessReviewDecisionServicePrincipalIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar app_id: The appId for the service principal entity being reviewed + :vartype app_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'app_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionServicePrincipalIdentity, self).__init__(**kwargs) + self.app_id = None + self.type = 'servicePrincipal' + + +class AccessReviewDecisionUserIdentity(AccessReviewDecisionIdentity): + """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. + + :ivar id: The id of principal whose access was reviewed. + :vartype id: str + :ivar display_name: The display name of the user whose access was + reviewed. + :vartype display_name: str + :param type: Required. Constant filled by server. + :type type: str + :ivar user_principal_name: The user principal name of the user whose + access was reviewed. + :vartype user_principal_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'type': {'required': True}, + 'user_principal_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_principal_name': {'key': 'userPrincipalName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessReviewDecisionUserIdentity, self).__init__(**kwargs) + self.user_principal_name = None + self.type = 'user' + + +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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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.v2021_07_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'}, + 'recommendation_look_back_duration': {'key': 'properties.recommendationLookBackDuration', 'type': 'duration'}, + '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, recommendation_look_back_duration=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.recommendation_look_back_duration = recommendation_look_back_duration + 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.v2021_07_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 + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_01_preview.models.AccessReviewInstanceReviewersType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'reviewers_type': {'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'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'properties.backupReviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'properties.reviewersType', 'type': 'str'}, + } + + def __init__(self, *, start_date_time=None, end_date_time=None, reviewers=None, backup_reviewers=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 + self.reviewers = reviewers + self.backup_reviewers = backup_reviewers + self.reviewers_type = None + + +class AccessReviewInstanceProperties(Model): + """Access Review Instance properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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.v2021_07_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 + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_01_preview.models.AccessReviewInstanceReviewersType + """ + + _validation = { + 'status': {'readonly': True}, + 'reviewers_type': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'backupReviewers', 'type': '[AccessReviewReviewer]'}, + 'reviewers_type': {'key': 'reviewersType', 'type': 'str'}, + } + + def __init__(self, *, start_date_time=None, end_date_time=None, reviewers=None, backup_reviewers=None, **kwargs) -> None: + super(AccessReviewInstanceProperties, self).__init__(**kwargs) + self.status = None + self.start_date_time = start_date_time + self.end_date_time = end_date_time + self.reviewers = reviewers + self.backup_reviewers = backup_reviewers + self.reviewers_type = 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.v2021_07_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.v2021_07_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.v2021_07_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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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.v2021_07_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', 'guestUser', 'servicePrincipal', + 'user,group' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param expand_nested_memberships: Flag to indicate whether to expand + nested memberships or not. + :type expand_nested_memberships: bool + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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}, + 'assignment_state': {'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'}, + 'recommendation_look_back_duration': {'key': 'properties.settings.recommendationLookBackDuration', 'type': 'duration'}, + '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'}, + 'assignment_state': {'key': 'properties.scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'properties.scope.inactiveDuration', 'type': 'duration'}, + 'expand_nested_memberships': {'key': 'properties.scope.expandNestedMemberships', 'type': 'bool'}, + 'reviewers': {'key': 'properties.reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'properties.backupReviewers', '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, recommendation_look_back_duration=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, inactive_duration=None, expand_nested_memberships: bool=None, reviewers=None, backup_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.recommendation_look_back_duration = recommendation_look_back_duration + 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.assignment_state = None + self.inactive_duration = inactive_duration + self.expand_nested_memberships = expand_nested_memberships + self.reviewers = reviewers + self.backup_reviewers = backup_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.v2021_07_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.v2021_07_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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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.v2021_07_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', 'guestUser', 'servicePrincipal', + 'user,group' + :vartype principal_type1: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopePrincipalType + :ivar assignment_state: The role assignment state eligible/active to + review. Possible values include: 'eligible', 'active' + :vartype assignment_state: str or + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScopeAssignmentState + :param inactive_duration: Duration users are inactive for. The value + should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type inactive_duration: timedelta + :param expand_nested_memberships: Flag to indicate whether to expand + nested memberships or not. + :type expand_nested_memberships: bool + :param reviewers: This is the collection of reviewers. + :type reviewers: + list[~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewReviewer] + :param backup_reviewers: This is the collection of backup reviewers. + :type backup_reviewers: + list[~azure.mgmt.authorization.v2021_07_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.v2021_07_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.v2021_07_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}, + 'assignment_state': {'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'}, + 'recommendation_look_back_duration': {'key': 'settings.recommendationLookBackDuration', 'type': 'duration'}, + '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'}, + 'assignment_state': {'key': 'scope.assignmentState', 'type': 'str'}, + 'inactive_duration': {'key': 'scope.inactiveDuration', 'type': 'duration'}, + 'expand_nested_memberships': {'key': 'scope.expandNestedMemberships', 'type': 'bool'}, + 'reviewers': {'key': 'reviewers', 'type': '[AccessReviewReviewer]'}, + 'backup_reviewers': {'key': 'backupReviewers', '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, recommendation_look_back_duration=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, inactive_duration=None, expand_nested_memberships: bool=None, reviewers=None, backup_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.recommendation_look_back_duration = recommendation_look_back_duration + 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.assignment_state = None + self.inactive_duration = inactive_duration + self.expand_nested_memberships = expand_nested_memberships + self.reviewers = reviewers + self.backup_reviewers = backup_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.v2021_07_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 recommendation_look_back_duration: Recommendations for access + reviews are calculated by looking back at 30 days of data(w.r.t the start + date of the review) by default. However, in some scenarios, customers want + to change how far back to look at and want to configure 60 days, 90 days, + etc. instead. This setting allows customers to configure this duration. + The value should be in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to + convert TimeSpan to a valid interval string: XmlConvert.ToString(new + TimeSpan(hours, minutes, seconds)) + :type recommendation_look_back_duration: timedelta + :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.v2021_07_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'}, + 'recommendation_look_back_duration': {'key': 'recommendationLookBackDuration', 'type': 'duration'}, + '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, recommendation_look_back_duration=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.recommendation_look_back_duration = recommendation_look_back_duration + 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.v2021_07_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.v2021_07_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 diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_paged_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..5655b5cb2201 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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/v2021_07_01_preview/operations/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/__init__.py new file mode 100644 index 000000000000..cba7f42add55 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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/v2021_07_01_preview/operations/_access_review_default_settings_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_default_settings_operations.py new file mode 100644 index 000000000000..5c39f8679b35 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-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.v2021_07_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.v2021_07_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.v2021_07_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/v2021_07_01_preview/operations/_access_review_instance_decisions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_decisions_operations.py new file mode 100644 index 000000000000..623a513dd066 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_decisions_operations.py @@ -0,0 +1,119 @@ +# 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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_07_01_preview.models.AccessReviewDecisionPaged[~azure.mgmt.authorization.v2021_07_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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/v2021_07_01_preview/operations/_access_review_instance_my_decisions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_my_decisions_operations.py new file mode 100644 index 000000000000..0f8144375c65 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_my_decisions_operations.py @@ -0,0 +1,261 @@ +# 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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_07_01_preview.models.AccessReviewDecisionPaged[~azure.mgmt.authorization.v2021_07_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_07_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.v2021_07_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.v2021_07_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/v2021_07_01_preview/operations/_access_review_instance_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instance_operations.py new file mode 100644 index 000000000000..e2e0be27a563 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-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/v2021_07_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py new file mode 100644 index 000000000000..c736972e33c6 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instances_assigned_for_my_approval_operations.py @@ -0,0 +1,176 @@ +# 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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_07_01_preview.models.AccessReviewInstancePaged[~azure.mgmt.authorization.v2021_07_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_07_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/v2021_07_01_preview/operations/_access_review_instances_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instances_operations.py new file mode 100644 index 000000000000..99e569e277a1 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_instances_operations.py @@ -0,0 +1,247 @@ +# 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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, schedule_definition_id, filter=None, 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 filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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.v2021_07_01_preview.models.AccessReviewInstancePaged[~azure.mgmt.authorization.v2021_07_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_07_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}'} + + def create( + self, schedule_definition_id, id, properties, custom_headers=None, raw=False, **operation_config): + """Update 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 properties: Access review instance properties. + :type properties: + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewInstanceProperties + :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.v2021_07_01_preview.models.AccessReviewInstance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDefinitionException` + """ + # Construct URL + url = self.create.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' + 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, 'AccessReviewInstanceProperties') + + # 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('AccessReviewInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}'} diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py new file mode 100644 index 000000000000..fd3c5df280e4 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_assigned_for_my_approval_operations.py @@ -0,0 +1,108 @@ +# 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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Get access review instances assigned for my approval. + + :param filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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 AccessReviewScheduleDefinition + :rtype: + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScheduleDefinitionPaged[~azure.mgmt.authorization.v2021_07_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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/v2021_07_01_preview/operations/_access_review_schedule_definitions_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_operations.py new file mode 100644 index 000000000000..52036edda546 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_access_review_schedule_definitions_operations.py @@ -0,0 +1,339 @@ +# 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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-01-preview" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Get access review schedule definitions. + + :param filter: The filter to apply on the operation. Other than + standard filters, one custom filter option is supported : + 'assignedToMeToReview()'. When one specified + $filter=assignedToMeToReview(), only items that are assigned to the + calling user to review are returned + :type filter: 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 AccessReviewScheduleDefinition + :rtype: + ~azure.mgmt.authorization.v2021_07_01_preview.models.AccessReviewScheduleDefinitionPaged[~azure.mgmt.authorization.v2021_07_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + 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.v2021_07_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.v2021_07_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.v2021_07_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/v2021_07_01_preview/operations/_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/operations/_operations.py new file mode 100644 index 000000000000..982caaa02e27 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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: "2021-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-07-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.v2021_07_01_preview.models.OperationPaged[~azure.mgmt.authorization.v2021_07_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/v2021_07_01_preview/version.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_01_preview/version.py new file mode 100644 index 000000000000..9a85884de7d3 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2021_07_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 = "2021-07-01-preview" +