From 84777404757aecb8a691c4761eb56208749c8510 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Jan 2021 17:47:08 +0000 Subject: [PATCH] CodeGen from PR 12289 in Azure/azure-rest-api-specs Get latest master (#12289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2019-06-01 (#11833) * Changing Swagger file * Changing examples * Fixing tags example * Fixing tags example * Fixing tags example * prettier fix for white spaces * Enable azure-sdk-for-net-track2 (#12169) * Updating existing CRR APIs with zone restore feature (#12157) * - Added change for support of cross zone restores. * - updating example json * - Fixing prettier * lastUpdatedDate for templates (#11900) * lastUpdatedDate for templates * fix * [Hub Generated] Review request for Microsoft.AppPlatform to add version preview/2020-11-01-preview (#11823) * Adds base for updating Microsoft.AppPlatform from version stable/2020-07-01 to version 2020-11-01-preview * Updates readme * Updates API version in new specs and examples * Introduce additional change to 2020-11-01-preview. * Additional properties to monitoringSettings. * Readonly properties to requiredTraffics. Signed-off-by: Pan Li * Make credscan happy. Signed-off-by: Pan Li * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-10-01 (#12113) * Fix linter and swagger warnings * Fix errors * Removed unneeded change * [ASC.Automations] Add new data type "RegulatoryComplianceAssessment" (#12185) * Add SubAssessment event source type and add more automations examples * Change Location isReadOnlu to false * Test * Add new read/write location and add new type TrackedResourceLocation * Minor * minor * prettier fixes * Change variable name to TrackedResourceLocation * Change type name TrackedResourceLocation to AzureTrackedResourceLocation * Update automations example * Add SecureScores & SecureScoreControls as new supported datatypes in Automations resource * [ASC.Automations] add new data type RegulatoryComplianceAssessment * add datalake store track2 config (#12186) * cleanup old pipeline dependencies (#11889) * cleanup pipeline deps * add rest-api-specs-scripts * Extending recovery network input in replication intent API to support new network creation (#12191) * [Hub Generated] Review request for Microsoft.Maps to add version preview/2020-02-01-preview (#12172) * Adding operations for Maps Creator resource. * Fixing typo. * Adds suppression to readme * Adds suppression to readme * Adds suppression to readme * Adds suppression to readme * Resolving linter errors. * Minor update. * Updating all reference to v2 schema. * Marked private atlas as deprecated in description. * add operationsmanagement track2 config (#12141) * Update comment.yml (#12202) Add ARM traffic query link. When add breakingChangeReviewRequired * Adding new properties to response body (#12201) * adding new properties * updating examples * prettier fix * [Hub Generated] Review request for Microsoft.ContainerService to add version stable/2020-12-01 (#12064) * Add autorest.az configurations for azure monitor control service (#12090) * add AMCS config for codegen * reorganize command group * rename command group * Codegen modify try to rename DataCollectionRules create parameters * hide DataCollectionRules Create & Update commands and DataCollectionRuleAssociations Create command * use alias instand of rename in code-gen * use monitor-control-service as the extension name * Update readme.python.md * add logic track2 config (#12166) * add alertsmanagement track2 config (#11759) * Update comment.yml (#12213) * add mixedreality track2 confi (#12070) * add signalr track2 config (#11892) * add cognitiveservice track2 config (#11498) * add machinglearningservices track2 config (#12183) * add apimanagement track2 config (#12187) * add serialconsole track2 config (#12046) * Update TransparentDataEncryption Group Name (#12160) * update TransparentDataEncryption Group name * update reference of TransparentDataEncryption * Update readme.python.md (#12216) * Required changes for Azure HealthBot swagger (#12124) * Fixes for SDK generation files. * Fixes for SDK generation files. * Added GO. * Change Healthcare bot to Healthbot. * 1. Remove unused properties of SKU. 2. Removed unused CheckNameAvailability.json 3. Remove subgroup. * Sku is required. * [Hub Generated] Review request for Microsoft.IoTCentral to add version stable/2018-09-01 (#12224) * update to name * update * add api-version of guest configuration to go SDK (#12217) * add api-version for templatespecs (#12197) * Update specificationRepositoryConfiguration.json (#12218) * Adding new api version to devops RP (#11585) * Initial commit as per PR review * Actual changes to api spec for new version * Switching to multi-api build for python * Fix python spec to correct namespaces in multiapi mode * Revert changes to python generation * Add systemdata * Fix the path for sys data reference * Fix path once more * remove additional properties after including systemdata * Remove more addtional properties * Move system data to root * Fix wrong output-folder (#12229) * Remove swagger and examples because the controller will be used for private preview. (#12177) * Update pull_request_assignment.yml (#12230) * [Hub Generated] Review request for Microsoft.StorageCache to add version stable/2020-10-01 (#11407) * Init the next version so diffs can work better. * Updates readme * Updates API version in new specs and examples * Updates to StorageTargetProperties and added examples of cmk, mtu Add 202 to the storage cache and storage target create/update and update examples Fix ST no junction example's 202 response. add properties for nfs extended groups fix issues with extended groups properties found with autorest add properties and objects for Active Directory username download undo unintended change changes from comments in pull request AccessPolicy support. Example fixes for Access Policies. Fix attribute names to match latest RP. update to credential properties for LDAP and Active Directory marking password properties with x-ms-secret tag minor changes on extended groups and add examples Added blob NFS and some other validation fixes. Update required property for domainName from dnsName Updated blobNfs examples and some kpi fixes. Correct validation errors in examples. Added systemdata to resources. Remove x-ms-secret in keyvault reference due to linter error and common types not using it. Remove blobNfs from this version. Remove blobNfs from spec file. Remove x-ms-secret due to linter errors. Fix certificate spelling. Updating prettier and spell check errors. Used prettier on main spec file. Readded x-ms-secret that open api hub failed on but the PR pipeline allows. * Add prettier fix after rebase * Remove 202 bodies and add systemData to examples. * Update spec with prettier. * Address comments on spec for descriptions, readmes, and extendedGroupsEnabled. * Updating to address addition ldap and pattern comments. * Update version tag to include 01 * Restore changes that would be considered breaking changes matching 2020-03-01 * Address a few other comments. * Update netbios field names and some descriptions. * Fix s360 for missing debugInfo operation. * Fix credscan error in example file. * Update required fields, new validator failure on debugInfo return codes, and bindPassword example value. * Update debug info example with new return codes. * Update other credscan password errors. * Update Semantic-and-Model-Violations-Reference.md (#12199) Adding secret_property code, update some other codes. * ADP - add system metadata to dataPool (#12179) * Swagger Linting Fix (#12162) * Fix Linting Issuing * no message * fix description * add description and object back * test to resolve model validation test (cherry picked from commit ab273dfc0d5897683c128ee15da4babafa7a85ba) * [SQL][V20180601] Updating LocationCapabilities spec (#12032) * [SQL][V20180601] Updating LocationCapabilities spec * Fill 2020 versions * Rollback V2018 changes and bump LocationCapabilities in V4 to 2020-08-01-preview * update order for CI-FixRequiredOnFailure (#12227) * update rdbms track2 config (#12245) * ADT: refix path (#12161) * python track2 configure (#12150) * Add and remove owner for service principals (#12081) * [Hub Generated] Review request for Microsoft.MixedReality to add version stable/2020-05-01 (#11810) * fix spec * fix prettier * [Hub Generated] Review request for Microsoft.MixedReality to add version preview/2019-12-02-preview (#11769) * fix for swagger completeness * forgot curly brace * fix example * Api Management - make /tenant endpoints ARM compliant in 2020-06-01-preview version (#11549) * Adds base for updating Microsoft.ApiManagement from version stable/2019-12-01 to version 2020-06-01-preview * Updates readme * Updates API version in new specs and examples * Add support in API Management for Availability Zones (#10284) * apim in azs * fix prettier check * PATCH should return 200 OK (#10328) * add support for PATCH returning 200 OK * CI fixes prettier fix CI fixes part 2 * Password no longer a mandatory property when uploading Certificates * add missing x-ms-odata extension for filter support * +gatewayhostnameconfiguration protocol changes (#10292) * [2020-06-01-preview] Update Oauth Server secrets Contract (#10602) * Oauth server secrets contract * fix azureMonitor enum * API Management Service Deleted Services Resource (#10607) * API Management Service Deleted Services Resource * Path fix * Lint + custom-words fixes * Location URI parameter for deletedservices Resource * GET for deletedservices by service name * Remove resourceGroupName from resource path * fixes * schema for purge operation * perttier applied * 204 response code added Co-authored-by: REDMOND\glfeokti * OperationNameFormat property added to Diagnostic contract (#10641) * OperationNameFormat property added to Diagnostic contract * add azuremonitor to update contract Co-authored-by: REDMOND\glfeokti * [Microsoft.ApiManagement][2020-06-01-preview] Change Network Status response contract (#10331) * Change Network Status response contract * Update examples for network status contract * ApiManagement - tenant/settings endpoints * ApiManagement - tenant/settings endpoints fix * ApiManagement - tenant/settings endpoints fix prettier * ApiManagement - tenant/settings endpoints fix 3 * ApiManagement - tenant/settings endpoints fix 4 * ApiManagement - tenant/settings endpoints fix 5 Co-authored-by: Samir Solanki Co-authored-by: maksimkim Co-authored-by: promoisha Co-authored-by: REDMOND\glfeokti Co-authored-by: RupengLiu Co-authored-by: vfedonkin * Add "mail" parameter to UserUpdateParameters in graphrbac (#12127) This patch adds a single optional field "mail" to UserUpdateParameters schema. This makes it possible to update user's e-mail address using the (Go) Azure SDK. Currently this is not possible. I have curled the graphrbac API with the extra body parameter and it works as expected. Addition of the field will make it possible to support the mail property on the azuread_user resource in terraform-provider-azuread. Co-authored-by: David Čepelík * [Hub Generated] Review request for Microsoft.Advisor to add version stable/2020-01-01 (#12262) * add resourcegraph track2 config (#12122) * add reservations track2 config (#12027) * Removing a readonly tag from a property (#12254) * Fix swagger correctness errors (#12246) * Fix swagger correctness issues in Security for Iot service * changed int format from 32 to 64 * Add systemData to iotSecuritySolutions Co-authored-by: Liran Chen * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-10-01 (#12196) * AAS - Swagger Linting and Correctness Fix (#12176) * Fix R4013 IntegerTypeMustHaveFormat * Fix R4010 RequiredDefaultResponse * Fix R4007 DefaultErrorResponseSchema * removed extra bracket * fix semantic issue * add type error * Fix linting issue * test to resolve model validation test * Revert "test to resolve model validation test" This reverts commit ab273dfc0d5897683c128ee15da4babafa7a85ba. * Resolve Model Validation Issue * Resolve Model Validation Issue v2 * test - add missing properties (cherry picked from commit 48ec27c51cc61f4b3c05b531618f40b7c2f77de6) * fix format * set default value * add x-ms-enum * fix nit * Add missing property * add missing properties * add missing bracket * change GatewayListStatusLive type * add missing "origin" property * fix model validation * Revert "change GatewayListStatusLive type" This reverts commit 4f3fa743d5ce91bea6bcf83474e6e3fc15bc3483. * Revert "fix model validation" This reverts commit 945bc233b9e623b2d90f7903b8b4dee94d873aa8. * add redhatopenshift track2 config (#12045) * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-10-01 (#12194) * Adding nextLink and previousLink to Tags endpoint properties * moving properties out * prettier check fix Co-authored-by: Jorge Chavez Nieto * add relay track2 config (#11495) * update healthbot t2 config (#12269) * update healthbot t2 config * fix readme * add automation track2 config (#11628) * add automation track2 config * update config * Azure Remote Rendering REST API swagger file - for review (#12015) * Azure Remote Rendering API specifcation * fix schema issue * fix examples * fix request bodies integer values, :stop path * pointing readme.md to open api spec for ARR * fix typo, add custom words * add msvc to custom words * fix readme.md * ran prettifier * fix reference to json * reference sts from file as well * fix readme.md * changes to readme.md * remove example from error to fix error * add 200 OK status for retried PUT for conversions and sessiosn * ran prettier * make autorest linter not crash * fix casing of nextLinkName paramter * factor out conversion list response * add examples for conversions * adding examples for sessions, prettify files * [Hub Generated] Review request for Microsoft.Maps/Microsoft.Maps to add version preview/2.0 (#12175) * microsoft.imagery 512 not supported Adding micorosft.imagery to 512 tile not supported list * Updating Raster Tilesets to Have Max Zoom 22 Certain raster tilesets now support up to zoom level 22. * minor changes to swagger (#12253) * minor changes to swagger * reverting sdk definitions file * Add addons to AVS 2020-07-17-preview (#12236) * found missing AVS/privateclouds/addons commit, moving it to 2020-07-17-preview API from PR repo * fixed prettier errors * Fixed vladation warnings for x-ms-enum and missing description/title, related to addons * fixed validation error for missing systemData for addons responses * fixed prettier errors * fixed validation error for missing systemData for addons responses * systemData for any Resource * make sure systemData is readOnly * systemData needs to go in a new api version * suppress systemData error Co-authored-by: Cameron Taggart * Azs api bug fix (#12133) * Old api version for ComputeOperationResult * Api Bugfix for Azure Stack Fabric Admin * Fix for typo in readme * Add default reponse * Fix example issue for default error * Update comment.yml (#12273) * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-11-01 (#12031) * fix dataSet typo * fix dimensions and tags typo * more dimensions and tags to fix * one more miss on dimensions and tags * Add the includeMonetaryCommitment missing field * fix spell check error * make property read only * remove the not operation from query filters * New backup service api version (#12171) * Initial commit: adding new api version * - new api 2020-12-01 * updating the readme.md package reference * - adding the zone information for new api * - updating api-version in examples - added 'zone' in Get recoverypoint api example json * Fixing prettier issue * Revert "- updating api-version in examples" This reverts commit 80baa9fcec1293bd3a51875d793f2178964fce52. * - adding api-version in examples * adding new api version in package mds * [IotHub] Introducing networkRuleSets in IotHubProperties [2020-08-31 : preview and stable ] (#10853) * Adds base for updating Microsoft.Devices from version preview/2020-07-10-preview to version 2020-08-31-preview * Updates readme * Updates API version in new specs and examples * Adds base for updating Microsoft.Devices from version stable/2020-08-01 to version 2020-08-31 * Updates readme * Updates API version in new specs and examples * Adding networkRuleSets support for iothub * Adding networkRuleSets Support in preview version * Adding Examples, correcting order in iothub.json * Updating Readme to have stable and previe versions * Modifying Tag to package-2020-08-31 * Adding Arm identity properties from 2020-07-010-preview version * Removing creds * minor fix * swagger correctness fix (#12101) * swagger correctness fix * update preview version too * Revert change and add defaults (#12243) * Remove gallery preview version 2020-09-30 from stable release (#12222) * add managementpartner track2 config (#12043) * [Hub Generated] Review request for Microsoft.Insights to add version stable/2019-03-01 (#12232) * Fixed swagger validations for api version 2019 * reverted error response change and suppress * removed redundant error details * renamed suppression rule * fixed suppression Co-authored-by: napolish <67951636+napolish@users.noreply.github.com> Co-authored-by: Phoenix He Co-authored-by: arpja <46751982+arpja@users.noreply.github.com> Co-authored-by: ShaniFelig <74960756+ShaniFelig@users.noreply.github.com> Co-authored-by: Pan Li Co-authored-by: Zach Rathbun Co-authored-by: surashed <55134940+surashed@users.noreply.github.com> Co-authored-by: Kaihui (Kerwin) Sun Co-authored-by: Zhenglai Zhang Co-authored-by: om-nishant <50401171+om-nishant@users.noreply.github.com> Co-authored-by: Ihar Voitka Co-authored-by: Ruoxuan Wang <52271048+ruowan@users.noreply.github.com> Co-authored-by: Ju Hee Lee Co-authored-by: xiazhan Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> Co-authored-by: Ji Wang Co-authored-by: Andy Zhang Co-authored-by: guy-microsoft <50947884+guy-microsoft@users.noreply.github.com> Co-authored-by: PoAn (Baron) Chen Co-authored-by: Arcturus Co-authored-by: suyash691 Co-authored-by: nemijato <68876730+nemijato@users.noreply.github.com> Co-authored-by: brpanask <64860651+brpanask@users.noreply.github.com> Co-authored-by: Ray Chen Co-authored-by: Eli Arbel Co-authored-by: David Han <76010854+david-msft@users.noreply.github.com> Co-authored-by: Roman Khotsyn Co-authored-by: David R. Williamson Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Xinyi Joffre Co-authored-by: roytan-microsoft <73565668+roytan-microsoft@users.noreply.github.com> Co-authored-by: Vitaliy Fedonkin Co-authored-by: Samir Solanki Co-authored-by: maksimkim Co-authored-by: promoisha Co-authored-by: REDMOND\glfeokti Co-authored-by: RupengLiu Co-authored-by: vfedonkin Co-authored-by: David Čepelík Co-authored-by: David Čepelík Co-authored-by: mudit794 <42189950+mudit794@users.noreply.github.com> Co-authored-by: Dhawal Jain <41853104+dhawal777@users.noreply.github.com> Co-authored-by: MichalHel <51286657+MichalHel@users.noreply.github.com> Co-authored-by: Liran Chen Co-authored-by: jochav <75458295+jochav@users.noreply.github.com> Co-authored-by: Jorge Chavez Nieto Co-authored-by: rikogeln <40666347+rikogeln@users.noreply.github.com> Co-authored-by: chgennar <56695749+chgennar@users.noreply.github.com> Co-authored-by: hivyas <61890270+hivyas@users.noreply.github.com> Co-authored-by: Douglas Lee <65295939+leedouglas@users.noreply.github.com> Co-authored-by: Cameron Taggart Co-authored-by: LingyunSu <33764806+LingyunSu@users.noreply.github.com> Co-authored-by: elabicha <61994320+elabicha@users.noreply.github.com> Co-authored-by: Nikhil Kumar Mengani <62704762+nimengan@users.noreply.github.com> Co-authored-by: Junbo Wang Co-authored-by: Daniel Orozco <64658732+dagoroz@users.noreply.github.com> Co-authored-by: Adam Sandor Co-authored-by: yashmuel <63585146+yashmuel@users.noreply.github.com> --- .../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 + .../v2020_04_01_preview/models/__init__.py | 9 + .../v2020_04_01_preview/models/_models.py | 138 ++- .../v2020_04_01_preview/models/_models_py3.py | 140 ++- .../_role_assignments_operations.py | 44 +- 23 files changed, 4657 insertions(+), 32 deletions(-) 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 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 0000000000000..e8714b719dfc2 --- /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 0000000000000..5be11b05b4c35 --- /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 0000000000000..c192b8088f15e --- /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 0000000000000..ca65be97a222d --- /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 0000000000000..f5f418ee37b8a --- /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 0000000000000..a1ca401fb100a --- /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 0000000000000..ddf2d9365d2f0 --- /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 0000000000000..3def9e2f03678 --- /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 0000000000000..cba7f42add555 --- /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 0000000000000..c86d01586b5ce --- /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 0000000000000..f851a3bba40d1 --- /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 0000000000000..8efbc740b4a46 --- /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 0000000000000..dbc28ccb44307 --- /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 0000000000000..8d9ab8526f463 --- /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 0000000000000..059e1d3289cc4 --- /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 0000000000000..7aa0afdaf94ac --- /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 0000000000000..ccfad23cb52c9 --- /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 0000000000000..3b6b4072fac71 --- /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 0000000000000..7921c843fb544 --- /dev/null +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_05_01_preview/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2018-05-01-preview" + diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py index 7fa9d33fff9dc..b9da08d124b53 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 ca78bb76ffd1a..9acbb5024643a 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CloudError(Model): @@ -20,6 +21,112 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: + ~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class RoleAssignment(Model): """Role Assignments. @@ -54,8 +161,19 @@ class RoleAssignment(Model): StringEqualsIgnoreCase 'foo_storage_container' :type condition: str :param condition_version: Version of the condition. Currently accepted - values are '1.0' or '2.0' + value is '2.0' :type condition_version: str + :param created_on: Time it was created + :type created_on: datetime + :param updated_on: Time it was updated + :type updated_on: datetime + :param created_by: Id of the user who created the assignment + :type created_by: str + :param updated_by: Id of the user who updated the assignment + :type updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -76,6 +194,11 @@ class RoleAssignment(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'updated_on': {'key': 'properties.updatedOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -91,6 +214,11 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) self.condition = kwargs.get('condition', None) self.condition_version = kwargs.get('condition_version', None) + self.created_on = kwargs.get('created_on', None) + self.updated_on = kwargs.get('updated_on', None) + self.created_by = kwargs.get('created_by', None) + self.updated_by = kwargs.get('updated_by', None) + self.delegated_managed_identity_resource_id = kwargs.get('delegated_managed_identity_resource_id', None) class RoleAssignmentCreateParameters(Model): @@ -116,9 +244,13 @@ class RoleAssignmentCreateParameters(Model): :type can_delegate: bool :param description: Description of role assignment :type description: str - :param condition: The conditions on the role assignment + :param condition: The conditions on the role assignment. This limits the + resources it can be assigned to. e.g.: + @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + StringEqualsIgnoreCase 'foo_storage_container' :type condition: str - :param condition_version: Version of the condition + :param condition_version: Version of the condition. Currently accepted + value is '2.0' :type condition_version: str """ diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py index 2d4acd255fca7..1c3cac6b6cba6 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class CloudError(Model): @@ -20,6 +21,112 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: + ~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class RoleAssignment(Model): """Role Assignments. @@ -54,8 +161,19 @@ class RoleAssignment(Model): StringEqualsIgnoreCase 'foo_storage_container' :type condition: str :param condition_version: Version of the condition. Currently accepted - values are '1.0' or '2.0' + value is '2.0' :type condition_version: str + :param created_on: Time it was created + :type created_on: datetime + :param updated_on: Time it was updated + :type updated_on: datetime + :param created_by: Id of the user who created the assignment + :type created_by: str + :param updated_by: Id of the user who updated the assignment + :type updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -76,9 +194,14 @@ class RoleAssignment(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'updated_on': {'key': 'properties.updatedOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } - def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, **kwargs) -> None: + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, created_on=None, updated_on=None, created_by: str=None, updated_by: str=None, delegated_managed_identity_resource_id: str=None, **kwargs) -> None: super(RoleAssignment, self).__init__(**kwargs) self.id = None self.name = None @@ -91,6 +214,11 @@ def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_i self.description = description self.condition = condition self.condition_version = condition_version + self.created_on = created_on + self.updated_on = updated_on + self.created_by = created_by + self.updated_by = updated_by + self.delegated_managed_identity_resource_id = delegated_managed_identity_resource_id class RoleAssignmentCreateParameters(Model): @@ -116,9 +244,13 @@ class RoleAssignmentCreateParameters(Model): :type can_delegate: bool :param description: Description of role assignment :type description: str - :param condition: The conditions on the role assignment + :param condition: The conditions on the role assignment. This limits the + resources it can be assigned to. e.g.: + @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + StringEqualsIgnoreCase 'foo_storage_container' :type condition: str - :param condition_version: Version of the condition + :param condition_version: Version of the condition. Currently accepted + value is '2.0' :type condition_version: str """ diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py index 2fe33743dac89..7e3838a918639 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py @@ -148,7 +148,8 @@ def list_for_resource_group( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -190,9 +191,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -223,7 +222,8 @@ def delete( :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -251,10 +251,8 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -294,7 +292,8 @@ def create( :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create.metadata['url'] @@ -327,9 +326,7 @@ def create( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: @@ -359,7 +356,8 @@ def get( :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -388,9 +386,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -601,7 +597,8 @@ def list( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -642,9 +639,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -676,7 +671,8 @@ def list_for_scope( :return: An iterator like instance of RoleAssignment :rtype: ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -717,9 +713,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response