From a4c55b79c68a457a5f643ea2da198ddea8d55525 Mon Sep 17 00:00:00 2001 From: zsgwwj Date: Wed, 6 Apr 2022 17:46:46 +0800 Subject: [PATCH 1/3] authorization-track2-release --- common/config/rush/pnpm-lock.yaml | 18 +- .../arm-authorization/CHANGELOG.md | 27 +- sdk/authorization/arm-authorization/LICENSE | 2 +- sdk/authorization/arm-authorization/README.md | 24 +- .../arm-authorization/_meta.json | 7 +- .../arm-authorization/api-extractor.json | 27 +- .../arm-authorization/package.json | 56 +- .../node/my_test/recording_sample_test.js | 5 + .../review/arm-authorization.api.md | 1488 +++++----- .../arm-authorization/rollup.config.js | 78 +- .../arm-authorization/sample.env | 4 + .../accessReviewDefaultSettingsGetSample.ts | 28 + .../accessReviewDefaultSettingsPutSample.ts | 34 + ...cessReviewHistoryDefinitionCreateSample.ts | 36 + ...ReviewHistoryDefinitionDeleteByIdSample.ts | 31 + ...nitionInstanceGenerateDownloadUriSample.ts | 33 + ...iewHistoryDefinitionInstancesListSample.ts | 34 + ...ssReviewHistoryDefinitionsGetByIdSample.ts | 31 + ...ccessReviewHistoryDefinitionsListSample.ts | 31 + ...viewInstanceAcceptRecommendationsSample.ts | 33 + ...ccessReviewInstanceApplyDecisionsSample.ts | 33 + ...iewInstanceContactedReviewersListSample.ts | 36 + ...accessReviewInstanceDecisionsListSample.ts | 36 + ...sReviewInstanceMyDecisionsGetByIdSample.ts | 35 + ...cessReviewInstanceMyDecisionsListSample.ts | 36 + ...essReviewInstanceMyDecisionsPatchSample.ts | 40 + ...ccessReviewInstanceResetDecisionsSample.ts | 33 + ...accessReviewInstanceSendRemindersSample.ts | 33 + .../accessReviewInstanceStopSample.ts | 33 + ...ancesAssignedForMyApprovalGetByIdSample.ts | 33 + ...nstancesAssignedForMyApprovalListSample.ts | 42 + .../accessReviewInstancesCreateSample.ts | 38 + .../accessReviewInstancesGetByIdSample.ts | 33 + .../accessReviewInstancesListSample.ts | 34 + ...initionsAssignedForMyApprovalListSample.ts | 40 + ...duleDefinitionsCreateOrUpdateByIdSample.ts | 36 + ...viewScheduleDefinitionsDeleteByIdSample.ts | 31 + ...sReviewScheduleDefinitionsGetByIdSample.ts | 31 + ...cessReviewScheduleDefinitionsListSample.ts | 31 + ...cessReviewScheduleDefinitionsStopSample.ts | 31 + ...iewInstanceContactedReviewersListSample.ts | 36 + .../samples/v9-beta/javascript/README.md | 108 + .../accessReviewDefaultSettingsGetSample.js | 28 + .../accessReviewDefaultSettingsPutSample.js | 29 + ...cessReviewHistoryDefinitionCreateSample.js | 33 + ...ReviewHistoryDefinitionDeleteByIdSample.js | 31 + ...nitionInstanceGenerateDownloadUriSample.js | 33 + ...iewHistoryDefinitionInstancesListSample.js | 32 + ...ssReviewHistoryDefinitionsGetByIdSample.js | 29 + ...ccessReviewHistoryDefinitionsListSample.js | 31 + ...viewInstanceAcceptRecommendationsSample.js | 33 + ...ccessReviewInstanceApplyDecisionsSample.js | 33 + ...iewInstanceContactedReviewersListSample.js | 36 + ...accessReviewInstanceDecisionsListSample.js | 33 + ...sReviewInstanceMyDecisionsGetByIdSample.js | 35 + ...cessReviewInstanceMyDecisionsListSample.js | 33 + ...essReviewInstanceMyDecisionsPatchSample.js | 37 + ...ccessReviewInstanceResetDecisionsSample.js | 33 + ...accessReviewInstanceSendRemindersSample.js | 33 + .../accessReviewInstanceStopSample.js | 30 + ...ancesAssignedForMyApprovalGetByIdSample.js | 33 + ...nstancesAssignedForMyApprovalListSample.js | 39 + .../accessReviewInstancesCreateSample.js | 31 + .../accessReviewInstancesGetByIdSample.js | 30 + .../accessReviewInstancesListSample.js | 32 + ...initionsAssignedForMyApprovalListSample.js | 37 + ...duleDefinitionsCreateOrUpdateByIdSample.js | 33 + ...viewScheduleDefinitionsDeleteByIdSample.js | 29 + ...sReviewScheduleDefinitionsGetByIdSample.js | 29 + ...cessReviewScheduleDefinitionsListSample.js | 31 + ...cessReviewScheduleDefinitionsStopSample.js | 29 + .../samples/v9-beta/javascript/package.json | 32 + .../samples/v9-beta/javascript/sample.env | 4 + ...iewInstanceContactedReviewersListSample.js | 36 + .../samples/v9-beta/typescript/README.md | 121 + .../samples/v9-beta/typescript/package.json | 41 + .../samples/v9-beta/typescript/sample.env | 4 + .../accessReviewDefaultSettingsGetSample.ts | 28 + .../accessReviewDefaultSettingsPutSample.ts | 34 + ...cessReviewHistoryDefinitionCreateSample.ts | 36 + ...ReviewHistoryDefinitionDeleteByIdSample.ts | 31 + ...nitionInstanceGenerateDownloadUriSample.ts | 33 + ...iewHistoryDefinitionInstancesListSample.ts | 34 + ...ssReviewHistoryDefinitionsGetByIdSample.ts | 31 + ...ccessReviewHistoryDefinitionsListSample.ts | 31 + ...viewInstanceAcceptRecommendationsSample.ts | 33 + ...ccessReviewInstanceApplyDecisionsSample.ts | 33 + ...iewInstanceContactedReviewersListSample.ts | 36 + ...accessReviewInstanceDecisionsListSample.ts | 36 + ...sReviewInstanceMyDecisionsGetByIdSample.ts | 35 + ...cessReviewInstanceMyDecisionsListSample.ts | 36 + ...essReviewInstanceMyDecisionsPatchSample.ts | 40 + ...ccessReviewInstanceResetDecisionsSample.ts | 33 + ...accessReviewInstanceSendRemindersSample.ts | 33 + .../src/accessReviewInstanceStopSample.ts | 33 + ...ancesAssignedForMyApprovalGetByIdSample.ts | 33 + ...nstancesAssignedForMyApprovalListSample.ts | 42 + .../src/accessReviewInstancesCreateSample.ts | 38 + .../src/accessReviewInstancesGetByIdSample.ts | 33 + .../src/accessReviewInstancesListSample.ts | 34 + ...initionsAssignedForMyApprovalListSample.ts | 40 + ...duleDefinitionsCreateOrUpdateByIdSample.ts | 36 + ...viewScheduleDefinitionsDeleteByIdSample.ts | 31 + ...sReviewScheduleDefinitionsGetByIdSample.ts | 31 + ...cessReviewScheduleDefinitionsListSample.ts | 31 + ...cessReviewScheduleDefinitionsStopSample.ts | 31 + ...iewInstanceContactedReviewersListSample.ts | 36 + .../samples/v9-beta/typescript/tsconfig.json | 17 + .../src/authorizationManagementClient.ts | 166 +- .../authorizationManagementClientContext.ts | 70 - .../arm-authorization/src/index.ts | 1 - .../arm-authorization/src/models/index.ts | 2342 ++++++++-------- .../arm-authorization/src/models/mappers.ts | 2420 +++++++---------- .../src/models/parameters.ts | 241 +- .../accessReviewDefaultSettingsOperations.ts | 98 + .../accessReviewHistoryDefinitionInstance.ts | 74 + .../accessReviewHistoryDefinitionInstances.ts | 166 ++ ...accessReviewHistoryDefinitionOperations.ts | 111 + .../accessReviewHistoryDefinitions.ts | 183 ++ .../accessReviewInstanceContactedReviewers.ts | 178 ++ .../accessReviewInstanceDecisions.ts | 178 ++ .../accessReviewInstanceMyDecisions.ts | 267 ++ .../accessReviewInstanceOperations.ts | 221 ++ .../src/operations/accessReviewInstances.ts | 252 ++ ...essReviewInstancesAssignedForMyApproval.ts | 201 ++ .../accessReviewScheduleDefinitions.ts | 295 ++ ...cheduleDefinitionsAssignedForMyApproval.ts | 140 + .../src/operations/eligibleChildResources.ts | 149 - .../arm-authorization/src/operations/index.ts | 25 +- .../src/operations/operations.ts | 137 + .../roleAssignmentScheduleInstances.ts | 192 -- .../roleAssignmentScheduleRequests.ts | 280 -- .../src/operations/roleAssignmentSchedules.ts | 189 -- .../src/operations/roleAssignments.ts | 974 ------- .../roleEligibilityScheduleInstances.ts | 192 -- .../roleEligibilityScheduleRequests.ts | 280 -- .../operations/roleEligibilitySchedules.ts | 189 -- .../src/operations/roleManagementPolicies.ts | 271 -- .../roleManagementPolicyAssignments.ts | 276 -- ...lAccessReviewInstanceContactedReviewers.ts | 178 ++ .../accessReviewDefaultSettingsOperations.ts | 35 + .../accessReviewHistoryDefinitionInstance.ts | 28 + .../accessReviewHistoryDefinitionInstances.ts | 27 + ...accessReviewHistoryDefinitionOperations.ts | 38 + .../accessReviewHistoryDefinitions.ts | 37 + .../accessReviewInstanceContactedReviewers.ts | 29 + .../accessReviewInstanceDecisions.ts | 29 + .../accessReviewInstanceMyDecisions.ts | 62 + .../accessReviewInstanceOperations.ts | 74 + .../accessReviewInstances.ts | 56 + ...essReviewInstancesAssignedForMyApproval.ts | 40 + .../accessReviewScheduleDefinitions.ts | 70 + ...cheduleDefinitionsAssignedForMyApproval.ts | 25 + .../eligibleChildResources.ts | 28 - .../src/operationsInterfaces/index.ts | 25 +- .../src/operationsInterfaces/operations.ts | 22 + .../roleAssignmentScheduleInstances.ts | 42 - .../roleAssignmentScheduleRequests.ts | 76 - .../roleAssignmentSchedules.ts | 41 - .../operationsInterfaces/roleAssignments.ts | 195 -- .../roleEligibilityScheduleInstances.ts | 42 - .../roleEligibilityScheduleRequests.ts | 76 - .../roleEligibilitySchedules.ts | 41 - .../roleManagementPolicies.ts | 68 - .../roleManagementPolicyAssignments.ts | 71 - ...lAccessReviewInstanceContactedReviewers.ts | 29 + .../arm-authorization/test/sampleTest.ts | 48 + .../arm-authorization/tsconfig.json | 24 +- sdk/authorization/ci.mgmt.yml | 4 +- 169 files changed, 9704 insertions(+), 7692 deletions(-) create mode 100644 sdk/authorization/arm-authorization/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/authorization/arm-authorization/sample.env create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/README.md create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsPutSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstancesListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceAcceptRecommendationsSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceApplyDecisionsSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceContactedReviewersListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceDecisionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsPatchSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceResetDecisionsSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceSendRemindersSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceStopSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsStopSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/package.json create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/sample.env create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/README.md create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/package.json create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/sample.env create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsPutSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceApplyDecisionsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceContactedReviewersListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceDecisionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceResetDecisionsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceSendRemindersSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceStopSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsStopSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9-beta/typescript/tsconfig.json delete mode 100644 sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/operations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignments.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignments.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts create mode 100644 sdk/authorization/arm-authorization/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a119dfec29ba..8afa7d49b611 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9640,21 +9640,31 @@ packages: dev: false file:projects/arm-authorization.tgz: - resolution: {integrity: sha512-G1VpgblVPEzRfMyiETGD1ZOSETwtleOSpYkTxI70vUYNS9v7WuQhftIEHgXwIPMQtP+ujyBV+Fo3GwH9ziANSQ==, tarball: file:projects/arm-authorization.tgz} + resolution: {integrity: sha512-Ix/OvJC+D7IttysMC9nx2fAfJwTsOXjS/+hPFjU2PvL5voTQmipGKtlyou95nu6pn5gFIXZLWdd2rw+vrQEJcQ==, tarball: file:projects/arm-authorization.tgz} name: '@rush-temp/arm-authorization' version: 0.0.0 dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 3.0.1_rollup@2.67.1 - '@rollup/plugin-node-resolve': 8.4.0_rollup@2.67.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 + cross-env: 7.0.3 mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@2.67.1 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 + transitivePeerDependencies: + - '@types/node' + - debug + - encoding + - supports-color dev: false file:projects/arm-avs.tgz: diff --git a/sdk/authorization/arm-authorization/CHANGELOG.md b/sdk/authorization/arm-authorization/CHANGELOG.md index 194a561c04a6..057d53534380 100644 --- a/sdk/authorization/arm-authorization/CHANGELOG.md +++ b/sdk/authorization/arm-authorization/CHANGELOG.md @@ -1,26 +1,11 @@ # Release History + +## 9.0.0-beta.2 (2022-04-06) -## 9.0.0-beta.2 (Unreleased) +The package of @azure/arm-authorization is using our next generation design principles since version 9.0.0-beta.2, which contains breaking changes. -### Features Added +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). -### Breaking Changes +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -### Bugs Fixed - -### Other Changes - -## 9.0.0-beta.1 (2021-10-09) - -This is the first preview for the new version of the `@azure/arm-authorization` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services. - -While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/). - -Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies. - -**Noteworthy changes and features** -- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice. -- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead. -- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page. -- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`. -- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6. +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/authorization/arm-authorization/LICENSE b/sdk/authorization/arm-authorization/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/authorization/arm-authorization/LICENSE +++ b/sdk/authorization/arm-authorization/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/authorization/arm-authorization/README.md b/sdk/authorization/arm-authorization/README.md index 87527b6e05b8..8083290d09af 100644 --- a/sdk/authorization/arm-authorization/README.md +++ b/sdk/authorization/arm-authorization/README.md @@ -2,11 +2,11 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure AuthorizationManagement client. -Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role assignments. A role assignment grants access to Azure Active Directory users. +Access reviews service provides the workflow for running access reviews on different kind of resources. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-authorization) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-authorization) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -16,6 +16,8 @@ Role based access control provides you a way to apply granular level policy admi - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + ### Prerequisites - An [Azure subscription][azure_sub]. @@ -33,9 +35,9 @@ npm install @azure/arm-authorization To create a client object to access the Azure AuthorizationManagement API, you will need the `endpoint` of your Azure AuthorizationManagement resource and a `credential`. The Azure AuthorizationManagement client can use Azure Active Directory credentials to authenticate. You can find the endpoint for your Azure AuthorizationManagement resource in the [Azure Portal][azure_portal]. -#### Using an Azure Active Directory Credential +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: ```bash npm install @azure/identity @@ -45,13 +47,27 @@ You will also need to **register a new AAD application and grant access to Azure Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + ```javascript const { AuthorizationManagementClient } = require("@azure/arm-authorization"); const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new AuthorizationManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new AuthorizationManagementClient(credential, subscriptionId); ``` + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + ## Key concepts ### AuthorizationManagementClient diff --git a/sdk/authorization/arm-authorization/_meta.json b/sdk/authorization/arm-authorization/_meta.json index d11bfb4ce957..6fff19fd6bef 100644 --- a/sdk/authorization/arm-authorization/_meta.json +++ b/sdk/authorization/arm-authorization/_meta.json @@ -1,7 +1,8 @@ { - "commit": "f9e4843e2ed3494e8bd66a92c3e7f65655f58f46", + "commit": "e4b7e666673125aeb2b130f2a196e6aa7f8aca72", "readme": "specification/authorization/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/authorization/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.12", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\authorization\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-beta.12" + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.1", + "use": "@autorest/typescript@6.0.0-alpha.18.20220329.1" } \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/api-extractor.json b/sdk/authorization/arm-authorization/api-extractor.json index 721910fd40b8..7c284110c453 100644 --- a/sdk/authorization/arm-authorization/api-extractor.json +++ b/sdk/authorization/arm-authorization/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "./dist-esm/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-authorization.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/package.json b/sdk/authorization/arm-authorization/package.json index 17da925c98bf..9b154e8b3a3b 100644 --- a/sdk/authorization/arm-authorization/package.json +++ b/sdk/authorization/arm-authorization/package.json @@ -8,7 +8,7 @@ "node": ">=12.0.0" }, "dependencies": { - "@azure/core-paging": "^1.1.1", + "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.0.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.1.0", @@ -23,19 +23,24 @@ ], "license": "MIT", "main": "./dist/index.js", - "module": "./dist-esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./types/arm-authorization.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.0.0", - "@rollup/plugin-multi-entry": "^3.0.0", - "@rollup/plugin-node-resolve": "^8.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", - "rollup": "^2.0.0", - "rollup-plugin-sourcemaps": "^0.4.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization", "repository": { @@ -64,14 +69,14 @@ "types/*" ], "scripts": { - "build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "prepack": "npm run build", "pack": "npm pack 2>&1", "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -79,18 +84,33 @@ "check-format": "echo skipped", "execute:samples": "echo skipped", "format": "echo skipped", - "test": "echo skipped", - "prebuild": "echo skipped", + "test": "npm run integration-test", "test:node": "echo skipped", "test:browser": "echo skipped", - "unit-test": "echo skipped", - "unit-test:node": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "echo skipped", "docs": "echo skipped" }, "sideEffects": false, - "autoPublish": true -} + "//metadata": { + "constantPaths": [ + { + "path": "src/authorizationManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview" + } +} \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/recordings/node/my_test/recording_sample_test.js b/sdk/authorization/arm-authorization/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/authorization/arm-authorization/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/authorization/arm-authorization/review/arm-authorization.api.md b/sdk/authorization/arm-authorization/review/arm-authorization.api.md index c3712ab2a018..aace0d9ea6fc 100644 --- a/sdk/authorization/arm-authorization/review/arm-authorization.api.md +++ b/sdk/authorization/arm-authorization/review/arm-authorization.api.md @@ -9,1288 +9,1068 @@ import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public -export type ApprovalMode = string; +export type AccessRecommendationType = string; // @public -export interface ApprovalSettings { - approvalMode?: ApprovalMode; - approvalStages?: ApprovalStage[]; - isApprovalRequired?: boolean; - isApprovalRequiredForExtension?: boolean; - isRequestorJustificationRequired?: boolean; -} - -// @public -export interface ApprovalStage { - approvalStageTimeOutInDays?: number; - escalationApprovers?: UserSet[]; - escalationTimeInMinutes?: number; - isApproverJustificationRequired?: boolean; - isEscalationEnabled?: boolean; - primaryApprovers?: UserSet[]; -} - -// @public -export type AssignmentType = string; - -// @public (undocumented) -export class AuthorizationManagementClient extends AuthorizationManagementClientContext { - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AuthorizationManagementClientOptionalParams); - // (undocumented) - eligibleChildResources: EligibleChildResources; - // (undocumented) - roleAssignments: RoleAssignments; - // (undocumented) - roleAssignmentScheduleInstances: RoleAssignmentScheduleInstances; - // (undocumented) - roleAssignmentScheduleRequests: RoleAssignmentScheduleRequests; - // (undocumented) - roleAssignmentSchedules: RoleAssignmentSchedules; - // (undocumented) - roleEligibilityScheduleInstances: RoleEligibilityScheduleInstances; - // (undocumented) - roleEligibilityScheduleRequests: RoleEligibilityScheduleRequests; - // (undocumented) - roleEligibilitySchedules: RoleEligibilitySchedules; - // (undocumented) - roleManagementPolicies: RoleManagementPolicies; - // (undocumented) - roleManagementPolicyAssignments: RoleManagementPolicyAssignments; -} - -// @public (undocumented) -export class AuthorizationManagementClientContext extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AuthorizationManagementClientOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - subscriptionId: string; -} +export type AccessReviewActorIdentityType = string; // @public -export interface AuthorizationManagementClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; -} +export type AccessReviewApplyResult = string; // @public -export interface CloudError { - error?: CloudErrorBody; +export interface AccessReviewContactedReviewer { + readonly createdDateTime?: Date; + readonly id?: string; + readonly name?: string; + readonly type?: string; + readonly userDisplayName?: string; + readonly userPrincipalName?: string; } // @public -export interface CloudErrorBody { - code?: string; - message?: string; +export interface AccessReviewContactedReviewerListResult { + nextLink?: string; + value?: AccessReviewContactedReviewer[]; } // @public -export interface EligibleChildResource { +export interface AccessReviewDecision { + readonly appliedDateTime?: Date; + readonly applyResult?: AccessReviewApplyResult; + decision?: AccessReviewResult; + readonly displayNamePropertiesPrincipalDisplayName?: string; + readonly displayNamePropertiesResourceDisplayName?: string; readonly id?: string; + readonly idPropertiesPrincipalId?: string; + readonly idPropertiesResourceId?: string; + justification?: string; readonly name?: string; + readonly principalIdPropertiesAppliedByPrincipalId?: string; + readonly principalIdPropertiesReviewedByPrincipalId?: string; + readonly principalNamePropertiesAppliedByPrincipalName?: string; + readonly principalNamePropertiesReviewedByPrincipalName?: string; + readonly principalTypePropertiesAppliedByPrincipalType?: AccessReviewActorIdentityType; + readonly principalTypePropertiesReviewedByPrincipalType?: AccessReviewActorIdentityType; + readonly recommendation?: AccessRecommendationType; + readonly reviewedDateTime?: Date; readonly type?: string; + typePropertiesPrincipalType?: DecisionTargetType; + typePropertiesResourceType?: DecisionResourceType; + readonly userPrincipalNamePropertiesAppliedByUserPrincipalName?: string; + readonly userPrincipalNamePropertiesReviewedByUserPrincipalName?: string; } // @public -export interface EligibleChildResources { - list(scope: string, options?: EligibleChildResourcesGetOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface EligibleChildResourcesGetNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface AccessReviewDecisionIdentity { + readonly displayName?: string; + readonly id?: string; + type: "user" | "servicePrincipal"; } -// @public -export type EligibleChildResourcesGetNextResponse = EligibleChildResourcesListResult; +// @public (undocumented) +export type AccessReviewDecisionIdentityUnion = AccessReviewDecisionIdentity | AccessReviewDecisionUserIdentity | AccessReviewDecisionServicePrincipalIdentity; // @public -export interface EligibleChildResourcesGetOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface AccessReviewDecisionListResult { + nextLink?: string; + value?: AccessReviewDecision[]; } // @public -export type EligibleChildResourcesGetResponse = EligibleChildResourcesListResult; - -// @public -export interface EligibleChildResourcesListResult { - nextLink?: string; - value?: EligibleChildResource[]; +export interface AccessReviewDecisionProperties { + readonly appliedDateTime?: Date; + readonly applyResult?: AccessReviewApplyResult; + decision?: AccessReviewResult; + readonly displayNamePrincipalDisplayName?: string; + readonly displayNameResourceDisplayName?: string; + readonly idPrincipalId?: string; + readonly idResourceId?: string; + justification?: string; + readonly principalIdAppliedByPrincipalId?: string; + readonly principalIdReviewedByPrincipalId?: string; + readonly principalNameAppliedByPrincipalName?: string; + readonly principalNameReviewedByPrincipalName?: string; + readonly principalTypeAppliedByPrincipalType?: AccessReviewActorIdentityType; + readonly principalTypeReviewedByPrincipalType?: AccessReviewActorIdentityType; + readonly recommendation?: AccessRecommendationType; + readonly reviewedDateTime?: Date; + typePrincipalType?: DecisionTargetType; + typeResourceType?: DecisionResourceType; + readonly userPrincipalNameAppliedByUserPrincipalName?: string; + readonly userPrincipalNameReviewedByUserPrincipalName?: string; +} + +// @public +export interface AccessReviewDecisionResource { + readonly displayName?: string; + readonly id?: string; + type: "azureRole"; } // @public -export type EnablementRules = string; +export type AccessReviewDecisionResourceAzureRole = AccessReviewDecisionResource & { + type: "azureRole"; +}; -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; -} +// @public (undocumented) +export type AccessReviewDecisionResourceUnion = AccessReviewDecisionResource | AccessReviewDecisionResourceAzureRole; // @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} +export type AccessReviewDecisionServicePrincipalIdentity = AccessReviewDecisionIdentity & { + type: "servicePrincipal"; + readonly appId?: string; +}; // @public -export interface ErrorResponse { - error?: ErrorDetail; -} - -// @public (undocumented) -export interface ExpandedProperties { - principal?: ExpandedPropertiesPrincipal; - roleDefinition?: ExpandedPropertiesRoleDefinition; - scope?: ExpandedPropertiesScope; -} +export type AccessReviewDecisionUserIdentity = AccessReviewDecisionIdentity & { + type: "user"; + readonly userPrincipalName?: string; +}; // @public -export interface ExpandedPropertiesPrincipal { - displayName?: string; - email?: string; - id?: string; - type?: string; +export interface AccessReviewDefaultSettings { + autoApplyDecisionsEnabled?: boolean; + defaultDecision?: DefaultDecisionType; + defaultDecisionEnabled?: boolean; + endDate?: Date; + readonly id?: string; + instanceDurationInDays?: number; + interval?: number; + justificationRequiredOnApproval?: boolean; + mailNotificationsEnabled?: boolean; + readonly name?: string; + numberOfOccurrences?: number; + recommendationLookBackDuration?: string; + recommendationsEnabled?: boolean; + reminderNotificationsEnabled?: boolean; + startDate?: Date; + readonly type?: string; + typePropertiesRecurrencePatternType?: AccessReviewRecurrencePatternType; + typePropertiesRecurrenceRangeType?: AccessReviewRecurrenceRangeType; } // @public -export interface ExpandedPropertiesRoleDefinition { - displayName?: string; - id?: string; - type?: string; +export interface AccessReviewDefaultSettingsGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface ExpandedPropertiesScope { - displayName?: string; - id?: string; - type?: string; -} +export type AccessReviewDefaultSettingsGetResponse = AccessReviewDefaultSettings; // @public -export enum KnownApprovalMode { - // (undocumented) - NoApproval = "NoApproval", - // (undocumented) - Parallel = "Parallel", - // (undocumented) - Serial = "Serial", - // (undocumented) - SingleStage = "SingleStage" +export interface AccessReviewDefaultSettingsOperations { + get(options?: AccessReviewDefaultSettingsGetOptionalParams): Promise; + put(properties: AccessReviewScheduleSettings, options?: AccessReviewDefaultSettingsPutOptionalParams): Promise; } // @public -export enum KnownAssignmentType { - // (undocumented) - Activated = "Activated", - // (undocumented) - Assigned = "Assigned" +export interface AccessReviewDefaultSettingsPutOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownEnablementRules { - // (undocumented) - Justification = "Justification", - // (undocumented) - MultiFactorAuthentication = "MultiFactorAuthentication", - // (undocumented) - Ticketing = "Ticketing" -} +export type AccessReviewDefaultSettingsPutResponse = AccessReviewDefaultSettings; // @public -export enum KnownMemberType { - // (undocumented) - Direct = "Direct", - // (undocumented) - Group = "Group", - // (undocumented) - Inherited = "Inherited" +export interface AccessReviewHistoryDefinition { + readonly createdDateTime?: Date; + decisions?: AccessReviewResult[]; + displayName?: string; + endDate?: Date; + readonly id?: string; + instances?: AccessReviewHistoryInstance[]; + interval?: number; + readonly name?: string; + numberOfOccurrences?: number; + readonly principalId?: string; + readonly principalName?: string; + readonly principalType?: AccessReviewActorIdentityType; + readonly reviewHistoryPeriodEndDateTime?: Date; + readonly reviewHistoryPeriodStartDateTime?: Date; + scopes?: AccessReviewScope[]; + startDate?: Date; + readonly status?: AccessReviewHistoryDefinitionStatus; + readonly type?: string; + typePropertiesSettingsPatternType?: AccessReviewRecurrencePatternType; + typePropertiesSettingsRangeType?: AccessReviewRecurrenceRangeType; + readonly userPrincipalName?: string; } // @public -export enum KnownNotificationDeliveryMechanism { - // (undocumented) - Email = "Email" +export interface AccessReviewHistoryDefinitionCreateOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownNotificationLevel { - // (undocumented) - All = "All", - // (undocumented) - Critical = "Critical", - // (undocumented) - None = "None" -} +export type AccessReviewHistoryDefinitionCreateResponse = AccessReviewHistoryDefinition; // @public -export enum KnownPrincipalType { - // (undocumented) - Application = "Application", - // (undocumented) - Device = "Device", - // (undocumented) - DirectoryObjectOrGroup = "DirectoryObjectOrGroup", - // (undocumented) - DirectoryRoleTemplate = "DirectoryRoleTemplate", - // (undocumented) - Everyone = "Everyone", - // (undocumented) - ForeignGroup = "ForeignGroup", - // (undocumented) - Group = "Group", - // (undocumented) - MSI = "MSI", - // (undocumented) - ServicePrincipal = "ServicePrincipal", - // (undocumented) - Unknown = "Unknown", - // (undocumented) - User = "User" +export interface AccessReviewHistoryDefinitionDeleteByIdOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownRecipientType { - // (undocumented) - Admin = "Admin", - // (undocumented) - Approver = "Approver", - // (undocumented) - Requestor = "Requestor" +export interface AccessReviewHistoryDefinitionInstance { + generateDownloadUri(historyDefinitionId: string, instanceId: string, options?: AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams): Promise; } // @public -export enum KnownRequestType { - // (undocumented) - AdminAssign = "AdminAssign", - // (undocumented) - AdminExtend = "AdminExtend", - // (undocumented) - AdminRemove = "AdminRemove", - // (undocumented) - AdminRenew = "AdminRenew", - // (undocumented) - AdminUpdate = "AdminUpdate", - // (undocumented) - SelfActivate = "SelfActivate", - // (undocumented) - SelfDeactivate = "SelfDeactivate", - // (undocumented) - SelfExtend = "SelfExtend", - // (undocumented) - SelfRenew = "SelfRenew" +export interface AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownRoleManagementPolicyRuleType { - // (undocumented) - RoleManagementPolicyApprovalRule = "RoleManagementPolicyApprovalRule", - // (undocumented) - RoleManagementPolicyAuthenticationContextRule = "RoleManagementPolicyAuthenticationContextRule", - // (undocumented) - RoleManagementPolicyEnablementRule = "RoleManagementPolicyEnablementRule", - // (undocumented) - RoleManagementPolicyExpirationRule = "RoleManagementPolicyExpirationRule", - // (undocumented) - RoleManagementPolicyNotificationRule = "RoleManagementPolicyNotificationRule" -} +export type AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse = AccessReviewHistoryInstance; // @public -export enum KnownStatus { - // (undocumented) - Accepted = "Accepted", - // (undocumented) - AdminApproved = "AdminApproved", - // (undocumented) - AdminDenied = "AdminDenied", - // (undocumented) - Canceled = "Canceled", - // (undocumented) - Denied = "Denied", - // (undocumented) - Failed = "Failed", - // (undocumented) - FailedAsResourceIsLocked = "FailedAsResourceIsLocked", - // (undocumented) - Granted = "Granted", - // (undocumented) - Invalid = "Invalid", - // (undocumented) - PendingAdminDecision = "PendingAdminDecision", - // (undocumented) - PendingApproval = "PendingApproval", - // (undocumented) - PendingApprovalProvisioning = "PendingApprovalProvisioning", - // (undocumented) - PendingEvaluation = "PendingEvaluation", - // (undocumented) - PendingExternalProvisioning = "PendingExternalProvisioning", - // (undocumented) - PendingProvisioning = "PendingProvisioning", - // (undocumented) - PendingRevocation = "PendingRevocation", - // (undocumented) - PendingScheduleCreation = "PendingScheduleCreation", - // (undocumented) - Provisioned = "Provisioned", - // (undocumented) - ProvisioningStarted = "ProvisioningStarted", - // (undocumented) - Revoked = "Revoked", - // (undocumented) - ScheduleCreated = "ScheduleCreated", - // (undocumented) - TimedOut = "TimedOut" +export interface AccessReviewHistoryDefinitionInstanceListResult { + nextLink?: string; + value?: AccessReviewHistoryInstance[]; } // @public -export enum KnownType { - // (undocumented) - AfterDateTime = "AfterDateTime", - // (undocumented) - AfterDuration = "AfterDuration", - // (undocumented) - NoExpiration = "NoExpiration" +export interface AccessReviewHistoryDefinitionInstances { + list(historyDefinitionId: string, options?: AccessReviewHistoryDefinitionInstancesListOptionalParams): PagedAsyncIterableIterator; } // @public -export enum KnownUserType { - // (undocumented) - Group = "Group", - // (undocumented) - User = "User" +export interface AccessReviewHistoryDefinitionInstancesListNextOptionalParams extends coreClient.OperationOptions { } // @public -export type MemberType = string; - -// @public -export type NotificationDeliveryMechanism = string; +export type AccessReviewHistoryDefinitionInstancesListNextResponse = AccessReviewHistoryDefinitionInstanceListResult; // @public -export type NotificationLevel = string; - -// @public (undocumented) -export interface PolicyAssignmentProperties { - policy?: PolicyAssignmentPropertiesPolicy; - roleDefinition?: PolicyAssignmentPropertiesRoleDefinition; - scope?: PolicyAssignmentPropertiesScope; +export interface AccessReviewHistoryDefinitionInstancesListOptionalParams extends coreClient.OperationOptions { } // @public -export interface PolicyAssignmentPropertiesPolicy { - id?: string; - readonly lastModifiedBy?: Principal; - lastModifiedDateTime?: Date; -} +export type AccessReviewHistoryDefinitionInstancesListResponse = AccessReviewHistoryDefinitionInstanceListResult; // @public -export interface PolicyAssignmentPropertiesRoleDefinition { - displayName?: string; - id?: string; - type?: string; +export interface AccessReviewHistoryDefinitionListResult { + nextLink?: string; + value?: AccessReviewHistoryDefinition[]; } // @public -export interface PolicyAssignmentPropertiesScope { - displayName?: string; - id?: string; - type?: string; -} - -// @public (undocumented) -export interface PolicyProperties { - readonly scope?: PolicyPropertiesScope; +export interface AccessReviewHistoryDefinitionOperations { + create(historyDefinitionId: string, properties: AccessReviewHistoryDefinitionProperties, options?: AccessReviewHistoryDefinitionCreateOptionalParams): Promise; + deleteById(historyDefinitionId: string, options?: AccessReviewHistoryDefinitionDeleteByIdOptionalParams): Promise; } // @public -export interface PolicyPropertiesScope { +export interface AccessReviewHistoryDefinitionProperties { + readonly createdDateTime?: Date; + decisions?: AccessReviewResult[]; displayName?: string; - id?: string; - type?: string; + endDate?: Date; + instances?: AccessReviewHistoryInstance[]; + interval?: number; + numberOfOccurrences?: number; + readonly principalId?: string; + readonly principalName?: string; + readonly principalType?: AccessReviewActorIdentityType; + readonly reviewHistoryPeriodEndDateTime?: Date; + readonly reviewHistoryPeriodStartDateTime?: Date; + scopes?: AccessReviewScope[]; + startDate?: Date; + readonly status?: AccessReviewHistoryDefinitionStatus; + typeSettingsPatternType?: AccessReviewRecurrencePatternType; + typeSettingsRangeType?: AccessReviewRecurrenceRangeType; + readonly userPrincipalName?: string; } // @public -export interface Principal { - displayName?: string; - email?: string; - id?: string; - type?: string; +export interface AccessReviewHistoryDefinitions { + getById(historyDefinitionId: string, options?: AccessReviewHistoryDefinitionsGetByIdOptionalParams): Promise; + list(options?: AccessReviewHistoryDefinitionsListOptionalParams): PagedAsyncIterableIterator; } // @public -export type PrincipalType = string; - -// @public -export type RecipientType = string; +export interface AccessReviewHistoryDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions { +} // @public -export type RequestType = string; +export type AccessReviewHistoryDefinitionsGetByIdResponse = AccessReviewHistoryDefinition; // @public -export interface RoleAssignment { - condition?: string; - conditionVersion?: string; - readonly createdBy?: string; - readonly createdOn?: Date; - delegatedManagedIdentityResourceId?: string; - description?: string; - readonly id?: string; - readonly name?: string; - principalId?: string; - principalType?: PrincipalType; - roleDefinitionId?: string; - readonly scope?: string; - readonly type?: string; - readonly updatedBy?: string; - readonly updatedOn?: Date; +export interface AccessReviewHistoryDefinitionsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface RoleAssignmentCreateParameters { - condition?: string; - conditionVersion?: string; - readonly createdBy?: string; - readonly createdOn?: Date; - delegatedManagedIdentityResourceId?: string; - description?: string; - principalId: string; - principalType?: PrincipalType; - roleDefinitionId: string; - readonly scope?: string; - readonly updatedBy?: string; - readonly updatedOn?: Date; -} +export type AccessReviewHistoryDefinitionsListNextResponse = AccessReviewHistoryDefinitionListResult; // @public -export interface RoleAssignmentFilter { - principalId?: string; +export interface AccessReviewHistoryDefinitionsListOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface RoleAssignmentListResult { - readonly nextLink?: string; - value?: RoleAssignment[]; -} +export type AccessReviewHistoryDefinitionsListResponse = AccessReviewHistoryDefinitionListResult; // @public -export interface RoleAssignments { - create(scope: string, roleAssignmentName: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsCreateOptionalParams): Promise; - createById(roleAssignmentId: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsCreateByIdOptionalParams): Promise; - delete(scope: string, roleAssignmentName: string, options?: RoleAssignmentsDeleteOptionalParams): Promise; - deleteById(roleAssignmentId: string, options?: RoleAssignmentsDeleteByIdOptionalParams): Promise; - get(scope: string, roleAssignmentName: string, options?: RoleAssignmentsGetOptionalParams): Promise; - getById(roleAssignmentId: string, options?: RoleAssignmentsGetByIdOptionalParams): Promise; - listForResource(resourceGroupName: string, resourceProviderNamespace: string, resourceType: string, resourceName: string, options?: RoleAssignmentsListForResourceOptionalParams): PagedAsyncIterableIterator; - listForResourceGroup(resourceGroupName: string, options?: RoleAssignmentsListForResourceGroupOptionalParams): PagedAsyncIterableIterator; - listForScope(scope: string, options?: RoleAssignmentsListForScopeOptionalParams): PagedAsyncIterableIterator; - listForSubscription(options?: RoleAssignmentsListForSubscriptionOptionalParams): PagedAsyncIterableIterator; - validate(scope: string, roleAssignmentName: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsValidateOptionalParams): Promise; - validateById(roleAssignmentId: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsValidateByIdOptionalParams): Promise; -} +export type AccessReviewHistoryDefinitionStatus = string; // @public -export interface RoleAssignmentSchedule { - assignmentType?: AssignmentType; - condition?: string; - conditionVersion?: string; - createdOn?: Date; - endDateTime?: Date; - expandedProperties?: ExpandedProperties; +export interface AccessReviewHistoryInstance { + displayName?: string; + readonly downloadUri?: string; + expiration?: Date; + fulfilledDateTime?: Date; readonly id?: string; - linkedRoleEligibilityScheduleId?: string; - memberType?: MemberType; readonly name?: string; - principalId?: string; - principalType?: PrincipalType; - roleAssignmentScheduleRequestId?: string; - roleDefinitionId?: string; - scope?: string; - startDateTime?: Date; - status?: Status; + reviewHistoryPeriodEndDateTime?: Date; + reviewHistoryPeriodStartDateTime?: Date; + runDateTime?: Date; + readonly status?: AccessReviewHistoryDefinitionStatus; readonly type?: string; - updatedOn?: Date; -} - -// @public -export interface RoleAssignmentScheduleFilter { - principalId?: string; - roleDefinitionId?: string; - status?: string; } // @public -export interface RoleAssignmentScheduleInstance { - assignmentType?: AssignmentType; - condition?: string; - conditionVersion?: string; - createdOn?: Date; +export interface AccessReviewInstance { + backupReviewers?: AccessReviewReviewer[]; endDateTime?: Date; - expandedProperties?: ExpandedProperties; readonly id?: string; - linkedRoleEligibilityScheduleId?: string; - linkedRoleEligibilityScheduleInstanceId?: string; - memberType?: MemberType; readonly name?: string; - originRoleAssignmentId?: string; - principalId?: string; - principalType?: PrincipalType; - roleAssignmentScheduleId?: string; - roleDefinitionId?: string; - scope?: string; + reviewers?: AccessReviewReviewer[]; + readonly reviewersType?: AccessReviewInstanceReviewersType; startDateTime?: Date; - status?: Status; - readonly type?: string; -} - -// @public -export interface RoleAssignmentScheduleInstanceFilter { - principalId?: string; - roleAssignmentScheduleId?: string; - roleDefinitionId?: string; - status?: string; -} - -// @public -export interface RoleAssignmentScheduleInstanceListResult { - nextLink?: string; - value?: RoleAssignmentScheduleInstance[]; -} - -// @public -export interface RoleAssignmentScheduleInstances { - get(scope: string, roleAssignmentScheduleInstanceName: string, options?: RoleAssignmentScheduleInstancesGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface RoleAssignmentScheduleInstancesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type RoleAssignmentScheduleInstancesGetResponse = RoleAssignmentScheduleInstance; - -// @public -export interface RoleAssignmentScheduleInstancesListForScopeNextOptionalParams extends coreClient.OperationOptions { - filter?: string; -} - -// @public -export type RoleAssignmentScheduleInstancesListForScopeNextResponse = RoleAssignmentScheduleInstanceListResult; - -// @public -export interface RoleAssignmentScheduleInstancesListForScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; -} - -// @public -export type RoleAssignmentScheduleInstancesListForScopeResponse = RoleAssignmentScheduleInstanceListResult; - -// @public -export interface RoleAssignmentScheduleListResult { - nextLink?: string; - value?: RoleAssignmentSchedule[]; -} - -// @public -export interface RoleAssignmentScheduleRequest { - readonly approvalId?: string; - condition?: string; - conditionVersion?: string; - readonly createdOn?: Date; - readonly expandedProperties?: ExpandedProperties; - readonly id?: string; - justification?: string; - linkedRoleEligibilityScheduleId?: string; - readonly name?: string; - principalId?: string; - readonly principalType?: PrincipalType; - readonly requestorId?: string; - requestType?: RequestType; - roleDefinitionId?: string; - scheduleInfo?: RoleAssignmentScheduleRequestPropertiesScheduleInfo; - readonly scope?: string; - readonly status?: Status; - targetRoleAssignmentScheduleId?: string; - targetRoleAssignmentScheduleInstanceId?: string; - ticketInfo?: RoleAssignmentScheduleRequestPropertiesTicketInfo; + readonly status?: AccessReviewInstanceStatus; readonly type?: string; } // @public -export interface RoleAssignmentScheduleRequestFilter { - principalId?: string; - requestorId?: string; - roleDefinitionId?: string; - status?: string; +export interface AccessReviewInstanceAcceptRecommendationsOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleAssignmentScheduleRequestListResult { - nextLink?: string; - value?: RoleAssignmentScheduleRequest[]; +export interface AccessReviewInstanceApplyDecisionsOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleAssignmentScheduleRequestPropertiesScheduleInfo { - expiration?: RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; - startDateTime?: Date; +export interface AccessReviewInstanceContactedReviewers { + list(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceContactedReviewersListOptionalParams): PagedAsyncIterableIterator; } // @public -export interface RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration { - duration?: string; - endDateTime?: Date; - type?: Type; +export interface AccessReviewInstanceContactedReviewersListNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleAssignmentScheduleRequestPropertiesTicketInfo { - ticketNumber?: string; - ticketSystem?: string; -} +export type AccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; // @public -export interface RoleAssignmentScheduleRequests { - cancel(scope: string, roleAssignmentScheduleRequestName: string, options?: RoleAssignmentScheduleRequestsCancelOptionalParams): Promise; - create(scope: string, roleAssignmentScheduleRequestName: string, parameters: RoleAssignmentScheduleRequest, options?: RoleAssignmentScheduleRequestsCreateOptionalParams): Promise; - get(scope: string, roleAssignmentScheduleRequestName: string, options?: RoleAssignmentScheduleRequestsGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams): PagedAsyncIterableIterator; +export interface AccessReviewInstanceContactedReviewersListOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleAssignmentScheduleRequestsCancelOptionalParams extends coreClient.OperationOptions { -} +export type AccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; // @public -export interface RoleAssignmentScheduleRequestsCreateOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceDecisions { + list(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceDecisionsListOptionalParams): PagedAsyncIterableIterator; } // @public -export type RoleAssignmentScheduleRequestsCreateResponse = RoleAssignmentScheduleRequest; - -// @public -export interface RoleAssignmentScheduleRequestsGetOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceDecisionsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export type RoleAssignmentScheduleRequestsGetResponse = RoleAssignmentScheduleRequest; +export type AccessReviewInstanceDecisionsListNextResponse = AccessReviewDecisionListResult; // @public -export interface RoleAssignmentScheduleRequestsListForScopeNextOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceDecisionsListOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type RoleAssignmentScheduleRequestsListForScopeNextResponse = RoleAssignmentScheduleRequestListResult; +export type AccessReviewInstanceDecisionsListResponse = AccessReviewDecisionListResult; // @public -export interface RoleAssignmentScheduleRequestsListForScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface AccessReviewInstanceListResult { + nextLink?: string; + value?: AccessReviewInstance[]; } // @public -export type RoleAssignmentScheduleRequestsListForScopeResponse = RoleAssignmentScheduleRequestListResult; - -// @public -export interface RoleAssignmentSchedules { - get(scope: string, roleAssignmentScheduleName: string, options?: RoleAssignmentSchedulesGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleAssignmentSchedulesListForScopeOptionalParams): PagedAsyncIterableIterator; +export interface AccessReviewInstanceMyDecisions { + getById(scheduleDefinitionId: string, id: string, decisionId: string, options?: AccessReviewInstanceMyDecisionsGetByIdOptionalParams): Promise; + list(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceMyDecisionsListOptionalParams): PagedAsyncIterableIterator; + patch(scheduleDefinitionId: string, id: string, decisionId: string, properties: AccessReviewDecisionProperties, options?: AccessReviewInstanceMyDecisionsPatchOptionalParams): Promise; } // @public -export interface RoleAssignmentSchedulesGetOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceMyDecisionsGetByIdOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentSchedulesGetResponse = RoleAssignmentSchedule; +export type AccessReviewInstanceMyDecisionsGetByIdResponse = AccessReviewDecision; // @public -export interface RoleAssignmentSchedulesListForScopeNextOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceMyDecisionsListNextOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type RoleAssignmentSchedulesListForScopeNextResponse = RoleAssignmentScheduleListResult; +export type AccessReviewInstanceMyDecisionsListNextResponse = AccessReviewDecisionListResult; // @public -export interface RoleAssignmentSchedulesListForScopeOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceMyDecisionsListOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type RoleAssignmentSchedulesListForScopeResponse = RoleAssignmentScheduleListResult; +export type AccessReviewInstanceMyDecisionsListResponse = AccessReviewDecisionListResult; // @public -export interface RoleAssignmentsCreateByIdOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceMyDecisionsPatchOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsCreateByIdResponse = RoleAssignment; +export type AccessReviewInstanceMyDecisionsPatchResponse = AccessReviewDecision; // @public -export interface RoleAssignmentsCreateOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceOperations { + acceptRecommendations(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceAcceptRecommendationsOptionalParams): Promise; + applyDecisions(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceApplyDecisionsOptionalParams): Promise; + resetDecisions(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceResetDecisionsOptionalParams): Promise; + sendReminders(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceSendRemindersOptionalParams): Promise; + stop(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceStopOptionalParams): Promise; } // @public -export type RoleAssignmentsCreateResponse = RoleAssignment; - -// @public -export interface RoleAssignmentsDeleteByIdOptionalParams extends coreClient.OperationOptions { - tenantId?: string; +export interface AccessReviewInstanceProperties { + backupReviewers?: AccessReviewReviewer[]; + endDateTime?: Date; + reviewers?: AccessReviewReviewer[]; + readonly reviewersType?: AccessReviewInstanceReviewersType; + startDateTime?: Date; + readonly status?: AccessReviewInstanceStatus; } // @public -export type RoleAssignmentsDeleteByIdResponse = RoleAssignment; - -// @public -export interface RoleAssignmentsDeleteOptionalParams extends coreClient.OperationOptions { - tenantId?: string; +export interface AccessReviewInstanceResetDecisionsOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsDeleteResponse = RoleAssignment; +export type AccessReviewInstanceReviewersType = string; // @public -export interface RoleAssignmentsGetByIdOptionalParams extends coreClient.OperationOptions { - tenantId?: string; +export interface AccessReviewInstances { + create(scheduleDefinitionId: string, id: string, properties: AccessReviewInstanceProperties, options?: AccessReviewInstancesCreateOptionalParams): Promise; + getById(scheduleDefinitionId: string, id: string, options?: AccessReviewInstancesGetByIdOptionalParams): Promise; + list(scheduleDefinitionId: string, options?: AccessReviewInstancesListOptionalParams): PagedAsyncIterableIterator; } // @public -export type RoleAssignmentsGetByIdResponse = RoleAssignment; +export interface AccessReviewInstancesAssignedForMyApproval { + getById(scheduleDefinitionId: string, id: string, options?: AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams): Promise; + list(scheduleDefinitionId: string, options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams): PagedAsyncIterableIterator; +} // @public -export interface RoleAssignmentsGetOptionalParams extends coreClient.OperationOptions { - tenantId?: string; +export interface AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsGetResponse = RoleAssignment; +export type AccessReviewInstancesAssignedForMyApprovalGetByIdResponse = AccessReviewInstance; // @public -export interface RoleAssignmentsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams extends coreClient.OperationOptions { filter?: string; - tenantId?: string; } // @public -export type RoleAssignmentsListForResourceGroupNextResponse = RoleAssignmentListResult; +export type AccessReviewInstancesAssignedForMyApprovalListNextResponse = AccessReviewInstanceListResult; // @public -export interface RoleAssignmentsListForResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstancesAssignedForMyApprovalListOptionalParams extends coreClient.OperationOptions { filter?: string; - tenantId?: string; } // @public -export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult; +export type AccessReviewInstancesAssignedForMyApprovalListResponse = AccessReviewInstanceListResult; // @public -export interface RoleAssignmentsListForResourceNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - tenantId?: string; +export interface AccessReviewInstancesCreateOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsListForResourceNextResponse = RoleAssignmentListResult; +export type AccessReviewInstancesCreateResponse = AccessReviewInstance; // @public -export interface RoleAssignmentsListForResourceOptionalParams extends coreClient.OperationOptions { - filter?: string; - tenantId?: string; +export interface AccessReviewInstanceSendRemindersOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult; - -// @public -export interface RoleAssignmentsListForScopeNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - tenantId?: string; +export interface AccessReviewInstancesGetByIdOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult; +export type AccessReviewInstancesGetByIdResponse = AccessReviewInstance; // @public -export interface RoleAssignmentsListForScopeOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstancesListNextOptionalParams extends coreClient.OperationOptions { filter?: string; - tenantId?: string; } // @public -export type RoleAssignmentsListForScopeResponse = RoleAssignmentListResult; +export type AccessReviewInstancesListNextResponse = AccessReviewInstanceListResult; // @public -export interface RoleAssignmentsListForSubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstancesListOptionalParams extends coreClient.OperationOptions { filter?: string; - tenantId?: string; } // @public -export type RoleAssignmentsListForSubscriptionNextResponse = RoleAssignmentListResult; - -// @public -export interface RoleAssignmentsListForSubscriptionOptionalParams extends coreClient.OperationOptions { - filter?: string; - tenantId?: string; -} +export type AccessReviewInstancesListResponse = AccessReviewInstanceListResult; // @public -export type RoleAssignmentsListForSubscriptionResponse = RoleAssignmentListResult; +export type AccessReviewInstanceStatus = string; // @public -export interface RoleAssignmentsValidateByIdOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewInstanceStopOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleAssignmentsValidateByIdResponse = ValidationResponse; +export type AccessReviewRecurrencePatternType = string; // @public -export interface RoleAssignmentsValidateOptionalParams extends coreClient.OperationOptions { -} +export type AccessReviewRecurrenceRangeType = string; // @public -export type RoleAssignmentsValidateResponse = ValidationResponse; +export type AccessReviewResult = string; // @public -export interface RoleEligibilitySchedule { - condition?: string; - conditionVersion?: string; - createdOn?: Date; - endDateTime?: Date; - expandedProperties?: ExpandedProperties; - readonly id?: string; - memberType?: MemberType; - readonly name?: string; +export interface AccessReviewReviewer { principalId?: string; - principalType?: PrincipalType; - roleDefinitionId?: string; - roleEligibilityScheduleRequestId?: string; - scope?: string; - startDateTime?: Date; - status?: Status; - readonly type?: string; - updatedOn?: Date; + readonly principalType?: AccessReviewReviewerType; } // @public -export interface RoleEligibilityScheduleFilter { - principalId?: string; - roleDefinitionId?: string; - status?: string; -} +export type AccessReviewReviewerType = string; // @public -export interface RoleEligibilityScheduleInstance { - condition?: string; - conditionVersion?: string; - createdOn?: Date; - endDateTime?: Date; - expandedProperties?: ExpandedProperties; +export interface AccessReviewScheduleDefinition { + readonly assignmentState?: AccessReviewScopeAssignmentState; + autoApplyDecisionsEnabled?: boolean; + backupReviewers?: AccessReviewReviewer[]; + defaultDecision?: DefaultDecisionType; + defaultDecisionEnabled?: boolean; + descriptionForAdmins?: string; + descriptionForReviewers?: string; + displayName?: string; + endDate?: Date; + expandNestedMemberships?: boolean; readonly id?: string; - memberType?: MemberType; + inactiveDuration?: string; + instanceDurationInDays?: number; + instances?: AccessReviewInstance[]; + interval?: number; + justificationRequiredOnApproval?: boolean; + mailNotificationsEnabled?: boolean; readonly name?: string; - principalId?: string; - principalType?: PrincipalType; - roleDefinitionId?: string; - roleEligibilityScheduleId?: string; - scope?: string; - startDateTime?: Date; - status?: Status; + numberOfOccurrences?: number; + readonly principalId?: string; + readonly principalName?: string; + readonly principalTypePropertiesCreatedByPrincipalType?: AccessReviewActorIdentityType; + readonly principalTypePropertiesScopePrincipalType?: AccessReviewScopePrincipalType; + recommendationLookBackDuration?: string; + recommendationsEnabled?: boolean; + reminderNotificationsEnabled?: boolean; + readonly resourceId?: string; + reviewers?: AccessReviewReviewer[]; + readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; + readonly roleDefinitionId?: string; + startDate?: Date; + readonly status?: AccessReviewScheduleDefinitionStatus; readonly type?: string; + typePropertiesSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; + typePropertiesSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; + readonly userPrincipalName?: string; } // @public -export interface RoleEligibilityScheduleInstanceFilter { - principalId?: string; - roleDefinitionId?: string; - roleEligibilityScheduleId?: string; - status?: string; +export interface AccessReviewScheduleDefinitionListResult { + nextLink?: string; + value?: AccessReviewScheduleDefinition[]; } // @public -export interface RoleEligibilityScheduleInstanceListResult { - nextLink?: string; - value?: RoleEligibilityScheduleInstance[]; +export interface AccessReviewScheduleDefinitionProperties { + readonly assignmentState?: AccessReviewScopeAssignmentState; + autoApplyDecisionsEnabled?: boolean; + backupReviewers?: AccessReviewReviewer[]; + defaultDecision?: DefaultDecisionType; + defaultDecisionEnabled?: boolean; + descriptionForAdmins?: string; + descriptionForReviewers?: string; + displayName?: string; + endDate?: Date; + expandNestedMemberships?: boolean; + inactiveDuration?: string; + instanceDurationInDays?: number; + instances?: AccessReviewInstance[]; + interval?: number; + justificationRequiredOnApproval?: boolean; + mailNotificationsEnabled?: boolean; + numberOfOccurrences?: number; + readonly principalId?: string; + readonly principalName?: string; + readonly principalTypeCreatedByPrincipalType?: AccessReviewActorIdentityType; + readonly principalTypeScopePrincipalType?: AccessReviewScopePrincipalType; + recommendationLookBackDuration?: string; + recommendationsEnabled?: boolean; + reminderNotificationsEnabled?: boolean; + readonly resourceId?: string; + reviewers?: AccessReviewReviewer[]; + readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; + readonly roleDefinitionId?: string; + startDate?: Date; + readonly status?: AccessReviewScheduleDefinitionStatus; + typeSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; + typeSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; + readonly userPrincipalName?: string; } // @public -export interface RoleEligibilityScheduleInstances { - get(scope: string, roleEligibilityScheduleInstanceName: string, options?: RoleEligibilityScheduleInstancesGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams): PagedAsyncIterableIterator; -} +export type AccessReviewScheduleDefinitionReviewersType = string; // @public -export interface RoleEligibilityScheduleInstancesGetOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewScheduleDefinitions { + createOrUpdateById(scheduleDefinitionId: string, properties: AccessReviewScheduleDefinitionProperties, options?: AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams): Promise; + deleteById(scheduleDefinitionId: string, options?: AccessReviewScheduleDefinitionsDeleteByIdOptionalParams): Promise; + getById(scheduleDefinitionId: string, options?: AccessReviewScheduleDefinitionsGetByIdOptionalParams): Promise; + list(options?: AccessReviewScheduleDefinitionsListOptionalParams): PagedAsyncIterableIterator; + stop(scheduleDefinitionId: string, options?: AccessReviewScheduleDefinitionsStopOptionalParams): Promise; } // @public -export type RoleEligibilityScheduleInstancesGetResponse = RoleEligibilityScheduleInstance; +export interface AccessReviewScheduleDefinitionsAssignedForMyApproval { + list(options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams): PagedAsyncIterableIterator; +} // @public -export interface RoleEligibilityScheduleInstancesListForScopeNextOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type RoleEligibilityScheduleInstancesListForScopeNextResponse = RoleEligibilityScheduleInstanceListResult; +export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse = AccessReviewScheduleDefinitionListResult; // @public -export interface RoleEligibilityScheduleInstancesListForScopeOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type RoleEligibilityScheduleInstancesListForScopeResponse = RoleEligibilityScheduleInstanceListResult; +export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListResponse = AccessReviewScheduleDefinitionListResult; // @public -export interface RoleEligibilityScheduleListResult { - nextLink?: string; - value?: RoleEligibilitySchedule[]; +export interface AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleEligibilityScheduleRequest { - readonly approvalId?: string; - condition?: string; - conditionVersion?: string; - readonly createdOn?: Date; - readonly expandedProperties?: ExpandedProperties; - readonly id?: string; - justification?: string; - readonly name?: string; - principalId?: string; - readonly principalType?: PrincipalType; - readonly requestorId?: string; - requestType?: RequestType; - roleDefinitionId?: string; - scheduleInfo?: RoleEligibilityScheduleRequestPropertiesScheduleInfo; - readonly scope?: string; - readonly status?: Status; - targetRoleEligibilityScheduleId?: string; - targetRoleEligibilityScheduleInstanceId?: string; - ticketInfo?: RoleEligibilityScheduleRequestPropertiesTicketInfo; - readonly type?: string; -} +export type AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse = AccessReviewScheduleDefinition; // @public -export interface RoleEligibilityScheduleRequestFilter { - principalId?: string; - requestorId?: string; - roleDefinitionId?: string; - status?: string; +export interface AccessReviewScheduleDefinitionsDeleteByIdOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleEligibilityScheduleRequestListResult { - nextLink?: string; - value?: RoleEligibilityScheduleRequest[]; +export interface AccessReviewScheduleDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions { } // @public -export interface RoleEligibilityScheduleRequestPropertiesScheduleInfo { - expiration?: RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; - startDateTime?: Date; -} +export type AccessReviewScheduleDefinitionsGetByIdResponse = AccessReviewScheduleDefinition; // @public -export interface RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration { - duration?: string; - endDateTime?: Date; - type?: Type; +export interface AccessReviewScheduleDefinitionsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface RoleEligibilityScheduleRequestPropertiesTicketInfo { - ticketNumber?: string; - ticketSystem?: string; -} +export type AccessReviewScheduleDefinitionsListNextResponse = AccessReviewScheduleDefinitionListResult; // @public -export interface RoleEligibilityScheduleRequests { - cancel(scope: string, roleEligibilityScheduleRequestName: string, options?: RoleEligibilityScheduleRequestsCancelOptionalParams): Promise; - create(scope: string, roleEligibilityScheduleRequestName: string, parameters: RoleEligibilityScheduleRequest, options?: RoleEligibilityScheduleRequestsCreateOptionalParams): Promise; - get(scope: string, roleEligibilityScheduleRequestName: string, options?: RoleEligibilityScheduleRequestsGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams): PagedAsyncIterableIterator; +export interface AccessReviewScheduleDefinitionsListOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface RoleEligibilityScheduleRequestsCancelOptionalParams extends coreClient.OperationOptions { -} +export type AccessReviewScheduleDefinitionsListResponse = AccessReviewScheduleDefinitionListResult; // @public -export interface RoleEligibilityScheduleRequestsCreateOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewScheduleDefinitionsStopOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleEligibilityScheduleRequestsCreateResponse = RoleEligibilityScheduleRequest; +export type AccessReviewScheduleDefinitionStatus = string; // @public -export interface RoleEligibilityScheduleRequestsGetOptionalParams extends coreClient.OperationOptions { +export interface AccessReviewScheduleSettings { + autoApplyDecisionsEnabled?: boolean; + defaultDecision?: DefaultDecisionType; + defaultDecisionEnabled?: boolean; + endDate?: Date; + instanceDurationInDays?: number; + interval?: number; + justificationRequiredOnApproval?: boolean; + mailNotificationsEnabled?: boolean; + numberOfOccurrences?: number; + recommendationLookBackDuration?: string; + recommendationsEnabled?: boolean; + reminderNotificationsEnabled?: boolean; + startDate?: Date; + typeRecurrencePatternType?: AccessReviewRecurrencePatternType; + typeRecurrenceRangeType?: AccessReviewRecurrenceRangeType; } // @public -export type RoleEligibilityScheduleRequestsGetResponse = RoleEligibilityScheduleRequest; - -// @public -export interface RoleEligibilityScheduleRequestsListForScopeNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface AccessReviewScope { + readonly assignmentState?: AccessReviewScopeAssignmentState; + expandNestedMemberships?: boolean; + inactiveDuration?: string; + readonly principalType?: AccessReviewScopePrincipalType; + readonly resourceId?: string; + readonly roleDefinitionId?: string; } // @public -export type RoleEligibilityScheduleRequestsListForScopeNextResponse = RoleEligibilityScheduleRequestListResult; - -// @public -export interface RoleEligibilityScheduleRequestsListForScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; -} +export type AccessReviewScopeAssignmentState = string; // @public -export type RoleEligibilityScheduleRequestsListForScopeResponse = RoleEligibilityScheduleRequestListResult; +export type AccessReviewScopePrincipalType = string; -// @public -export interface RoleEligibilitySchedules { - get(scope: string, roleEligibilityScheduleName: string, options?: RoleEligibilitySchedulesGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleEligibilitySchedulesListForScopeOptionalParams): PagedAsyncIterableIterator; +// @public (undocumented) +export class AuthorizationManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AuthorizationManagementClientOptionalParams); + // (undocumented) + accessReviewDefaultSettingsOperations: AccessReviewDefaultSettingsOperations; + // (undocumented) + accessReviewHistoryDefinitionInstance: AccessReviewHistoryDefinitionInstance; + // (undocumented) + accessReviewHistoryDefinitionInstances: AccessReviewHistoryDefinitionInstances; + // (undocumented) + accessReviewHistoryDefinitionOperations: AccessReviewHistoryDefinitionOperations; + // (undocumented) + accessReviewHistoryDefinitions: AccessReviewHistoryDefinitions; + // (undocumented) + accessReviewInstanceContactedReviewers: AccessReviewInstanceContactedReviewers; + // (undocumented) + accessReviewInstanceDecisions: AccessReviewInstanceDecisions; + // (undocumented) + accessReviewInstanceMyDecisions: AccessReviewInstanceMyDecisions; + // (undocumented) + accessReviewInstanceOperations: AccessReviewInstanceOperations; + // (undocumented) + accessReviewInstances: AccessReviewInstances; + // (undocumented) + accessReviewInstancesAssignedForMyApproval: AccessReviewInstancesAssignedForMyApproval; + // (undocumented) + accessReviewScheduleDefinitions: AccessReviewScheduleDefinitions; + // (undocumented) + accessReviewScheduleDefinitionsAssignedForMyApproval: AccessReviewScheduleDefinitionsAssignedForMyApproval; + // (undocumented) + apiVersion: string; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; + // (undocumented) + tenantLevelAccessReviewInstanceContactedReviewers: TenantLevelAccessReviewInstanceContactedReviewers; } // @public -export interface RoleEligibilitySchedulesGetOptionalParams extends coreClient.OperationOptions { +export interface AuthorizationManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; } // @public -export type RoleEligibilitySchedulesGetResponse = RoleEligibilitySchedule; +export type DecisionResourceType = string; // @public -export interface RoleEligibilitySchedulesListForScopeNextOptionalParams extends coreClient.OperationOptions { - filter?: string; -} +export type DecisionTargetType = string; // @public -export type RoleEligibilitySchedulesListForScopeNextResponse = RoleEligibilityScheduleListResult; +export type DefaultDecisionType = string; // @public -export interface RoleEligibilitySchedulesListForScopeOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface ErrorDefinition { + error?: ErrorDefinitionProperties; } // @public -export type RoleEligibilitySchedulesListForScopeResponse = RoleEligibilityScheduleListResult; - -// @public -export interface RoleManagementPolicies { - delete(scope: string, roleManagementPolicyName: string, options?: RoleManagementPoliciesDeleteOptionalParams): Promise; - get(scope: string, roleManagementPolicyName: string, options?: RoleManagementPoliciesGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleManagementPoliciesListForScopeOptionalParams): PagedAsyncIterableIterator; - update(scope: string, roleManagementPolicyName: string, parameters: RoleManagementPolicy, options?: RoleManagementPoliciesUpdateOptionalParams): Promise; +export interface ErrorDefinitionProperties { + code?: string; + readonly message?: string; } // @public -export interface RoleManagementPoliciesDeleteOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessRecommendationType { + // (undocumented) + Approve = "Approve", + // (undocumented) + Deny = "Deny", + // (undocumented) + NoInfoAvailable = "NoInfoAvailable" } // @public -export interface RoleManagementPoliciesGetOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewActorIdentityType { + // (undocumented) + ServicePrincipal = "servicePrincipal", + // (undocumented) + User = "user" } // @public -export type RoleManagementPoliciesGetResponse = RoleManagementPolicy; - -// @public -export interface RoleManagementPoliciesListForScopeNextOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewApplyResult { + // (undocumented) + AppliedSuccessfully = "AppliedSuccessfully", + // (undocumented) + AppliedSuccessfullyButObjectNotFound = "AppliedSuccessfullyButObjectNotFound", + // (undocumented) + AppliedWithUnknownFailure = "AppliedWithUnknownFailure", + // (undocumented) + Applying = "Applying", + // (undocumented) + ApplyNotSupported = "ApplyNotSupported", + // (undocumented) + New = "New" } // @public -export type RoleManagementPoliciesListForScopeNextResponse = RoleManagementPolicyListResult; - -// @public -export interface RoleManagementPoliciesListForScopeOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewHistoryDefinitionStatus { + // (undocumented) + Done = "Done", + // (undocumented) + Error = "Error", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + Requested = "Requested" } // @public -export type RoleManagementPoliciesListForScopeResponse = RoleManagementPolicyListResult; - -// @public -export interface RoleManagementPoliciesUpdateOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewInstanceReviewersType { + // (undocumented) + Assigned = "Assigned", + // (undocumented) + Managers = "Managers", + // (undocumented) + Self = "Self" } // @public -export type RoleManagementPoliciesUpdateResponse = RoleManagementPolicy; - -// @public -export interface RoleManagementPolicy { - description?: string; - displayName?: string; - readonly effectiveRules?: RoleManagementPolicyRuleUnion[]; - readonly id?: string; - isOrganizationDefault?: boolean; - readonly lastModifiedBy?: Principal; - readonly lastModifiedDateTime?: Date; - readonly name?: string; - readonly policyProperties?: PolicyProperties; - rules?: RoleManagementPolicyRuleUnion[]; - scope?: string; - readonly type?: string; +export enum KnownAccessReviewInstanceStatus { + // (undocumented) + Applied = "Applied", + // (undocumented) + Applying = "Applying", + // (undocumented) + AutoReviewed = "AutoReviewed", + // (undocumented) + AutoReviewing = "AutoReviewing", + // (undocumented) + Completed = "Completed", + // (undocumented) + Completing = "Completing", + // (undocumented) + Initializing = "Initializing", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + NotStarted = "NotStarted", + // (undocumented) + Scheduled = "Scheduled", + // (undocumented) + Starting = "Starting" } // @public -export type RoleManagementPolicyApprovalRule = RoleManagementPolicyRule & { - ruleType: "RoleManagementPolicyApprovalRule"; - setting?: ApprovalSettings; -}; - -// @public -export interface RoleManagementPolicyAssignment { - readonly id?: string; - readonly name?: string; - readonly policyAssignmentProperties?: PolicyAssignmentProperties; - policyId?: string; - roleDefinitionId?: string; - scope?: string; - readonly type?: string; +export enum KnownAccessReviewRecurrencePatternType { + // (undocumented) + AbsoluteMonthly = "absoluteMonthly", + // (undocumented) + Weekly = "weekly" } // @public -export interface RoleManagementPolicyAssignmentListResult { - nextLink?: string; - value?: RoleManagementPolicyAssignment[]; +export enum KnownAccessReviewRecurrenceRangeType { + // (undocumented) + EndDate = "endDate", + // (undocumented) + NoEnd = "noEnd", + // (undocumented) + Numbered = "numbered" } // @public -export interface RoleManagementPolicyAssignments { - create(scope: string, roleManagementPolicyAssignmentName: string, parameters: RoleManagementPolicyAssignment, options?: RoleManagementPolicyAssignmentsCreateOptionalParams): Promise; - delete(scope: string, roleManagementPolicyAssignmentName: string, options?: RoleManagementPolicyAssignmentsDeleteOptionalParams): Promise; - get(scope: string, roleManagementPolicyAssignmentName: string, options?: RoleManagementPolicyAssignmentsGetOptionalParams): Promise; - listForScope(scope: string, options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams): PagedAsyncIterableIterator; +export enum KnownAccessReviewResult { + // (undocumented) + Approve = "Approve", + // (undocumented) + Deny = "Deny", + // (undocumented) + DontKnow = "DontKnow", + // (undocumented) + NotNotified = "NotNotified", + // (undocumented) + NotReviewed = "NotReviewed" } // @public -export interface RoleManagementPolicyAssignmentsCreateOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewReviewerType { + // (undocumented) + ServicePrincipal = "servicePrincipal", + // (undocumented) + User = "user" } // @public -export type RoleManagementPolicyAssignmentsCreateResponse = RoleManagementPolicyAssignment; - -// @public -export interface RoleManagementPolicyAssignmentsDeleteOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewScheduleDefinitionReviewersType { + // (undocumented) + Assigned = "Assigned", + // (undocumented) + Managers = "Managers", + // (undocumented) + Self = "Self" } // @public -export interface RoleManagementPolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewScheduleDefinitionStatus { + // (undocumented) + Applied = "Applied", + // (undocumented) + Applying = "Applying", + // (undocumented) + AutoReviewed = "AutoReviewed", + // (undocumented) + AutoReviewing = "AutoReviewing", + // (undocumented) + Completed = "Completed", + // (undocumented) + Completing = "Completing", + // (undocumented) + Initializing = "Initializing", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + NotStarted = "NotStarted", + // (undocumented) + Scheduled = "Scheduled", + // (undocumented) + Starting = "Starting" } // @public -export type RoleManagementPolicyAssignmentsGetResponse = RoleManagementPolicyAssignment; - -// @public -export interface RoleManagementPolicyAssignmentsListForScopeNextOptionalParams extends coreClient.OperationOptions { +export enum KnownAccessReviewScopeAssignmentState { + // (undocumented) + Active = "active", + // (undocumented) + Eligible = "eligible" } // @public -export type RoleManagementPolicyAssignmentsListForScopeNextResponse = RoleManagementPolicyAssignmentListResult; +export enum KnownAccessReviewScopePrincipalType { + // (undocumented) + GuestUser = "guestUser", + // (undocumented) + RedeemedGuestUser = "redeemedGuestUser", + // (undocumented) + ServicePrincipal = "servicePrincipal", + // (undocumented) + User = "user", + // (undocumented) + UserGroup = "user,group" +} // @public -export interface RoleManagementPolicyAssignmentsListForScopeOptionalParams extends coreClient.OperationOptions { +export enum KnownDecisionResourceType { + // (undocumented) + AzureRole = "azureRole" } // @public -export type RoleManagementPolicyAssignmentsListForScopeResponse = RoleManagementPolicyAssignmentListResult; +export enum KnownDecisionTargetType { + // (undocumented) + ServicePrincipal = "servicePrincipal", + // (undocumented) + User = "user" +} // @public -export type RoleManagementPolicyAuthenticationContextRule = RoleManagementPolicyRule & { - ruleType: "RoleManagementPolicyAuthenticationContextRule"; - isEnabled?: boolean; - claimValue?: string; -}; +export enum KnownDefaultDecisionType { + // (undocumented) + Approve = "Approve", + // (undocumented) + Deny = "Deny", + // (undocumented) + Recommendation = "Recommendation" +} // @public -export type RoleManagementPolicyEnablementRule = RoleManagementPolicyRule & { - ruleType: "RoleManagementPolicyEnablementRule"; - enabledRules?: EnablementRules[]; -}; +export interface Operation { + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: string; +} // @public -export type RoleManagementPolicyExpirationRule = RoleManagementPolicyRule & { - ruleType: "RoleManagementPolicyExpirationRule"; - isExpirationRequired?: boolean; - maximumDuration?: string; -}; +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} // @public -export interface RoleManagementPolicyListResult { +export interface OperationListResult { nextLink?: string; - value?: RoleManagementPolicy[]; + value?: Operation[]; } // @public -export type RoleManagementPolicyNotificationRule = RoleManagementPolicyRule & { - ruleType: "RoleManagementPolicyNotificationRule"; - notificationType?: NotificationDeliveryMechanism; - notificationLevel?: NotificationLevel; - recipientType?: RecipientType; - notificationRecipients?: string[]; - isDefaultRecipientsEnabled?: boolean; -}; - -// @public -export interface RoleManagementPolicyRule { - id?: string; - ruleType: "RoleManagementPolicyApprovalRule" | "RoleManagementPolicyAuthenticationContextRule" | "RoleManagementPolicyEnablementRule" | "RoleManagementPolicyExpirationRule" | "RoleManagementPolicyNotificationRule"; - target?: RoleManagementPolicyRuleTarget; +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } // @public -export interface RoleManagementPolicyRuleTarget { - caller?: string; - enforcedSettings?: string[]; - inheritableSettings?: string[]; - level?: string; - operations?: string[]; - targetObjects?: string[]; +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { } // @public -export type RoleManagementPolicyRuleType = string; - -// @public (undocumented) -export type RoleManagementPolicyRuleUnion = RoleManagementPolicyRule | RoleManagementPolicyApprovalRule | RoleManagementPolicyAuthenticationContextRule | RoleManagementPolicyEnablementRule | RoleManagementPolicyExpirationRule | RoleManagementPolicyNotificationRule; +export type OperationsListNextResponse = OperationListResult; // @public -export type Status = string; +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} // @public -export type Type = string; +export type OperationsListResponse = OperationListResult; // @public -export interface UserSet { - description?: string; - id?: string; - isBackup?: boolean; - userType?: UserType; +export interface TenantLevelAccessReviewInstanceContactedReviewers { + list(scheduleDefinitionId: string, id: string, options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams): PagedAsyncIterableIterator; } // @public -export type UserType = string; +export interface TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams extends coreClient.OperationOptions { +} // @public -export interface ValidationResponse { - errorInfo?: ValidationResponseErrorInfo; - readonly isValid?: boolean; -} +export type TenantLevelAccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; // @public -export interface ValidationResponseErrorInfo { - readonly code?: string; - readonly message?: string; +export interface TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams extends coreClient.OperationOptions { } +// @public +export type TenantLevelAccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; // (No @packageDocumentation comment for this package) diff --git a/sdk/authorization/arm-authorization/rollup.config.js b/sdk/authorization/arm-authorization/rollup.config.js index 9be1955eb7f1..3f89d7309da5 100644 --- a/sdk/authorization/arm-authorization/rollup.config.js +++ b/sdk/authorization/arm-authorization/rollup.config.js @@ -14,62 +14,14 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; -/** - * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. - * - * NOTE: this manual configuration is only needed because OpenTelemetry uses an - * __exportStar downleveled helper function to declare its exports which confuses - * rollup's automatic discovery mechanism. - * - * @returns an object reference that can be `...`'d into your cjs() configuration. - */ -export function openTelemetryCommonJs() { - const namedExports = {}; - - for (const key of [ - "@opentelemetry/api", - "@azure/core-tracing/node_modules/@opentelemetry/api" - ]) { - namedExports[key] = [ - "SpanKind", - "TraceFlags", - "getSpan", - "setSpan", - "SpanStatusCode", - "getSpanContext", - "setSpanContext" - ]; - } - - const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; - - for (const version of releasedOpenTelemetryVersions) { - namedExports[ - // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. - `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` - ] = [ - "SpanKind", - "TraceFlags", - "getSpan", - "setSpan", - "StatusCode", - "CanonicalCode", - "getSpanContext", - "setSpanContext" - ]; - } - - return namedExports; -} - // #region Warning Handler /** - * A function that can determine whether a rollupwarning should be ignored. If + * A function that can determine whether a rollup warning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEvalWarnings(warning) { +function ignoreNiseSinonEval(warning) { return ( warning.code === "EVAL" && warning.id && @@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) { ); } -function ignoreChaiCircularDependencyWarnings(warning) { +function ignoreChaiCircularDependency(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ - ignoreChaiCircularDependencyWarnings, - ignoreNiseSinonEvalWarnings -]; +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** * Construct a warning handler for the shared rollup configuration @@ -122,22 +71,7 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs({ - namedExports: { - // Chai's strange internal architecture makes it impossible to statically - // analyze its exports. - chai: [ - "version", - "use", - "util", - "config", - "expect", - "should", - "assert" - ], - ...openTelemetryCommonJs() - } - }), + cjs(), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -173,7 +107,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve(), cjs()] + plugins: [sourcemaps(), nodeResolve()] }; const config = [baseConfig]; diff --git a/sdk/authorization/arm-authorization/sample.env b/sdk/authorization/arm-authorization/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/authorization/arm-authorization/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts new file mode 100644 index 000000000000..a0b0a43a56de --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json + */ +async function getAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.get(); + console.log(result); +} + +getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts new file mode 100644 index 000000000000..50cedccdcf86 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleSettings, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json + */ +async function putAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewScheduleSettings = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.put( + properties + ); + console.log(result); +} + +putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts new file mode 100644 index 000000000000..e39c7cb0970e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewHistoryDefinitionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition + * + * @summary Create a scheduled or one-time Access Review History Definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json + */ +async function putAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const properties: AccessReviewHistoryDefinitionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.create( + historyDefinitionId, + properties + ); + console.log(result); +} + +putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts new file mode 100644 index 000000000000..69fa585d77b7 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an access review history definition + * + * @summary Delete an access review history definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.deleteById( + historyDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts new file mode 100644 index 000000000000..cc30aaaef9c2 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * + * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ +async function postAccessReviewHistoryDefinitionInstance() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( + historyDefinitionId, + instanceId + ); + console.log(result); +} + +postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts new file mode 100644 index 000000000000..f58b44160d78 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review history definition instances by definition Id + * + * @summary Get access review history definition instances by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ +async function getAccessReviewHistoryDefinitionInstances() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitionInstances.list( + historyDefinitionId + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts new file mode 100644 index 000000000000..b3ac5f469101 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review history definition by definition Id + * + * @summary Get access review history definition by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json + */ +async function getAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitions.getById( + historyDefinitionId + ); + console.log(result); +} + +getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts new file mode 100644 index 000000000000..de8ee5a79dbe --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * + * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json + */ +async function getAccessReviewHistoryDefinitions() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts new file mode 100644 index 000000000000..e881a9757421 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. + * + * @summary An action to accept recommendations for decision in an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ +async function accessReviewInstanceAcceptRecommmendations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.acceptRecommendations( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts new file mode 100644 index 000000000000..8ee8addf9757 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to apply all decisions for an access review instance. + * + * @summary An action to apply all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json + */ +async function accessReviewInstanceApplyDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.applyDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts new file mode 100644 index 000000000000..f5545dce25cb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ +async function getAccessReviewInstanceContactedReviewers() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts new file mode 100644 index 000000000000..d308e1577a91 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance decisions + * + * @summary Get access review instance decisions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json + */ +async function getAccessReviewInstanceDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceDecisions.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts new file mode 100644 index 000000000000..098083ac906b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get my single access review instance decision. + * + * @summary Get my single access review instance decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ +async function getAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.getById( + scheduleDefinitionId, + id, + decisionId + ); + console.log(result); +} + +getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts new file mode 100644 index 000000000000..b1e50fddef13 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get my access review instance decisions. + * + * @summary Get my access review instance decisions. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ +async function getAccessReviewMyInstanceDecisions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceMyDecisions.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts new file mode 100644 index 000000000000..de192912a02f --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewDecisionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Record a decision. + * + * @summary Record a decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ +async function patchAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewDecisionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.patch( + scheduleDefinitionId, + id, + decisionId, + properties + ); + console.log(result); +} + +patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts new file mode 100644 index 000000000000..4e3d76961b8d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to reset all decisions for an access review instance. + * + * @summary An action to reset all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json + */ +async function accessReviewInstanceResetDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.resetDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts new file mode 100644 index 000000000000..11ddd932ee2d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to send reminders for an access review instance. + * + * @summary An action to send reminders for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json + */ +async function accessReviewInstanceSendReminders() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.sendReminders( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts new file mode 100644 index 000000000000..815e5afc5b27 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to stop an access review instance. + * + * @summary An action to stop an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json + */ +async function accessReviewInstanceStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.stop( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts new file mode 100644 index 000000000000..471034e44cfd --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get single access review instance assigned for my approval. + * + * @summary Get single access review instance assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ +async function getAccessReviewInstanceAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstancesAssignedForMyApproval.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts new file mode 100644 index 000000000000..c4e9d9a65597 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewInstancesAssignedForMyApprovalListOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ +async function getAccessReviewInstancesAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const filter = "assignedToMeToReview()"; + const options: AccessReviewInstancesAssignedForMyApprovalListOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( + scheduleDefinitionId, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts new file mode 100644 index 000000000000..87d00acf9361 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewInstanceProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update access review instance. + * + * @summary Update access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json + */ +async function putAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const properties: AccessReviewInstanceProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.create( + scheduleDefinitionId, + id, + properties + ); + console.log(result); +} + +putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts new file mode 100644 index 000000000000..6ccfa758845e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json + */ +async function getAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts new file mode 100644 index 000000000000..5b8b8fb65158 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json + */ +async function getAccessReviewInstances() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstances.list( + scheduleDefinitionId + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts new file mode 100644 index 000000000000..30af9e3d7312 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ +async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const filter = "assignedToMeToReview()"; + const options: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts new file mode 100644 index 000000000000..d6be116ded62 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleDefinitionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or Update access review schedule definition. + * + * @summary Create or Update access review schedule definition. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json + */ +async function putAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewScheduleDefinitionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( + scheduleDefinitionId, + properties + ); + console.log(result); +} + +putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts new file mode 100644 index 000000000000..3b8be5f31b06 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete access review schedule definition + * + * @summary Delete access review schedule definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.deleteById( + scheduleDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts new file mode 100644 index 000000000000..d6fd1ca463af --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get single access review definition + * + * @summary Get single access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json + */ +async function getAccessReviewScheduleDefinition() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.getById( + scheduleDefinitionId + ); + console.log(result); +} + +getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts new file mode 100644 index 000000000000..c65d11e35ed1 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review schedule definitions + * + * @summary Get access review schedule definitions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json + */ +async function getAccessReviewScheduleDefinitions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts new file mode 100644 index 000000000000..a0c6c4c55e32 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop access review definition + * + * @summary Stop access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json + */ +async function accessReviewScheduleDefinitionStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.stop( + scheduleDefinitionId + ); + console.log(result); +} + +accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts new file mode 100644 index 000000000000..208201a4fc3c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ +async function tenantLevelGetAccessReviewInstanceContactedReviewers() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/README.md b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/README.md new file mode 100644 index 000000000000..44c517ae5790 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/README.md @@ -0,0 +1,108 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessReviewDefaultSettingsGetSample.js][accessreviewdefaultsettingsgetsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json | +| [accessReviewDefaultSettingsPutSample.js][accessreviewdefaultsettingsputsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json | +| [accessReviewHistoryDefinitionCreateSample.js][accessreviewhistorydefinitioncreatesample] | Create a scheduled or one-time Access Review History Definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionDeleteByIdSample.js][accessreviewhistorydefinitiondeletebyidsample] | Delete an access review history definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js][accessreviewhistorydefinitioninstancegeneratedownloadurisample] | Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json | +| [accessReviewHistoryDefinitionInstancesListSample.js][accessreviewhistorydefinitioninstanceslistsample] | Get access review history definition instances by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json | +| [accessReviewHistoryDefinitionsGetByIdSample.js][accessreviewhistorydefinitionsgetbyidsample] | Get access review history definition by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionsListSample.js][accessreviewhistorydefinitionslistsample] | Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json | +| [accessReviewInstanceAcceptRecommendationsSample.js][accessreviewinstanceacceptrecommendationssample] | An action to accept recommendations for decision in an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json | +| [accessReviewInstanceApplyDecisionsSample.js][accessreviewinstanceapplydecisionssample] | An action to apply all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json | +| [accessReviewInstanceContactedReviewersListSample.js][accessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json | +| [accessReviewInstanceDecisionsListSample.js][accessreviewinstancedecisionslistsample] | Get access review instance decisions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json | +| [accessReviewInstanceMyDecisionsGetByIdSample.js][accessreviewinstancemydecisionsgetbyidsample] | Get my single access review instance decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceMyDecisionsListSample.js][accessreviewinstancemydecisionslistsample] | Get my access review instance decisions. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json | +| [accessReviewInstanceMyDecisionsPatchSample.js][accessreviewinstancemydecisionspatchsample] | Record a decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceResetDecisionsSample.js][accessreviewinstanceresetdecisionssample] | An action to reset all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json | +| [accessReviewInstanceSendRemindersSample.js][accessreviewinstancesendreminderssample] | An action to send reminders for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json | +| [accessReviewInstanceStopSample.js][accessreviewinstancestopsample] | An action to stop an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json | +| [accessReviewInstancesAssignedForMyApprovalGetByIdSample.js][accessreviewinstancesassignedformyapprovalgetbyidsample] | Get single access review instance assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json | +| [accessReviewInstancesAssignedForMyApprovalListSample.js][accessreviewinstancesassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json | +| [accessReviewInstancesCreateSample.js][accessreviewinstancescreatesample] | Update access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json | +| [accessReviewInstancesGetByIdSample.js][accessreviewinstancesgetbyidsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json | +| [accessReviewInstancesListSample.js][accessreviewinstanceslistsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json | +| [accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js][accessreviewscheduledefinitionsassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json | +| [accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js][accessreviewscheduledefinitionscreateorupdatebyidsample] | Create or Update access review schedule definition. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsDeleteByIdSample.js][accessreviewscheduledefinitionsdeletebyidsample] | Delete access review schedule definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsGetByIdSample.js][accessreviewscheduledefinitionsgetbyidsample] | Get single access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsListSample.js][accessreviewscheduledefinitionslistsample] | Get access review schedule definitions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json | +| [accessReviewScheduleDefinitionsStopSample.js][accessreviewscheduledefinitionsstopsample] | Stop access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json | +| [tenantLevelAccessReviewInstanceContactedReviewersListSample.js][tenantlevelaccessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node accessReviewDefaultSettingsGetSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node accessReviewDefaultSettingsGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accessreviewdefaultsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsGetSample.js +[accessreviewdefaultsettingsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsPutSample.js +[accessreviewhistorydefinitioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionCreateSample.js +[accessreviewhistorydefinitiondeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js +[accessreviewhistorydefinitioninstancegeneratedownloadurisample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js +[accessreviewhistorydefinitioninstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstancesListSample.js +[accessreviewhistorydefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsGetByIdSample.js +[accessreviewhistorydefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsListSample.js +[accessreviewinstanceacceptrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceAcceptRecommendationsSample.js +[accessreviewinstanceapplydecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceApplyDecisionsSample.js +[accessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceContactedReviewersListSample.js +[accessreviewinstancedecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceDecisionsListSample.js +[accessreviewinstancemydecisionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js +[accessreviewinstancemydecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsListSample.js +[accessreviewinstancemydecisionspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsPatchSample.js +[accessreviewinstanceresetdecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceResetDecisionsSample.js +[accessreviewinstancesendreminderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceSendRemindersSample.js +[accessreviewinstancestopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceStopSample.js +[accessreviewinstancesassignedformyapprovalgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js +[accessreviewinstancesassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js +[accessreviewinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesCreateSample.js +[accessreviewinstancesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesGetByIdSample.js +[accessreviewinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesListSample.js +[accessreviewscheduledefinitionsassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js +[accessreviewscheduledefinitionscreateorupdatebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js +[accessreviewscheduledefinitionsdeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js +[accessreviewscheduledefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsGetByIdSample.js +[accessreviewscheduledefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsListSample.js +[accessreviewscheduledefinitionsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsStopSample.js +[tenantlevelaccessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization/README.md diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsGetSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsGetSample.js new file mode 100644 index 000000000000..437e973b5245 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsGetSample.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json + */ +async function getAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.get(); + console.log(result); +} + +getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsPutSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsPutSample.js new file mode 100644 index 000000000000..328137663068 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewDefaultSettingsPutSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json + */ +async function putAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.put(properties); + console.log(result); +} + +putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionCreateSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionCreateSample.js new file mode 100644 index 000000000000..47d0945a787a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionCreateSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition + * + * @summary Create a scheduled or one-time Access Review History Definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json + */ +async function putAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.create( + historyDefinitionId, + properties + ); + console.log(result); +} + +putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js new file mode 100644 index 000000000000..31d7f1d9def4 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete an access review history definition + * + * @summary Delete an access review history definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.deleteById( + historyDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js new file mode 100644 index 000000000000..99428ccf9484 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * + * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ +async function postAccessReviewHistoryDefinitionInstance() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( + historyDefinitionId, + instanceId + ); + console.log(result); +} + +postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstancesListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstancesListSample.js new file mode 100644 index 000000000000..afa7f63bc40d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionInstancesListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review history definition instances by definition Id + * + * @summary Get access review history definition instances by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ +async function getAccessReviewHistoryDefinitionInstances() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitionInstances.list(historyDefinitionId)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsGetByIdSample.js new file mode 100644 index 000000000000..24c05ee9365a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsGetByIdSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review history definition by definition Id + * + * @summary Get access review history definition by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json + */ +async function getAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitions.getById(historyDefinitionId); + console.log(result); +} + +getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsListSample.js new file mode 100644 index 000000000000..cfd1cff632f0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewHistoryDefinitionsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * + * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json + */ +async function getAccessReviewHistoryDefinitions() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceAcceptRecommendationsSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceAcceptRecommendationsSample.js new file mode 100644 index 000000000000..40fe2002873d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceAcceptRecommendationsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. + * + * @summary An action to accept recommendations for decision in an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ +async function accessReviewInstanceAcceptRecommmendations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.acceptRecommendations( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceApplyDecisionsSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceApplyDecisionsSample.js new file mode 100644 index 000000000000..a65e5f50a74c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceApplyDecisionsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to apply all decisions for an access review instance. + * + * @summary An action to apply all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json + */ +async function accessReviewInstanceApplyDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.applyDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceContactedReviewersListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceContactedReviewersListSample.js new file mode 100644 index 000000000000..cb4bac464e66 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceContactedReviewersListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ +async function getAccessReviewInstanceContactedReviewers() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceDecisionsListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceDecisionsListSample.js new file mode 100644 index 000000000000..b06023f255eb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceDecisionsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instance decisions + * + * @summary Get access review instance decisions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json + */ +async function getAccessReviewInstanceDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceDecisions.list(scheduleDefinitionId, id)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js new file mode 100644 index 000000000000..9ff10fba3052 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get my single access review instance decision. + * + * @summary Get my single access review instance decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ +async function getAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.getById( + scheduleDefinitionId, + id, + decisionId + ); + console.log(result); +} + +getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsListSample.js new file mode 100644 index 000000000000..0fa6e02855cc --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get my access review instance decisions. + * + * @summary Get my access review instance decisions. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ +async function getAccessReviewMyInstanceDecisions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceMyDecisions.list(scheduleDefinitionId, id)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsPatchSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsPatchSample.js new file mode 100644 index 000000000000..892803d312f3 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceMyDecisionsPatchSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Record a decision. + * + * @summary Record a decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ +async function patchAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.patch( + scheduleDefinitionId, + id, + decisionId, + properties + ); + console.log(result); +} + +patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceResetDecisionsSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceResetDecisionsSample.js new file mode 100644 index 000000000000..bb479705e39d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceResetDecisionsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to reset all decisions for an access review instance. + * + * @summary An action to reset all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json + */ +async function accessReviewInstanceResetDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.resetDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceSendRemindersSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceSendRemindersSample.js new file mode 100644 index 000000000000..9322ea16133e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceSendRemindersSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to send reminders for an access review instance. + * + * @summary An action to send reminders for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json + */ +async function accessReviewInstanceSendReminders() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.sendReminders( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceStopSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceStopSample.js new file mode 100644 index 000000000000..d4f7e2f2de99 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstanceStopSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to stop an access review instance. + * + * @summary An action to stop an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json + */ +async function accessReviewInstanceStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.stop(scheduleDefinitionId, id); + console.log(result); +} + +accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js new file mode 100644 index 000000000000..a457f3dc96d9 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get single access review instance assigned for my approval. + * + * @summary Get single access review instance assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ +async function getAccessReviewInstanceAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstancesAssignedForMyApproval.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js new file mode 100644 index 000000000000..be77084d4eac --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ +async function getAccessReviewInstancesAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const filter = "assignedToMeToReview()"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( + scheduleDefinitionId, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesCreateSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesCreateSample.js new file mode 100644 index 000000000000..a9fc9ab35c72 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesCreateSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update access review instance. + * + * @summary Update access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json + */ +async function putAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.create(scheduleDefinitionId, id, properties); + console.log(result); +} + +putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesGetByIdSample.js new file mode 100644 index 000000000000..a724efdfb14d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesGetByIdSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json + */ +async function getAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.getById(scheduleDefinitionId, id); + console.log(result); +} + +getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesListSample.js new file mode 100644 index 000000000000..9e7e3ce95e9e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewInstancesListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json + */ +async function getAccessReviewInstances() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstances.list(scheduleDefinitionId)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js new file mode 100644 index 000000000000..1cf350db0a64 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ +async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const filter = "assignedToMeToReview()"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js new file mode 100644 index 000000000000..67a7c7e0f161 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or Update access review schedule definition. + * + * @summary Create or Update access review schedule definition. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json + */ +async function putAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( + scheduleDefinitionId, + properties + ); + console.log(result); +} + +putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js new file mode 100644 index 000000000000..53302485e016 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete access review schedule definition + * + * @summary Delete access review schedule definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.deleteById(scheduleDefinitionId); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsGetByIdSample.js new file mode 100644 index 000000000000..3676eb7ecddf --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsGetByIdSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get single access review definition + * + * @summary Get single access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json + */ +async function getAccessReviewScheduleDefinition() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.getById(scheduleDefinitionId); + console.log(result); +} + +getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsListSample.js new file mode 100644 index 000000000000..b0d05478528b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review schedule definitions + * + * @summary Get access review schedule definitions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json + */ +async function getAccessReviewScheduleDefinitions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsStopSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsStopSample.js new file mode 100644 index 000000000000..90425be030c9 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/accessReviewScheduleDefinitionsStopSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop access review definition + * + * @summary Stop access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json + */ +async function accessReviewScheduleDefinitionStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.stop(scheduleDefinitionId); + console.log(result); +} + +accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/package.json b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/package.json new file mode 100644 index 000000000000..857783234ab5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-authorization-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/authorization/arm-authorization" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization", + "dependencies": { + "@azure/arm-authorization": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/sample.env b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js new file mode 100644 index 000000000000..3048638696df --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ +async function tenantLevelGetAccessReviewInstanceContactedReviewers() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/README.md b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/README.md new file mode 100644 index 000000000000..e80f9baf3238 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/README.md @@ -0,0 +1,121 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessReviewDefaultSettingsGetSample.ts][accessreviewdefaultsettingsgetsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json | +| [accessReviewDefaultSettingsPutSample.ts][accessreviewdefaultsettingsputsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json | +| [accessReviewHistoryDefinitionCreateSample.ts][accessreviewhistorydefinitioncreatesample] | Create a scheduled or one-time Access Review History Definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionDeleteByIdSample.ts][accessreviewhistorydefinitiondeletebyidsample] | Delete an access review history definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts][accessreviewhistorydefinitioninstancegeneratedownloadurisample] | Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json | +| [accessReviewHistoryDefinitionInstancesListSample.ts][accessreviewhistorydefinitioninstanceslistsample] | Get access review history definition instances by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json | +| [accessReviewHistoryDefinitionsGetByIdSample.ts][accessreviewhistorydefinitionsgetbyidsample] | Get access review history definition by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionsListSample.ts][accessreviewhistorydefinitionslistsample] | Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json | +| [accessReviewInstanceAcceptRecommendationsSample.ts][accessreviewinstanceacceptrecommendationssample] | An action to accept recommendations for decision in an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json | +| [accessReviewInstanceApplyDecisionsSample.ts][accessreviewinstanceapplydecisionssample] | An action to apply all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json | +| [accessReviewInstanceContactedReviewersListSample.ts][accessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json | +| [accessReviewInstanceDecisionsListSample.ts][accessreviewinstancedecisionslistsample] | Get access review instance decisions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json | +| [accessReviewInstanceMyDecisionsGetByIdSample.ts][accessreviewinstancemydecisionsgetbyidsample] | Get my single access review instance decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceMyDecisionsListSample.ts][accessreviewinstancemydecisionslistsample] | Get my access review instance decisions. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json | +| [accessReviewInstanceMyDecisionsPatchSample.ts][accessreviewinstancemydecisionspatchsample] | Record a decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceResetDecisionsSample.ts][accessreviewinstanceresetdecisionssample] | An action to reset all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json | +| [accessReviewInstanceSendRemindersSample.ts][accessreviewinstancesendreminderssample] | An action to send reminders for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json | +| [accessReviewInstanceStopSample.ts][accessreviewinstancestopsample] | An action to stop an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json | +| [accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts][accessreviewinstancesassignedformyapprovalgetbyidsample] | Get single access review instance assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json | +| [accessReviewInstancesAssignedForMyApprovalListSample.ts][accessreviewinstancesassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json | +| [accessReviewInstancesCreateSample.ts][accessreviewinstancescreatesample] | Update access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json | +| [accessReviewInstancesGetByIdSample.ts][accessreviewinstancesgetbyidsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json | +| [accessReviewInstancesListSample.ts][accessreviewinstanceslistsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json | +| [accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts][accessreviewscheduledefinitionsassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json | +| [accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts][accessreviewscheduledefinitionscreateorupdatebyidsample] | Create or Update access review schedule definition. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsDeleteByIdSample.ts][accessreviewscheduledefinitionsdeletebyidsample] | Delete access review schedule definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsGetByIdSample.ts][accessreviewscheduledefinitionsgetbyidsample] | Get single access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsListSample.ts][accessreviewscheduledefinitionslistsample] | Get access review schedule definitions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json | +| [accessReviewScheduleDefinitionsStopSample.ts][accessreviewscheduledefinitionsstopsample] | Stop access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json | +| [tenantLevelAccessReviewInstanceContactedReviewersListSample.ts][tenantlevelaccessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/accessReviewDefaultSettingsGetSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/accessReviewDefaultSettingsGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accessreviewdefaultsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsGetSample.ts +[accessreviewdefaultsettingsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsPutSample.ts +[accessreviewhistorydefinitioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionCreateSample.ts +[accessreviewhistorydefinitiondeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts +[accessreviewhistorydefinitioninstancegeneratedownloadurisample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts +[accessreviewhistorydefinitioninstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts +[accessreviewhistorydefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts +[accessreviewhistorydefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsListSample.ts +[accessreviewinstanceacceptrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts +[accessreviewinstanceapplydecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceApplyDecisionsSample.ts +[accessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceContactedReviewersListSample.ts +[accessreviewinstancedecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceDecisionsListSample.ts +[accessreviewinstancemydecisionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts +[accessreviewinstancemydecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsListSample.ts +[accessreviewinstancemydecisionspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts +[accessreviewinstanceresetdecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceResetDecisionsSample.ts +[accessreviewinstancesendreminderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceSendRemindersSample.ts +[accessreviewinstancestopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceStopSample.ts +[accessreviewinstancesassignedformyapprovalgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts +[accessreviewinstancesassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts +[accessreviewinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesCreateSample.ts +[accessreviewinstancesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesGetByIdSample.ts +[accessreviewinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesListSample.ts +[accessreviewscheduledefinitionsassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts +[accessreviewscheduledefinitionscreateorupdatebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts +[accessreviewscheduledefinitionsdeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts +[accessreviewscheduledefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts +[accessreviewscheduledefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsListSample.ts +[accessreviewscheduledefinitionsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsStopSample.ts +[tenantlevelaccessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/package.json b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/package.json new file mode 100644 index 000000000000..a38985eeb773 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-authorization-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/authorization/arm-authorization" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization", + "dependencies": { + "@azure/arm-authorization": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/sample.env b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsGetSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsGetSample.ts new file mode 100644 index 000000000000..a0b0a43a56de --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsGetSample.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json + */ +async function getAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.get(); + console.log(result); +} + +getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsPutSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsPutSample.ts new file mode 100644 index 000000000000..50cedccdcf86 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewDefaultSettingsPutSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleSettings, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json + */ +async function putAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewScheduleSettings = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.put( + properties + ); + console.log(result); +} + +putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionCreateSample.ts new file mode 100644 index 000000000000..e39c7cb0970e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionCreateSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewHistoryDefinitionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition + * + * @summary Create a scheduled or one-time Access Review History Definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json + */ +async function putAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const properties: AccessReviewHistoryDefinitionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.create( + historyDefinitionId, + properties + ); + console.log(result); +} + +putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts new file mode 100644 index 000000000000..69fa585d77b7 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an access review history definition + * + * @summary Delete an access review history definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.deleteById( + historyDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts new file mode 100644 index 000000000000..cc30aaaef9c2 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * + * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ +async function postAccessReviewHistoryDefinitionInstance() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( + historyDefinitionId, + instanceId + ); + console.log(result); +} + +postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts new file mode 100644 index 000000000000..f58b44160d78 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review history definition instances by definition Id + * + * @summary Get access review history definition instances by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ +async function getAccessReviewHistoryDefinitionInstances() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitionInstances.list( + historyDefinitionId + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts new file mode 100644 index 000000000000..b3ac5f469101 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review history definition by definition Id + * + * @summary Get access review history definition by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json + */ +async function getAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitions.getById( + historyDefinitionId + ); + console.log(result); +} + +getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsListSample.ts new file mode 100644 index 000000000000..de8ee5a79dbe --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewHistoryDefinitionsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * + * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json + */ +async function getAccessReviewHistoryDefinitions() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts new file mode 100644 index 000000000000..e881a9757421 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. + * + * @summary An action to accept recommendations for decision in an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ +async function accessReviewInstanceAcceptRecommmendations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.acceptRecommendations( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceApplyDecisionsSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceApplyDecisionsSample.ts new file mode 100644 index 000000000000..8ee8addf9757 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceApplyDecisionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to apply all decisions for an access review instance. + * + * @summary An action to apply all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json + */ +async function accessReviewInstanceApplyDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.applyDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceContactedReviewersListSample.ts new file mode 100644 index 000000000000..f5545dce25cb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceContactedReviewersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ +async function getAccessReviewInstanceContactedReviewers() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceDecisionsListSample.ts new file mode 100644 index 000000000000..d308e1577a91 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceDecisionsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance decisions + * + * @summary Get access review instance decisions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json + */ +async function getAccessReviewInstanceDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceDecisions.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts new file mode 100644 index 000000000000..098083ac906b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get my single access review instance decision. + * + * @summary Get my single access review instance decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ +async function getAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.getById( + scheduleDefinitionId, + id, + decisionId + ); + console.log(result); +} + +getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsListSample.ts new file mode 100644 index 000000000000..b1e50fddef13 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get my access review instance decisions. + * + * @summary Get my access review instance decisions. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ +async function getAccessReviewMyInstanceDecisions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceMyDecisions.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts new file mode 100644 index 000000000000..de192912a02f --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewDecisionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Record a decision. + * + * @summary Record a decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ +async function patchAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewDecisionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.patch( + scheduleDefinitionId, + id, + decisionId, + properties + ); + console.log(result); +} + +patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceResetDecisionsSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceResetDecisionsSample.ts new file mode 100644 index 000000000000..4e3d76961b8d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceResetDecisionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to reset all decisions for an access review instance. + * + * @summary An action to reset all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json + */ +async function accessReviewInstanceResetDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.resetDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceSendRemindersSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceSendRemindersSample.ts new file mode 100644 index 000000000000..11ddd932ee2d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceSendRemindersSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to send reminders for an access review instance. + * + * @summary An action to send reminders for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json + */ +async function accessReviewInstanceSendReminders() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.sendReminders( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceStopSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceStopSample.ts new file mode 100644 index 000000000000..815e5afc5b27 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstanceStopSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to stop an access review instance. + * + * @summary An action to stop an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json + */ +async function accessReviewInstanceStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.stop( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts new file mode 100644 index 000000000000..471034e44cfd --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get single access review instance assigned for my approval. + * + * @summary Get single access review instance assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ +async function getAccessReviewInstanceAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstancesAssignedForMyApproval.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts new file mode 100644 index 000000000000..c4e9d9a65597 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewInstancesAssignedForMyApprovalListOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ +async function getAccessReviewInstancesAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const filter = "assignedToMeToReview()"; + const options: AccessReviewInstancesAssignedForMyApprovalListOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( + scheduleDefinitionId, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesCreateSample.ts new file mode 100644 index 000000000000..87d00acf9361 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesCreateSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewInstanceProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update access review instance. + * + * @summary Update access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json + */ +async function putAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const properties: AccessReviewInstanceProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.create( + scheduleDefinitionId, + id, + properties + ); + console.log(result); +} + +putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesGetByIdSample.ts new file mode 100644 index 000000000000..6ccfa758845e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesGetByIdSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json + */ +async function getAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesListSample.ts new file mode 100644 index 000000000000..5b8b8fb65158 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewInstancesListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json + */ +async function getAccessReviewInstances() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstances.list( + scheduleDefinitionId + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts new file mode 100644 index 000000000000..30af9e3d7312 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ +async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const filter = "assignedToMeToReview()"; + const options: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts new file mode 100644 index 000000000000..d6be116ded62 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleDefinitionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or Update access review schedule definition. + * + * @summary Create or Update access review schedule definition. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json + */ +async function putAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewScheduleDefinitionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( + scheduleDefinitionId, + properties + ); + console.log(result); +} + +putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts new file mode 100644 index 000000000000..3b8be5f31b06 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete access review schedule definition + * + * @summary Delete access review schedule definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.deleteById( + scheduleDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts new file mode 100644 index 000000000000..d6fd1ca463af --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get single access review definition + * + * @summary Get single access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json + */ +async function getAccessReviewScheduleDefinition() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.getById( + scheduleDefinitionId + ); + console.log(result); +} + +getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsListSample.ts new file mode 100644 index 000000000000..c65d11e35ed1 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review schedule definitions + * + * @summary Get access review schedule definitions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json + */ +async function getAccessReviewScheduleDefinitions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsStopSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsStopSample.ts new file mode 100644 index 000000000000..a0c6c4c55e32 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/accessReviewScheduleDefinitionsStopSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop access review definition + * + * @summary Stop access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json + */ +async function accessReviewScheduleDefinitionStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.stop( + scheduleDefinitionId + ); + console.log(result); +} + +accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts new file mode 100644 index 000000000000..208201a4fc3c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ +async function tenantLevelGetAccessReviewInstanceContactedReviewers() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9-beta/typescript/tsconfig.json b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts index 23ac722e0ca1..25957bcb79b0 100644 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts +++ b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts @@ -6,35 +6,49 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; import { - RoleAssignmentSchedulesImpl, - RoleAssignmentScheduleInstancesImpl, - RoleAssignmentScheduleRequestsImpl, - RoleEligibilitySchedulesImpl, - RoleEligibilityScheduleInstancesImpl, - RoleEligibilityScheduleRequestsImpl, - RoleManagementPoliciesImpl, - RoleManagementPolicyAssignmentsImpl, - EligibleChildResourcesImpl, - RoleAssignmentsImpl + OperationsImpl, + AccessReviewHistoryDefinitionsImpl, + AccessReviewHistoryDefinitionOperationsImpl, + AccessReviewHistoryDefinitionInstanceImpl, + AccessReviewHistoryDefinitionInstancesImpl, + AccessReviewScheduleDefinitionsImpl, + AccessReviewInstancesImpl, + AccessReviewInstanceOperationsImpl, + AccessReviewInstanceDecisionsImpl, + AccessReviewInstanceContactedReviewersImpl, + AccessReviewDefaultSettingsOperationsImpl, + AccessReviewScheduleDefinitionsAssignedForMyApprovalImpl, + AccessReviewInstancesAssignedForMyApprovalImpl, + AccessReviewInstanceMyDecisionsImpl, + TenantLevelAccessReviewInstanceContactedReviewersImpl } from "./operations"; import { - RoleAssignmentSchedules, - RoleAssignmentScheduleInstances, - RoleAssignmentScheduleRequests, - RoleEligibilitySchedules, - RoleEligibilityScheduleInstances, - RoleEligibilityScheduleRequests, - RoleManagementPolicies, - RoleManagementPolicyAssignments, - EligibleChildResources, - RoleAssignments + Operations, + AccessReviewHistoryDefinitions, + AccessReviewHistoryDefinitionOperations, + AccessReviewHistoryDefinitionInstance, + AccessReviewHistoryDefinitionInstances, + AccessReviewScheduleDefinitions, + AccessReviewInstances, + AccessReviewInstanceOperations, + AccessReviewInstanceDecisions, + AccessReviewInstanceContactedReviewers, + AccessReviewDefaultSettingsOperations, + AccessReviewScheduleDefinitionsAssignedForMyApproval, + AccessReviewInstancesAssignedForMyApproval, + AccessReviewInstanceMyDecisions, + TenantLevelAccessReviewInstanceContactedReviewers } from "./operationsInterfaces"; -import { AuthorizationManagementClientContext } from "./authorizationManagementClientContext"; import { AuthorizationManagementClientOptionalParams } from "./models"; -export class AuthorizationManagementClient extends AuthorizationManagementClientContext { +export class AuthorizationManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + /** * Initializes a new instance of the AuthorizationManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -46,37 +60,103 @@ export class AuthorizationManagementClient extends AuthorizationManagementClient subscriptionId: string, options?: AuthorizationManagementClientOptionalParams ) { - super(credentials, subscriptionId, options); - this.roleAssignmentSchedules = new RoleAssignmentSchedulesImpl(this); - this.roleAssignmentScheduleInstances = new RoleAssignmentScheduleInstancesImpl( + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AuthorizationManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-authorization/9.0.0-beta.2`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-11-16-preview"; + this.operations = new OperationsImpl(this); + this.accessReviewHistoryDefinitions = new AccessReviewHistoryDefinitionsImpl( + this + ); + this.accessReviewHistoryDefinitionOperations = new AccessReviewHistoryDefinitionOperationsImpl( + this + ); + this.accessReviewHistoryDefinitionInstance = new AccessReviewHistoryDefinitionInstanceImpl( + this + ); + this.accessReviewHistoryDefinitionInstances = new AccessReviewHistoryDefinitionInstancesImpl( + this + ); + this.accessReviewScheduleDefinitions = new AccessReviewScheduleDefinitionsImpl( + this + ); + this.accessReviewInstances = new AccessReviewInstancesImpl(this); + this.accessReviewInstanceOperations = new AccessReviewInstanceOperationsImpl( + this + ); + this.accessReviewInstanceDecisions = new AccessReviewInstanceDecisionsImpl( + this + ); + this.accessReviewInstanceContactedReviewers = new AccessReviewInstanceContactedReviewersImpl( + this + ); + this.accessReviewDefaultSettingsOperations = new AccessReviewDefaultSettingsOperationsImpl( this ); - this.roleAssignmentScheduleRequests = new RoleAssignmentScheduleRequestsImpl( + this.accessReviewScheduleDefinitionsAssignedForMyApproval = new AccessReviewScheduleDefinitionsAssignedForMyApprovalImpl( this ); - this.roleEligibilitySchedules = new RoleEligibilitySchedulesImpl(this); - this.roleEligibilityScheduleInstances = new RoleEligibilityScheduleInstancesImpl( + this.accessReviewInstancesAssignedForMyApproval = new AccessReviewInstancesAssignedForMyApprovalImpl( this ); - this.roleEligibilityScheduleRequests = new RoleEligibilityScheduleRequestsImpl( + this.accessReviewInstanceMyDecisions = new AccessReviewInstanceMyDecisionsImpl( this ); - this.roleManagementPolicies = new RoleManagementPoliciesImpl(this); - this.roleManagementPolicyAssignments = new RoleManagementPolicyAssignmentsImpl( + this.tenantLevelAccessReviewInstanceContactedReviewers = new TenantLevelAccessReviewInstanceContactedReviewersImpl( this ); - this.eligibleChildResources = new EligibleChildResourcesImpl(this); - this.roleAssignments = new RoleAssignmentsImpl(this); } - roleAssignmentSchedules: RoleAssignmentSchedules; - roleAssignmentScheduleInstances: RoleAssignmentScheduleInstances; - roleAssignmentScheduleRequests: RoleAssignmentScheduleRequests; - roleEligibilitySchedules: RoleEligibilitySchedules; - roleEligibilityScheduleInstances: RoleEligibilityScheduleInstances; - roleEligibilityScheduleRequests: RoleEligibilityScheduleRequests; - roleManagementPolicies: RoleManagementPolicies; - roleManagementPolicyAssignments: RoleManagementPolicyAssignments; - eligibleChildResources: EligibleChildResources; - roleAssignments: RoleAssignments; + operations: Operations; + accessReviewHistoryDefinitions: AccessReviewHistoryDefinitions; + accessReviewHistoryDefinitionOperations: AccessReviewHistoryDefinitionOperations; + accessReviewHistoryDefinitionInstance: AccessReviewHistoryDefinitionInstance; + accessReviewHistoryDefinitionInstances: AccessReviewHistoryDefinitionInstances; + accessReviewScheduleDefinitions: AccessReviewScheduleDefinitions; + accessReviewInstances: AccessReviewInstances; + accessReviewInstanceOperations: AccessReviewInstanceOperations; + accessReviewInstanceDecisions: AccessReviewInstanceDecisions; + accessReviewInstanceContactedReviewers: AccessReviewInstanceContactedReviewers; + accessReviewDefaultSettingsOperations: AccessReviewDefaultSettingsOperations; + accessReviewScheduleDefinitionsAssignedForMyApproval: AccessReviewScheduleDefinitionsAssignedForMyApproval; + accessReviewInstancesAssignedForMyApproval: AccessReviewInstancesAssignedForMyApproval; + accessReviewInstanceMyDecisions: AccessReviewInstanceMyDecisions; + tenantLevelAccessReviewInstanceContactedReviewers: TenantLevelAccessReviewInstanceContactedReviewers; } diff --git a/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts b/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts deleted file mode 100644 index 5cc28f392655..000000000000 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import * as coreAuth from "@azure/core-auth"; -import { AuthorizationManagementClientOptionalParams } from "./models"; - -export class AuthorizationManagementClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the AuthorizationManagementClientContext class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: AuthorizationManagementClientOptionalParams - ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AuthorizationManagementClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-arm-authorization/9.0.0-beta.1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2020-10-01-preview"; - } -} diff --git a/sdk/authorization/arm-authorization/src/index.ts b/sdk/authorization/arm-authorization/src/index.ts index 4902352993d2..bfd87d5d1ad6 100644 --- a/sdk/authorization/arm-authorization/src/index.ts +++ b/sdk/authorization/arm-authorization/src/index.ts @@ -9,5 +9,4 @@ /// export * from "./models"; export { AuthorizationManagementClient } from "./authorizationManagementClient"; -export { AuthorizationManagementClientContext } from "./authorizationManagementClientContext"; export * from "./operationsInterfaces"; diff --git a/sdk/authorization/arm-authorization/src/models/index.ts b/sdk/authorization/arm-authorization/src/models/index.ts index 2e4c005cd3fc..b97b429ed3d8 100644 --- a/sdk/authorization/arm-authorization/src/models/index.ts +++ b/sdk/authorization/arm-authorization/src/models/index.ts @@ -8,730 +8,655 @@ import * as coreClient from "@azure/core-client"; -export type RoleManagementPolicyRuleUnion = - | RoleManagementPolicyRule - | RoleManagementPolicyApprovalRule - | RoleManagementPolicyAuthenticationContextRule - | RoleManagementPolicyEnablementRule - | RoleManagementPolicyExpirationRule - | RoleManagementPolicyNotificationRule; +export type AccessReviewDecisionIdentityUnion = + | AccessReviewDecisionIdentity + | AccessReviewDecisionUserIdentity + | AccessReviewDecisionServicePrincipalIdentity; +export type AccessReviewDecisionResourceUnion = + | AccessReviewDecisionResource + | AccessReviewDecisionResourceAzureRole; + +/** The result of a request to list Microsoft.Authorization operations. */ +export interface OperationListResult { + /** The collection value. */ + value?: Operation[]; + /** The URI that can be used to request the next set of paged results. */ + nextLink?: string; +} + +/** The definition of a Microsoft.Authorization operation. */ +export interface Operation { + /** Name of the operation */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** Display of the operation */ + display?: OperationDisplay; + /** Origin of the operation */ + origin?: string; +} -/** Role Assignment schedule */ -export interface RoleAssignmentSchedule { +/** The display information for a Microsoft.Authorization operation. */ +export interface OperationDisplay { /** - * The role assignment schedule Id. + * The resource provider name: Microsoft.Authorization. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly provider?: string; /** - * The role assignment schedule name. + * The resource on which the operation is performed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly resource?: string; /** - * The role assignment schedule type. + * The operation that users can perform. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** The role assignment schedule scope. */ - scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; - /** The principal type of the assigned principal ID. */ - principalType?: PrincipalType; - /** The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule */ - roleAssignmentScheduleRequestId?: string; - /** The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule */ - linkedRoleEligibilityScheduleId?: string; - /** Assignment type of the role assignment schedule */ - assignmentType?: AssignmentType; - /** Membership type of the role assignment schedule */ - memberType?: MemberType; - /** The status of the role assignment schedule. */ - status?: Status; - /** Start DateTime when role assignment schedule */ - startDateTime?: Date; - /** End DateTime when role assignment schedule */ - endDateTime?: Date; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; - /** DateTime when role assignment schedule was created */ - createdOn?: Date; - /** DateTime when role assignment schedule was modified */ - updatedOn?: Date; - /** Additional properties of principal, scope and role definition */ - expandedProperties?: ExpandedProperties; -} - -export interface ExpandedProperties { - /** Details of the resource scope */ - scope?: ExpandedPropertiesScope; - /** Details of role definition */ - roleDefinition?: ExpandedPropertiesRoleDefinition; - /** Details of the principal */ - principal?: ExpandedPropertiesPrincipal; -} - -/** Details of the resource scope */ -export interface ExpandedPropertiesScope { - /** Scope id of the resource */ - id?: string; - /** Display name of the resource */ - displayName?: string; - /** Type of the resource */ - type?: string; -} - -/** Details of role definition */ -export interface ExpandedPropertiesRoleDefinition { - /** Id of the role definition */ - id?: string; - /** Display name of the role definition */ - displayName?: string; - /** Type of the role definition */ - type?: string; -} - -/** Details of the principal */ -export interface ExpandedPropertiesPrincipal { - /** Id of the principal */ - id?: string; - /** Display name of the principal */ - displayName?: string; - /** Email id of the principal */ - email?: string; - /** Type of the principal */ - type?: string; + readonly operation?: string; + /** + * The description for the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; } -/** An error response from the service. */ -export interface CloudError { - /** An error response from the service. */ - error?: CloudErrorBody; +/** Error description and code explaining why an operation failed. */ +export interface ErrorDefinition { + /** Error of the list gateway status. */ + error?: ErrorDefinitionProperties; } -/** An error response from the service. */ -export interface CloudErrorBody { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ +/** Error description and code explaining why an operation failed. */ +export interface ErrorDefinitionProperties { + /** + * Description of the error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** Error code of list gateway. */ code?: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message?: string; } -/** Role assignment schedule list operation result. */ -export interface RoleAssignmentScheduleListResult { - /** Role assignment schedule list. */ - value?: RoleAssignmentSchedule[]; +/** List of Access Review History Definitions. */ +export interface AccessReviewHistoryDefinitionListResult { + /** Access Review History Definition list. */ + value?: AccessReviewHistoryDefinition[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Role assignment schedule instance list operation result. */ -export interface RoleAssignmentScheduleInstanceListResult { - /** Role assignment schedule instance list. */ - value?: RoleAssignmentScheduleInstance[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** Information about current or upcoming role assignment schedule instance */ -export interface RoleAssignmentScheduleInstance { +/** Access Review History Definition. */ +export interface AccessReviewHistoryDefinition { /** - * The role assignment schedule instance ID. + * The access review history definition id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The role assignment schedule instance name. + * The access review history definition unique id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The role assignment schedule instance type. + * The resource type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The role assignment schedule scope. */ - scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; - /** The principal type of the assigned principal ID. */ - principalType?: PrincipalType; - /** Id of the master role assignment schedule */ - roleAssignmentScheduleId?: string; - /** Role Assignment Id in external system */ - originRoleAssignmentId?: string; - /** The status of the role assignment schedule instance. */ - status?: Status; - /** The startDateTime of the role assignment schedule instance */ - startDateTime?: Date; - /** The endDateTime of the role assignment schedule instance */ - endDateTime?: Date; - /** roleEligibilityScheduleId used to activate */ - linkedRoleEligibilityScheduleId?: string; - /** roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance */ - linkedRoleEligibilityScheduleInstanceId?: string; - /** Assignment type of the role assignment schedule */ - assignmentType?: AssignmentType; - /** Membership type of the role assignment schedule */ - memberType?: MemberType; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; - /** DateTime when role assignment schedule was created */ - createdOn?: Date; - /** Additional properties of principal, scope and role definition */ - expandedProperties?: ExpandedProperties; -} - -/** Role Assignment schedule request */ -export interface RoleAssignmentScheduleRequest { + /** The display name for the history definition. */ + displayName?: string; /** - * The role assignment schedule request ID. + * Date time used when selecting review data, all reviews included in data start on or after this date. For use only with one-time/non-recurring reports. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly reviewHistoryPeriodStartDateTime?: Date; /** - * The role assignment schedule request name. + * Date time used when selecting review data, all reviews included in data end on or before this date. For use only with one-time/non-recurring reports. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly reviewHistoryPeriodEndDateTime?: Date; + /** Collection of review decisions which the history data should be filtered on. For example if Approve and Deny are supplied the data will only contain review results in which the decision maker approved or denied a review request. */ + decisions?: AccessReviewResult[]; /** - * The role assignment schedule request type. + * This read-only field specifies the of the requested review history data. This is either requested, in-progress, done or error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly status?: AccessReviewHistoryDefinitionStatus; /** - * The role assignment schedule request scope. + * Date time when history definition was created * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; + readonly createdDateTime?: Date; + /** A collection of scopes used when selecting review history data */ + scopes?: AccessReviewScope[]; + /** Set of access review history instances for this history definition. */ + instances?: AccessReviewHistoryInstance[]; + /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ + typePropertiesSettingsRangeType?: AccessReviewRecurrenceRangeType; + /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ + numberOfOccurrences?: number; + /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ + startDate?: Date; + /** The DateTime when the review is scheduled to end. Required if type is endDate */ + endDate?: Date; + /** The recurrence type : weekly, monthly, etc. */ + typePropertiesSettingsPatternType?: AccessReviewRecurrencePatternType; + /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ + interval?: number; /** - * The principal type of the assigned principal ID. + * The identity id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalType?: PrincipalType; - /** The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc */ - requestType?: RequestType; + readonly principalId?: string; /** - * The status of the role assignment schedule request. + * The identity type : user/servicePrincipal * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: Status; + readonly principalType?: AccessReviewActorIdentityType; /** - * The approvalId of the role assignment schedule request. + * The identity display name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly approvalId?: string; - /** The resultant role assignment schedule id or the role assignment schedule id being updated */ - targetRoleAssignmentScheduleId?: string; - /** The role assignment schedule instance id being updated */ - targetRoleAssignmentScheduleInstanceId?: string; - /** Schedule info of the role assignment schedule */ - scheduleInfo?: RoleAssignmentScheduleRequestPropertiesScheduleInfo; - /** The linked role eligibility schedule id - to activate an eligibility. */ - linkedRoleEligibilityScheduleId?: string; - /** Justification for the role assignment */ - justification?: string; - /** Ticket Info of the role assignment */ - ticketInfo?: RoleAssignmentScheduleRequestPropertiesTicketInfo; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; + readonly principalName?: string; /** - * DateTime when role assignment schedule request was created + * The user principal name(if valid) * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdOn?: Date; + readonly userPrincipalName?: string; +} + +/** Access Review History Instances. */ +export interface AccessReviewHistoryDefinitionProperties { + /** The display name for the history definition. */ + displayName?: string; /** - * Id of the user who created this request + * Date time used when selecting review data, all reviews included in data start on or after this date. For use only with one-time/non-recurring reports. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly requestorId?: string; + readonly reviewHistoryPeriodStartDateTime?: Date; /** - * Additional properties of principal, scope and role definition + * Date time used when selecting review data, all reviews included in data end on or before this date. For use only with one-time/non-recurring reports. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expandedProperties?: ExpandedProperties; -} - -/** Schedule info of the role assignment schedule */ -export interface RoleAssignmentScheduleRequestPropertiesScheduleInfo { - /** Start DateTime of the role assignment schedule. */ - startDateTime?: Date; - /** Expiration of the role assignment schedule */ - expiration?: RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; -} - -/** Expiration of the role assignment schedule */ -export interface RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration { - /** Type of the role assignment schedule expiration */ - type?: Type; - /** End DateTime of the role assignment schedule. */ - endDateTime?: Date; - /** Duration of the role assignment schedule in TimeSpan. */ - duration?: string; -} - -/** Ticket Info of the role assignment */ -export interface RoleAssignmentScheduleRequestPropertiesTicketInfo { - /** Ticket number for the role assignment */ - ticketNumber?: string; - /** Ticket system name for the role assignment */ - ticketSystem?: string; + readonly reviewHistoryPeriodEndDateTime?: Date; + /** Collection of review decisions which the history data should be filtered on. For example if Approve and Deny are supplied the data will only contain review results in which the decision maker approved or denied a review request. */ + decisions?: AccessReviewResult[]; + /** + * This read-only field specifies the of the requested review history data. This is either requested, in-progress, done or error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: AccessReviewHistoryDefinitionStatus; + /** + * Date time when history definition was created + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdDateTime?: Date; + /** A collection of scopes used when selecting review history data */ + scopes?: AccessReviewScope[]; + /** Set of access review history instances for this history definition. */ + instances?: AccessReviewHistoryInstance[]; + /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ + typeSettingsRangeType?: AccessReviewRecurrenceRangeType; + /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ + numberOfOccurrences?: number; + /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ + startDate?: Date; + /** The DateTime when the review is scheduled to end. Required if type is endDate */ + endDate?: Date; + /** The recurrence type : weekly, monthly, etc. */ + typeSettingsPatternType?: AccessReviewRecurrencePatternType; + /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ + interval?: number; + /** + * The identity id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The identity type : user/servicePrincipal + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalType?: AccessReviewActorIdentityType; + /** + * The identity display name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalName?: string; + /** + * The user principal name(if valid) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userPrincipalName?: string; } -/** Role assignment schedule request list operation result. */ -export interface RoleAssignmentScheduleRequestListResult { - /** Role assignment schedule request list. */ - value?: RoleAssignmentScheduleRequest[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; +/** Descriptor for what needs to be reviewed */ +export interface AccessReviewScope { + /** + * ResourceId in which this review is getting created + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceId?: string; + /** + * This is used to indicate the role being reviewed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly roleDefinitionId?: string; + /** + * The identity type user/servicePrincipal to review + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalType?: AccessReviewScopePrincipalType; + /** + * The role assignment state eligible/active to review + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly assignmentState?: AccessReviewScopeAssignmentState; + /** Duration users are inactive for. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + inactiveDuration?: string; + /** Flag to indicate whether to expand nested memberships or not. */ + expandNestedMemberships?: boolean; } -/** Role eligibility schedule */ -export interface RoleEligibilitySchedule { +/** Access Review History Definition Instance. */ +export interface AccessReviewHistoryInstance { /** - * The role eligibility schedule Id. + * The access review history definition instance id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The role eligibility schedule name. + * The access review history definition instance unique id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The role eligibility schedule type. + * The resource type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The role eligibility schedule scope. */ - scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; - /** The principal type of the assigned principal ID. */ - principalType?: PrincipalType; - /** The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule */ - roleEligibilityScheduleRequestId?: string; - /** Membership type of the role eligibility schedule */ - memberType?: MemberType; - /** The status of the role eligibility schedule. */ - status?: Status; - /** Start DateTime when role eligibility schedule */ - startDateTime?: Date; - /** End DateTime when role eligibility schedule */ - endDateTime?: Date; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; - /** DateTime when role eligibility schedule was created */ - createdOn?: Date; - /** DateTime when role eligibility schedule was modified */ - updatedOn?: Date; - /** Additional properties of principal, scope and role definition */ - expandedProperties?: ExpandedProperties; + /** Date time used when selecting review data, all reviews included in data start on or after this date. For use only with one-time/non-recurring reports. */ + reviewHistoryPeriodStartDateTime?: Date; + /** Date time used when selecting review data, all reviews included in data end on or before this date. For use only with one-time/non-recurring reports. */ + reviewHistoryPeriodEndDateTime?: Date; + /** The display name for the parent history definition. */ + displayName?: string; + /** + * Status of the requested review history instance data. This is either requested, in-progress, done or error. The state transitions are as follows - Requested -> InProgress -> Done -> Expired + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: AccessReviewHistoryDefinitionStatus; + /** Date time when the history data report is scheduled to be generated. */ + runDateTime?: Date; + /** Date time when the history data report is scheduled to be generated. */ + fulfilledDateTime?: Date; + /** + * Uri which can be used to retrieve review history data. To generate this Uri, generateDownloadUri() must be called for a specific accessReviewHistoryDefinitionInstance. The link expires after a 24 hour period. Callers can see the expiration date time by looking at the 'se' parameter in the generated uri. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly downloadUri?: string; + /** Date time when history data report expires and the associated data is deleted. */ + expiration?: Date; } -/** role eligibility schedule list operation result. */ -export interface RoleEligibilityScheduleListResult { - /** role eligibility schedule list. */ - value?: RoleEligibilitySchedule[]; +/** List of Access Review History Instances. */ +export interface AccessReviewHistoryDefinitionInstanceListResult { + /** Access Review History Definition's Instance list. */ + value?: AccessReviewHistoryInstance[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Role eligibility schedule instance list operation result. */ -export interface RoleEligibilityScheduleInstanceListResult { - /** Role eligibility schedule instance list. */ - value?: RoleEligibilityScheduleInstance[]; +/** List of Access Review Schedule Definitions. */ +export interface AccessReviewScheduleDefinitionListResult { + /** Access Review Schedule Definition list. */ + value?: AccessReviewScheduleDefinition[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Information about current or upcoming role eligibility schedule instance */ -export interface RoleEligibilityScheduleInstance { +/** Access Review Schedule Definition. */ +export interface AccessReviewScheduleDefinition { /** - * The role eligibility schedule instance ID. + * The access review schedule definition id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The role eligibility schedule instance name. + * The access review schedule definition unique id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The role eligibility schedule instance type. + * The resource type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The role eligibility schedule scope. */ - scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; - /** The principal type of the assigned principal ID. */ - principalType?: PrincipalType; - /** Id of the master role eligibility schedule */ - roleEligibilityScheduleId?: string; - /** The status of the role eligibility schedule instance */ - status?: Status; - /** The startDateTime of the role eligibility schedule instance */ - startDateTime?: Date; - /** The endDateTime of the role eligibility schedule instance */ - endDateTime?: Date; - /** Membership type of the role eligibility schedule */ - memberType?: MemberType; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; - /** DateTime when role eligibility schedule was created */ - createdOn?: Date; - /** Additional properties of principal, scope and role definition */ - expandedProperties?: ExpandedProperties; -} - -/** Role Eligibility schedule request */ -export interface RoleEligibilityScheduleRequest { + /** The display name for the schedule definition. */ + displayName?: string; /** - * The role eligibility schedule request ID. + * This read-only field specifies the status of an accessReview. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly status?: AccessReviewScheduleDefinitionStatus; + /** The description provided by the access review creator and visible to admins. */ + descriptionForAdmins?: string; + /** The description provided by the access review creator to be shown to reviewers. */ + descriptionForReviewers?: string; + /** This is the collection of reviewers. */ + reviewers?: AccessReviewReviewer[]; + /** This is the collection of backup reviewers. */ + backupReviewers?: AccessReviewReviewer[]; /** - * The role eligibility schedule request name. + * 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. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; + /** This is the collection of instances returned when one does an expand on it. */ + instances?: AccessReviewInstance[]; /** - * The role eligibility schedule request type. + * ResourceId in which this review is getting created * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly resourceId?: string; /** - * The role eligibility schedule request scope. + * This is used to indicate the role being reviewed * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; + readonly roleDefinitionId?: string; /** - * The principal type of the assigned principal ID. + * The identity type user/servicePrincipal to review * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalType?: PrincipalType; - /** The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc */ - requestType?: RequestType; + readonly principalTypePropertiesScopePrincipalType?: AccessReviewScopePrincipalType; /** - * The status of the role eligibility schedule request. + * The role assignment state eligible/active to review * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: Status; + readonly assignmentState?: AccessReviewScopeAssignmentState; + /** Duration users are inactive for. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + inactiveDuration?: string; + /** Flag to indicate whether to expand nested memberships or not. */ + expandNestedMemberships?: boolean; + /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ + mailNotificationsEnabled?: boolean; + /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ + reminderNotificationsEnabled?: boolean; + /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ + defaultDecisionEnabled?: boolean; + /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ + justificationRequiredOnApproval?: boolean; + /** This specifies the behavior for the autoReview feature when an access review completes. */ + defaultDecision?: DefaultDecisionType; + /** 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. */ + autoApplyDecisionsEnabled?: boolean; + /** Flag to indicate whether showing recommendations to reviewers is enabled. */ + recommendationsEnabled?: boolean; + /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + recommendationLookBackDuration?: string; + /** The duration in days for an instance. */ + instanceDurationInDays?: number; + /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ + typePropertiesSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; + /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ + numberOfOccurrences?: number; + /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ + startDate?: Date; + /** The DateTime when the review is scheduled to end. Required if type is endDate */ + endDate?: Date; + /** The recurrence type : weekly, monthly, etc. */ + typePropertiesSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; + /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ + interval?: number; /** - * The approvalId of the role eligibility schedule request. + * The identity id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly approvalId?: string; - /** Schedule info of the role eligibility schedule */ - scheduleInfo?: RoleEligibilityScheduleRequestPropertiesScheduleInfo; - /** The resultant role eligibility schedule id or the role eligibility schedule id being updated */ - targetRoleEligibilityScheduleId?: string; - /** The role eligibility schedule instance id being updated */ - targetRoleEligibilityScheduleInstanceId?: string; - /** Justification for the role eligibility */ - justification?: string; - /** Ticket Info of the role eligibility */ - ticketInfo?: RoleEligibilityScheduleRequestPropertiesTicketInfo; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; + readonly principalId?: string; /** - * DateTime when role eligibility schedule request was created + * The identity type : user/servicePrincipal * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdOn?: Date; + readonly principalTypePropertiesCreatedByPrincipalType?: AccessReviewActorIdentityType; /** - * Id of the user who created this request + * The identity display name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly requestorId?: string; + readonly principalName?: string; /** - * Additional properties of principal, scope and role definition + * The user principal name(if valid) * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expandedProperties?: ExpandedProperties; + readonly userPrincipalName?: string; } -/** Schedule info of the role eligibility schedule */ -export interface RoleEligibilityScheduleRequestPropertiesScheduleInfo { - /** Start DateTime of the role eligibility schedule. */ - startDateTime?: Date; - /** Expiration of the role eligibility schedule */ - expiration?: RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; -} - -/** Expiration of the role eligibility schedule */ -export interface RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration { - /** Type of the role eligibility schedule expiration */ - type?: Type; - /** End DateTime of the role eligibility schedule. */ - endDateTime?: Date; - /** Duration of the role eligibility schedule in TimeSpan. */ - duration?: string; -} - -/** Ticket Info of the role eligibility */ -export interface RoleEligibilityScheduleRequestPropertiesTicketInfo { - /** Ticket number for the role eligibility */ - ticketNumber?: string; - /** Ticket system name for the role eligibility */ - ticketSystem?: string; -} - -/** Role eligibility schedule request list operation result. */ -export interface RoleEligibilityScheduleRequestListResult { - /** Role eligibility schedule request list. */ - value?: RoleEligibilityScheduleRequest[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** Role management policy */ -export interface RoleManagementPolicy { +/** Access Review. */ +export interface AccessReviewScheduleDefinitionProperties { + /** The display name for the schedule definition. */ + displayName?: string; /** - * The role management policy Id. + * This read-only field specifies the status of an accessReview. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly status?: AccessReviewScheduleDefinitionStatus; + /** The description provided by the access review creator and visible to admins. */ + descriptionForAdmins?: string; + /** The description provided by the access review creator to be shown to reviewers. */ + descriptionForReviewers?: string; + /** This is the collection of reviewers. */ + reviewers?: AccessReviewReviewer[]; + /** This is the collection of backup reviewers. */ + backupReviewers?: AccessReviewReviewer[]; /** - * The role management policy name. + * 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. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; + /** This is the collection of instances returned when one does an expand on it. */ + instances?: AccessReviewInstance[]; /** - * The role management policy type. + * ResourceId in which this review is getting created * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - /** The role management policy scope. */ - scope?: string; - /** The role management policy display name. */ - displayName?: string; - /** The role management policy description. */ - description?: string; - /** The role management policy is default policy. */ - isOrganizationDefault?: boolean; + readonly resourceId?: string; /** - * The name of the entity last modified it + * This is used to indicate the role being reviewed * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastModifiedBy?: Principal; + readonly roleDefinitionId?: string; /** - * The last modified date time. + * The identity type user/servicePrincipal to review * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastModifiedDateTime?: Date; - /** The rule applied to the policy. */ - rules?: RoleManagementPolicyRuleUnion[]; + readonly principalTypeScopePrincipalType?: AccessReviewScopePrincipalType; /** - * The readonly computed rule applied to the policy. + * The role assignment state eligible/active to review * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly effectiveRules?: RoleManagementPolicyRuleUnion[]; + readonly assignmentState?: AccessReviewScopeAssignmentState; + /** Duration users are inactive for. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + inactiveDuration?: string; + /** Flag to indicate whether to expand nested memberships or not. */ + expandNestedMemberships?: boolean; + /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ + mailNotificationsEnabled?: boolean; + /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ + reminderNotificationsEnabled?: boolean; + /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ + defaultDecisionEnabled?: boolean; + /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ + justificationRequiredOnApproval?: boolean; + /** This specifies the behavior for the autoReview feature when an access review completes. */ + defaultDecision?: DefaultDecisionType; + /** 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. */ + autoApplyDecisionsEnabled?: boolean; + /** Flag to indicate whether showing recommendations to reviewers is enabled. */ + recommendationsEnabled?: boolean; + /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + recommendationLookBackDuration?: string; + /** The duration in days for an instance. */ + instanceDurationInDays?: number; + /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ + typeSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; + /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ + numberOfOccurrences?: number; + /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ + startDate?: Date; + /** The DateTime when the review is scheduled to end. Required if type is endDate */ + endDate?: Date; + /** The recurrence type : weekly, monthly, etc. */ + typeSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; + /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ + interval?: number; /** - * Additional properties of scope + * The identity id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly policyProperties?: PolicyProperties; -} - -/** The name of the entity last modified it */ -export interface Principal { - /** The id of the principal made changes */ - id?: string; - /** The name of the principal made changes */ - displayName?: string; - /** Type of principal such as user , group etc */ - type?: string; - /** Email of principal */ - email?: string; -} - -/** The role management policy rule. */ -export interface RoleManagementPolicyRule { - /** Polymorphic discriminator, which specifies the different types this object can be */ - ruleType: - | "RoleManagementPolicyApprovalRule" - | "RoleManagementPolicyAuthenticationContextRule" - | "RoleManagementPolicyEnablementRule" - | "RoleManagementPolicyExpirationRule" - | "RoleManagementPolicyNotificationRule"; - /** The id of the rule. */ - id?: string; - /** The target of the current rule. */ - target?: RoleManagementPolicyRuleTarget; -} - -/** The role management policy rule target. */ -export interface RoleManagementPolicyRuleTarget { - /** The caller of the setting. */ - caller?: string; - /** The type of operation. */ - operations?: string[]; - /** The assignment level to which it is applied. */ - level?: string; - /** The list of target objects. */ - targetObjects?: string[]; - /** The list of inheritable settings. */ - inheritableSettings?: string[]; - /** The list of enforced settings. */ - enforcedSettings?: string[]; -} - -export interface PolicyProperties { + readonly principalId?: string; /** - * Details of the resource scope + * The identity type : user/servicePrincipal * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: PolicyPropertiesScope; -} - -/** Details of the resource scope */ -export interface PolicyPropertiesScope { - /** Scope id of the resource */ - id?: string; - /** Display name of the resource */ - displayName?: string; - /** Type of the resource */ - type?: string; + readonly principalTypeCreatedByPrincipalType?: AccessReviewActorIdentityType; + /** + * The identity display name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalName?: string; + /** + * The user principal name(if valid) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userPrincipalName?: string; } -/** Role management policy list operation result. */ -export interface RoleManagementPolicyListResult { - /** Role management policy list. */ - value?: RoleManagementPolicy[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; +/** Settings of an Access Review. */ +export interface AccessReviewScheduleSettings { + /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ + mailNotificationsEnabled?: boolean; + /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ + reminderNotificationsEnabled?: boolean; + /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ + defaultDecisionEnabled?: boolean; + /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ + justificationRequiredOnApproval?: boolean; + /** This specifies the behavior for the autoReview feature when an access review completes. */ + defaultDecision?: DefaultDecisionType; + /** 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. */ + autoApplyDecisionsEnabled?: boolean; + /** Flag to indicate whether showing recommendations to reviewers is enabled. */ + recommendationsEnabled?: boolean; + /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + recommendationLookBackDuration?: string; + /** The duration in days for an instance. */ + instanceDurationInDays?: number; + /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ + typeRecurrenceRangeType?: AccessReviewRecurrenceRangeType; + /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ + numberOfOccurrences?: number; + /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ + startDate?: Date; + /** The DateTime when the review is scheduled to end. Required if type is endDate */ + endDate?: Date; + /** The recurrence type : weekly, monthly, etc. */ + typeRecurrencePatternType?: AccessReviewRecurrencePatternType; + /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ + interval?: number; +} + +/** Descriptor for what needs to be reviewed */ +export interface AccessReviewReviewer { + /** The id of the reviewer(user/servicePrincipal) */ + principalId?: string; + /** + * The identity type : user/servicePrincipal + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalType?: AccessReviewReviewerType; } -/** Role management policy */ -export interface RoleManagementPolicyAssignment { +/** Access Review Instance. */ +export interface AccessReviewInstance { /** - * The role management policy Id. + * The access review instance id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The role management policy name. + * The access review instance name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The role management policy type. + * The resource type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The role management policy scope. */ - scope?: string; - /** The role definition of management policy assignment. */ - roleDefinitionId?: string; - /** The policy id role management policy assignment. */ - policyId?: string; /** - * Additional properties of scope, role definition and policy + * This read-only field specifies the status of an access review instance. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly policyAssignmentProperties?: PolicyAssignmentProperties; -} - -export interface PolicyAssignmentProperties { - /** Details of the resource scope */ - scope?: PolicyAssignmentPropertiesScope; - /** Details of role definition */ - roleDefinition?: PolicyAssignmentPropertiesRoleDefinition; - /** Details of the policy */ - policy?: PolicyAssignmentPropertiesPolicy; -} - -/** Details of the resource scope */ -export interface PolicyAssignmentPropertiesScope { - /** Scope id of the resource */ - id?: string; - /** Display name of the resource */ - displayName?: string; - /** Type of the resource */ - type?: string; -} - -/** Details of role definition */ -export interface PolicyAssignmentPropertiesRoleDefinition { - /** Id of the role definition */ - id?: string; - /** Display name of the role definition */ - displayName?: string; - /** Type of the role definition */ - type?: string; + readonly status?: AccessReviewInstanceStatus; + /** The DateTime when the review instance is scheduled to be start. */ + startDateTime?: Date; + /** The DateTime when the review instance is scheduled to end. */ + endDateTime?: Date; + /** This is the collection of reviewers. */ + reviewers?: AccessReviewReviewer[]; + /** This is the collection of backup reviewers. */ + backupReviewers?: AccessReviewReviewer[]; + /** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reviewersType?: AccessReviewInstanceReviewersType; } -/** Details of the policy */ -export interface PolicyAssignmentPropertiesPolicy { - /** Id of the policy */ - id?: string; +/** Access Review Instance properties. */ +export interface AccessReviewInstanceProperties { /** - * The name of the entity last modified it + * This read-only field specifies the status of an access review instance. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastModifiedBy?: Principal; - /** The last modified date time. */ - lastModifiedDateTime?: Date; + readonly status?: AccessReviewInstanceStatus; + /** The DateTime when the review instance is scheduled to be start. */ + startDateTime?: Date; + /** The DateTime when the review instance is scheduled to end. */ + endDateTime?: Date; + /** This is the collection of reviewers. */ + reviewers?: AccessReviewReviewer[]; + /** This is the collection of backup reviewers. */ + backupReviewers?: AccessReviewReviewer[]; + /** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reviewersType?: AccessReviewInstanceReviewersType; } -/** Role management policy assignment list operation result. */ -export interface RoleManagementPolicyAssignmentListResult { - /** Role management policy assignment list. */ - value?: RoleManagementPolicyAssignment[]; +/** List of Access Review Instances. */ +export interface AccessReviewInstanceListResult { + /** Access Review Instance list. */ + value?: AccessReviewInstance[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Eligible child resources list operation result. */ -export interface EligibleChildResourcesListResult { - /** Eligible child resource list. */ - value?: EligibleChildResource[]; +/** List of access review decisions. */ +export interface AccessReviewDecisionListResult { + /** Access Review Decision list. */ + value?: AccessReviewDecision[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Eligible child resource */ -export interface EligibleChildResource { +/** Access Review. */ +export interface AccessReviewDecision { /** - * The resource scope Id. + * The access review decision id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The resource name. + * The access review decision name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; @@ -740,1091 +665,990 @@ export interface EligibleChildResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; -} - -/** Role assignment list operation result. */ -export interface RoleAssignmentListResult { - /** Role assignment list. */ - value?: RoleAssignment[]; /** - * The URL to use for getting the next set of results. + * The feature- generated recommendation shown to the reviewer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** Role Assignments */ -export interface RoleAssignment { + readonly recommendation?: AccessRecommendationType; + /** The decision on the approval step. This value is initially set to NotReviewed. Approvers can take action of Approve/Deny */ + decision?: AccessReviewResult; + /** Justification provided by approvers for their action */ + justification?: string; /** - * The role assignment ID. + * Date Time when a decision was taken. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly reviewedDateTime?: Date; /** - * The role assignment name. + * The outcome of applying the decision. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly applyResult?: AccessReviewApplyResult; /** - * The role assignment type. + * The date and time when the review decision was applied. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly appliedDateTime?: Date; /** - * The role assignment scope. + * The identity id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; - /** The role definition ID. */ - roleDefinitionId?: string; - /** The principal ID. */ - principalId?: string; - /** The principal type of the assigned principal ID. */ - principalType?: PrincipalType; - /** Description of role assignment */ - description?: string; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; + readonly principalIdPropertiesAppliedByPrincipalId?: string; /** - * Time it was created + * The identity type : user/servicePrincipal * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdOn?: Date; + readonly principalTypePropertiesAppliedByPrincipalType?: AccessReviewActorIdentityType; /** - * Time it was updated + * The identity display name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updatedOn?: Date; + readonly principalNamePropertiesAppliedByPrincipalName?: string; /** - * Id of the user who created the assignment + * The user principal name(if valid) * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdBy?: string; + readonly userPrincipalNamePropertiesAppliedByUserPrincipalName?: string; /** - * Id of the user who updated the assignment + * The identity id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updatedBy?: string; - /** Id of the delegated managed identity resource */ - delegatedManagedIdentityResourceId?: string; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { + readonly principalIdPropertiesReviewedByPrincipalId?: string; /** - * The error code. + * The identity type : user/servicePrincipal * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly principalTypePropertiesReviewedByPrincipalType?: AccessReviewActorIdentityType; /** - * The error message. + * The identity display name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly principalNamePropertiesReviewedByPrincipalName?: string; /** - * The error target. + * The user principal name(if valid) * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly userPrincipalNamePropertiesReviewedByUserPrincipalName?: string; + /** The type of resource: azureRole */ + typePropertiesResourceType?: DecisionResourceType; /** - * The error details. + * The id of resource associated with a decision record. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorDetail[]; + readonly idPropertiesResourceId?: string; /** - * The error additional info. + * The display name of resource associated with a decision record. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { + readonly displayNamePropertiesResourceDisplayName?: string; + /** The type of decision target : User/ServicePrincipal */ + typePropertiesPrincipalType?: DecisionTargetType; /** - * The additional info type. + * The id of principal whose access was reviewed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly idPropertiesPrincipalId?: string; /** - * The additional info. + * The display name of the user whose access was reviewed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly info?: Record; + readonly displayNamePropertiesPrincipalDisplayName?: string; } -/** Role assignment create parameters. */ -export interface RoleAssignmentCreateParameters { +/** Approval Step. */ +export interface AccessReviewDecisionProperties { /** - * The role assignment scope. + * The feature- generated recommendation shown to the reviewer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; - /** The role definition ID. */ - roleDefinitionId: string; - /** The principal ID. */ - principalId: string; - /** The principal type of the assigned principal ID. */ - principalType?: PrincipalType; - /** Description of role assignment */ - description?: string; - /** 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' */ - condition?: string; - /** Version of the condition. Currently accepted value is '2.0' */ - conditionVersion?: string; + readonly recommendation?: AccessRecommendationType; + /** The decision on the approval step. This value is initially set to NotReviewed. Approvers can take action of Approve/Deny */ + decision?: AccessReviewResult; + /** Justification provided by approvers for their action */ + justification?: string; /** - * Time it was created + * Date Time when a decision was taken. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdOn?: Date; + readonly reviewedDateTime?: Date; /** - * Time it was updated + * The outcome of applying the decision. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updatedOn?: Date; + readonly applyResult?: AccessReviewApplyResult; /** - * Id of the user who created the assignment + * The date and time when the review decision was applied. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdBy?: string; + readonly appliedDateTime?: Date; /** - * Id of the user who updated the assignment + * The identity id * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updatedBy?: string; - /** Id of the delegated managed identity resource */ - delegatedManagedIdentityResourceId?: string; -} - -/** Validation response */ -export interface ValidationResponse { + readonly principalIdAppliedByPrincipalId?: string; /** - * Whether or not validation succeeded + * The identity type : user/servicePrincipal * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isValid?: boolean; - /** Failed validation result details */ - errorInfo?: ValidationResponseErrorInfo; -} - -/** Failed validation result details */ -export interface ValidationResponseErrorInfo { + readonly principalTypeAppliedByPrincipalType?: AccessReviewActorIdentityType; /** - * Error code indicating why validation failed + * The identity display name * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly principalNameAppliedByPrincipalName?: string; /** - * Message indicating why validation failed + * The user principal name(if valid) * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; -} - -/** Role assignment schedule filter */ -export interface RoleAssignmentScheduleFilter { - /** Returns role assignment schedule of the specific principal. */ - principalId?: string; - /** Returns role assignment schedule of the specific role definition. */ - roleDefinitionId?: string; - /** Returns role assignment schedule instances of the specific status. */ - status?: string; -} - -/** Role assignment schedule instance filter */ -export interface RoleAssignmentScheduleInstanceFilter { - /** Returns role assignment schedule instances of the specific principal. */ - principalId?: string; - /** Returns role assignment schedule instances of the specific role definition. */ - roleDefinitionId?: string; - /** Returns role assignment schedule instances of the specific status. */ - status?: string; - /** Returns role assignment schedule instances belonging to a specific role assignment schedule. */ - roleAssignmentScheduleId?: string; -} - -/** Role assignment schedule request filter */ -export interface RoleAssignmentScheduleRequestFilter { - /** Returns role assignment requests of the specific principal. */ - principalId?: string; - /** Returns role assignment requests of the specific role definition. */ - roleDefinitionId?: string; - /** Returns role assignment requests created by specific principal. */ - requestorId?: string; - /** Returns role assignment requests of specific status. */ - status?: string; -} - -/** Role eligibility schedule filter */ -export interface RoleEligibilityScheduleFilter { - /** Returns role eligibility schedule of the specific principal. */ - principalId?: string; - /** Returns role eligibility schedule of the specific role definition. */ - roleDefinitionId?: string; - /** Returns role eligibility schedule of the specific status. */ - status?: string; -} - -/** Role eligibility schedule instance filter */ -export interface RoleEligibilityScheduleInstanceFilter { - /** Returns role eligibility schedule instances of the specific principal. */ - principalId?: string; - /** Returns role eligibility schedule instances of the specific role definition. */ - roleDefinitionId?: string; - /** Returns role eligibility schedule instances of the specific status. */ - status?: string; - /** Returns role eligibility schedule instances belonging to a specific role eligibility schedule. */ - roleEligibilityScheduleId?: string; -} - -/** Role eligibility schedule request filter */ -export interface RoleEligibilityScheduleRequestFilter { - /** Returns role eligibility requests of the specific principal. */ - principalId?: string; - /** Returns role eligibility requests of the specific role definition. */ - roleDefinitionId?: string; - /** Returns role eligibility requests created by specific principal. */ - requestorId?: string; - /** Returns role eligibility requests of specific status. */ - status?: string; + readonly userPrincipalNameAppliedByUserPrincipalName?: string; + /** + * The identity id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalIdReviewedByPrincipalId?: string; + /** + * The identity type : user/servicePrincipal + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalTypeReviewedByPrincipalType?: AccessReviewActorIdentityType; + /** + * The identity display name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalNameReviewedByPrincipalName?: string; + /** + * The user principal name(if valid) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userPrincipalNameReviewedByUserPrincipalName?: string; + /** The type of resource: azureRole */ + typeResourceType?: DecisionResourceType; + /** + * The id of resource associated with a decision record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly idResourceId?: string; + /** + * The display name of resource associated with a decision record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayNameResourceDisplayName?: string; + /** The type of decision target : User/ServicePrincipal */ + typePrincipalType?: DecisionTargetType; + /** + * The id of principal whose access was reviewed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly idPrincipalId?: string; + /** + * The display name of the user whose access was reviewed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayNamePrincipalDisplayName?: string; } -/** The approval settings. */ -export interface ApprovalSettings { - /** Determine whether approval is required or not. */ - isApprovalRequired?: boolean; - /** Determine whether approval is required for assignment extension. */ - isApprovalRequiredForExtension?: boolean; - /** Determine whether requestor justification required. */ - isRequestorJustificationRequired?: boolean; - /** The type of rule */ - approvalMode?: ApprovalMode; - /** The approval stages of the request. */ - approvalStages?: ApprovalStage[]; +/** Target of the decision. */ +export interface AccessReviewDecisionIdentity { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "user" | "servicePrincipal"; + /** + * The id of principal whose access was reviewed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The display name of the user whose access was reviewed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; } -/** The approval stage. */ -export interface ApprovalStage { - /** The time in days when approval request would be timed out. */ - approvalStageTimeOutInDays?: number; - /** Determine whether approver need to provide justification for his decision. */ - isApproverJustificationRequired?: boolean; - /** The time in minutes when the approval request would be escalated if the primary approver does not approves. */ - escalationTimeInMinutes?: number; - /** The primary approver of the request. */ - primaryApprovers?: UserSet[]; - /** The value determine whether escalation feature is enabled. */ - isEscalationEnabled?: boolean; - /** The escalation approver of the request. */ - escalationApprovers?: UserSet[]; +/** Target of the decision. */ +export interface AccessReviewDecisionResource { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "azureRole"; + /** + * The id of resource associated with a decision record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The display name of resource associated with a decision record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; } -/** The detail of a user. */ -export interface UserSet { - /** The type of user. */ - userType?: UserType; - /** The value indicating whether the user is a backup fallback approver */ - isBackup?: boolean; - /** The object id of the user. */ - id?: string; - /** The description of the user. */ - description?: string; +/** List of access review contacted reviewers. */ +export interface AccessReviewContactedReviewerListResult { + /** Access Review Contacted Reviewer. */ + value?: AccessReviewContactedReviewer[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; } -/** Role Assignments filter */ -export interface RoleAssignmentFilter { - /** Returns role assignment of the specific principal. */ - principalId?: string; +/** Access Review Contacted Reviewer. */ +export interface AccessReviewContactedReviewer { + /** + * The access review reviewer id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The access review reviewer id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The display name of the reviewer + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userDisplayName?: string; + /** + * The user principal name of the reviewer + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userPrincipalName?: string; + /** + * Date Time when the reviewer was contacted. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdDateTime?: Date; } -/** The role management policy rule. */ -export type RoleManagementPolicyApprovalRule = RoleManagementPolicyRule & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - ruleType: "RoleManagementPolicyApprovalRule"; - /** The approval setting */ - setting?: ApprovalSettings; -}; - -/** The role management policy rule. */ -export type RoleManagementPolicyAuthenticationContextRule = RoleManagementPolicyRule & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - ruleType: "RoleManagementPolicyAuthenticationContextRule"; - /** The value indicating if rule is enabled. */ - isEnabled?: boolean; - /** The claim value. */ - claimValue?: string; -}; - -/** The role management policy rule. */ -export type RoleManagementPolicyEnablementRule = RoleManagementPolicyRule & { +/** Access Review Default Settings. */ +export interface AccessReviewDefaultSettings { + /** + * The access review default settings id. This is only going to be default + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The access review default settings name. This is always going to be Access Review Default Settings + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ + mailNotificationsEnabled?: boolean; + /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ + reminderNotificationsEnabled?: boolean; + /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ + defaultDecisionEnabled?: boolean; + /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ + justificationRequiredOnApproval?: boolean; + /** This specifies the behavior for the autoReview feature when an access review completes. */ + defaultDecision?: DefaultDecisionType; + /** 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. */ + autoApplyDecisionsEnabled?: boolean; + /** Flag to indicate whether showing recommendations to reviewers is enabled. */ + recommendationsEnabled?: boolean; + /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ + recommendationLookBackDuration?: string; + /** The duration in days for an instance. */ + instanceDurationInDays?: number; + /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ + typePropertiesRecurrenceRangeType?: AccessReviewRecurrenceRangeType; + /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ + numberOfOccurrences?: number; + /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ + startDate?: Date; + /** The DateTime when the review is scheduled to end. Required if type is endDate */ + endDate?: Date; + /** The recurrence type : weekly, monthly, etc. */ + typePropertiesRecurrencePatternType?: AccessReviewRecurrencePatternType; + /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ + interval?: number; +} + +/** User Decision Target */ +export type AccessReviewDecisionUserIdentity = AccessReviewDecisionIdentity & { /** Polymorphic discriminator, which specifies the different types this object can be */ - ruleType: "RoleManagementPolicyEnablementRule"; - /** The list of enabled rules. */ - enabledRules?: EnablementRules[]; + type: "user"; + /** + * The user principal name of the user whose access was reviewed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userPrincipalName?: string; }; -/** The role management policy rule. */ -export type RoleManagementPolicyExpirationRule = RoleManagementPolicyRule & { +/** Service Principal Decision Target */ +export type AccessReviewDecisionServicePrincipalIdentity = AccessReviewDecisionIdentity & { /** Polymorphic discriminator, which specifies the different types this object can be */ - ruleType: "RoleManagementPolicyExpirationRule"; - /** The value indicating whether expiration is required. */ - isExpirationRequired?: boolean; - /** The maximum duration of expiration in timespan. */ - maximumDuration?: string; + type: "servicePrincipal"; + /** + * The appId for the service principal entity being reviewed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly appId?: string; }; -/** The role management policy rule. */ -export type RoleManagementPolicyNotificationRule = RoleManagementPolicyRule & { +/** Target of the decision. */ +export type AccessReviewDecisionResourceAzureRole = AccessReviewDecisionResource & { /** Polymorphic discriminator, which specifies the different types this object can be */ - ruleType: "RoleManagementPolicyNotificationRule"; - /** The type of notification. */ - notificationType?: NotificationDeliveryMechanism; - /** The notification level. */ - notificationLevel?: NotificationLevel; - /** The recipient type. */ - recipientType?: RecipientType; - /** The list notification recipients. */ - notificationRecipients?: string[]; - /** Its value determine if the notification need to be sent to the recipient type specified in policy rule. */ - isDefaultRecipientsEnabled?: boolean; + type: "azureRole"; }; -/** Known values of {@link PrincipalType} that the service accepts. */ -export enum KnownPrincipalType { - User = "User", - Group = "Group", - ServicePrincipal = "ServicePrincipal", - Unknown = "Unknown", - DirectoryRoleTemplate = "DirectoryRoleTemplate", - ForeignGroup = "ForeignGroup", - Application = "Application", - MSI = "MSI", - DirectoryObjectOrGroup = "DirectoryObjectOrGroup", - Everyone = "Everyone", - Device = "Device" +/** Known values of {@link AccessReviewResult} that the service accepts. */ +export enum KnownAccessReviewResult { + Approve = "Approve", + Deny = "Deny", + NotReviewed = "NotReviewed", + DontKnow = "DontKnow", + NotNotified = "NotNotified" } /** - * Defines values for PrincipalType. \ - * {@link KnownPrincipalType} can be used interchangeably with PrincipalType, + * Defines values for AccessReviewResult. \ + * {@link KnownAccessReviewResult} can be used interchangeably with AccessReviewResult, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Group** \ - * **ServicePrincipal** \ - * **Unknown** \ - * **DirectoryRoleTemplate** \ - * **ForeignGroup** \ - * **Application** \ - * **MSI** \ - * **DirectoryObjectOrGroup** \ - * **Everyone** \ - * **Device** + * **Approve** \ + * **Deny** \ + * **NotReviewed** \ + * **DontKnow** \ + * **NotNotified** */ -export type PrincipalType = string; +export type AccessReviewResult = string; -/** Known values of {@link AssignmentType} that the service accepts. */ -export enum KnownAssignmentType { - Activated = "Activated", - Assigned = "Assigned" +/** Known values of {@link AccessReviewHistoryDefinitionStatus} that the service accepts. */ +export enum KnownAccessReviewHistoryDefinitionStatus { + Requested = "Requested", + InProgress = "InProgress", + Done = "Done", + Error = "Error" } /** - * Defines values for AssignmentType. \ - * {@link KnownAssignmentType} can be used interchangeably with AssignmentType, + * Defines values for AccessReviewHistoryDefinitionStatus. \ + * {@link KnownAccessReviewHistoryDefinitionStatus} can be used interchangeably with AccessReviewHistoryDefinitionStatus, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Activated** \ - * **Assigned** + * **Requested** \ + * **InProgress** \ + * **Done** \ + * **Error** */ -export type AssignmentType = string; +export type AccessReviewHistoryDefinitionStatus = string; -/** Known values of {@link MemberType} that the service accepts. */ -export enum KnownMemberType { - Inherited = "Inherited", - Direct = "Direct", - Group = "Group" +/** Known values of {@link AccessReviewActorIdentityType} that the service accepts. */ +export enum KnownAccessReviewActorIdentityType { + User = "user", + ServicePrincipal = "servicePrincipal" } /** - * Defines values for MemberType. \ - * {@link KnownMemberType} can be used interchangeably with MemberType, + * Defines values for AccessReviewActorIdentityType. \ + * {@link KnownAccessReviewActorIdentityType} can be used interchangeably with AccessReviewActorIdentityType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Inherited** \ - * **Direct** \ - * **Group** + * **user** \ + * **servicePrincipal** */ -export type MemberType = string; - -/** Known values of {@link Status} that the service accepts. */ -export enum KnownStatus { - Accepted = "Accepted", - PendingEvaluation = "PendingEvaluation", - Granted = "Granted", - Denied = "Denied", - PendingProvisioning = "PendingProvisioning", - Provisioned = "Provisioned", - PendingRevocation = "PendingRevocation", - Revoked = "Revoked", - Canceled = "Canceled", - Failed = "Failed", - PendingApprovalProvisioning = "PendingApprovalProvisioning", - PendingApproval = "PendingApproval", - FailedAsResourceIsLocked = "FailedAsResourceIsLocked", - PendingAdminDecision = "PendingAdminDecision", - AdminApproved = "AdminApproved", - AdminDenied = "AdminDenied", - TimedOut = "TimedOut", - ProvisioningStarted = "ProvisioningStarted", - Invalid = "Invalid", - PendingScheduleCreation = "PendingScheduleCreation", - ScheduleCreated = "ScheduleCreated", - PendingExternalProvisioning = "PendingExternalProvisioning" +export type AccessReviewActorIdentityType = string; + +/** Known values of {@link AccessReviewScopePrincipalType} that the service accepts. */ +export enum KnownAccessReviewScopePrincipalType { + User = "user", + GuestUser = "guestUser", + ServicePrincipal = "servicePrincipal", + UserGroup = "user,group", + RedeemedGuestUser = "redeemedGuestUser" } /** - * Defines values for Status. \ - * {@link KnownStatus} can be used interchangeably with Status, + * Defines values for AccessReviewScopePrincipalType. \ + * {@link KnownAccessReviewScopePrincipalType} can be used interchangeably with AccessReviewScopePrincipalType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Accepted** \ - * **PendingEvaluation** \ - * **Granted** \ - * **Denied** \ - * **PendingProvisioning** \ - * **Provisioned** \ - * **PendingRevocation** \ - * **Revoked** \ - * **Canceled** \ - * **Failed** \ - * **PendingApprovalProvisioning** \ - * **PendingApproval** \ - * **FailedAsResourceIsLocked** \ - * **PendingAdminDecision** \ - * **AdminApproved** \ - * **AdminDenied** \ - * **TimedOut** \ - * **ProvisioningStarted** \ - * **Invalid** \ - * **PendingScheduleCreation** \ - * **ScheduleCreated** \ - * **PendingExternalProvisioning** + * **user** \ + * **guestUser** \ + * **servicePrincipal** \ + * **user,group** \ + * **redeemedGuestUser** */ -export type Status = string; - -/** Known values of {@link RequestType} that the service accepts. */ -export enum KnownRequestType { - AdminAssign = "AdminAssign", - AdminRemove = "AdminRemove", - AdminUpdate = "AdminUpdate", - AdminExtend = "AdminExtend", - AdminRenew = "AdminRenew", - SelfActivate = "SelfActivate", - SelfDeactivate = "SelfDeactivate", - SelfExtend = "SelfExtend", - SelfRenew = "SelfRenew" +export type AccessReviewScopePrincipalType = string; + +/** Known values of {@link AccessReviewScopeAssignmentState} that the service accepts. */ +export enum KnownAccessReviewScopeAssignmentState { + Eligible = "eligible", + Active = "active" } /** - * Defines values for RequestType. \ - * {@link KnownRequestType} can be used interchangeably with RequestType, + * Defines values for AccessReviewScopeAssignmentState. \ + * {@link KnownAccessReviewScopeAssignmentState} can be used interchangeably with AccessReviewScopeAssignmentState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **AdminAssign** \ - * **AdminRemove** \ - * **AdminUpdate** \ - * **AdminExtend** \ - * **AdminRenew** \ - * **SelfActivate** \ - * **SelfDeactivate** \ - * **SelfExtend** \ - * **SelfRenew** + * **eligible** \ + * **active** */ -export type RequestType = string; +export type AccessReviewScopeAssignmentState = string; -/** Known values of {@link Type} that the service accepts. */ -export enum KnownType { - AfterDuration = "AfterDuration", - AfterDateTime = "AfterDateTime", - NoExpiration = "NoExpiration" +/** Known values of {@link AccessReviewRecurrencePatternType} that the service accepts. */ +export enum KnownAccessReviewRecurrencePatternType { + Weekly = "weekly", + AbsoluteMonthly = "absoluteMonthly" } /** - * Defines values for Type. \ - * {@link KnownType} can be used interchangeably with Type, + * Defines values for AccessReviewRecurrencePatternType. \ + * {@link KnownAccessReviewRecurrencePatternType} can be used interchangeably with AccessReviewRecurrencePatternType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **AfterDuration** \ - * **AfterDateTime** \ - * **NoExpiration** + * **weekly** \ + * **absoluteMonthly** */ -export type Type = string; - -/** Known values of {@link RoleManagementPolicyRuleType} that the service accepts. */ -export enum KnownRoleManagementPolicyRuleType { - RoleManagementPolicyApprovalRule = "RoleManagementPolicyApprovalRule", - RoleManagementPolicyAuthenticationContextRule = "RoleManagementPolicyAuthenticationContextRule", - RoleManagementPolicyEnablementRule = "RoleManagementPolicyEnablementRule", - RoleManagementPolicyExpirationRule = "RoleManagementPolicyExpirationRule", - RoleManagementPolicyNotificationRule = "RoleManagementPolicyNotificationRule" +export type AccessReviewRecurrencePatternType = string; + +/** Known values of {@link AccessReviewRecurrenceRangeType} that the service accepts. */ +export enum KnownAccessReviewRecurrenceRangeType { + EndDate = "endDate", + NoEnd = "noEnd", + Numbered = "numbered" } /** - * Defines values for RoleManagementPolicyRuleType. \ - * {@link KnownRoleManagementPolicyRuleType} can be used interchangeably with RoleManagementPolicyRuleType, + * Defines values for AccessReviewRecurrenceRangeType. \ + * {@link KnownAccessReviewRecurrenceRangeType} can be used interchangeably with AccessReviewRecurrenceRangeType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **RoleManagementPolicyApprovalRule** \ - * **RoleManagementPolicyAuthenticationContextRule** \ - * **RoleManagementPolicyEnablementRule** \ - * **RoleManagementPolicyExpirationRule** \ - * **RoleManagementPolicyNotificationRule** + * **endDate** \ + * **noEnd** \ + * **numbered** */ -export type RoleManagementPolicyRuleType = string; - -/** Known values of {@link ApprovalMode} that the service accepts. */ -export enum KnownApprovalMode { - SingleStage = "SingleStage", - Serial = "Serial", - Parallel = "Parallel", - NoApproval = "NoApproval" +export type AccessReviewRecurrenceRangeType = string; + +/** Known values of {@link AccessReviewScheduleDefinitionStatus} that the service accepts. */ +export enum KnownAccessReviewScheduleDefinitionStatus { + NotStarted = "NotStarted", + InProgress = "InProgress", + Completed = "Completed", + Applied = "Applied", + Initializing = "Initializing", + Applying = "Applying", + Completing = "Completing", + Scheduled = "Scheduled", + AutoReviewing = "AutoReviewing", + AutoReviewed = "AutoReviewed", + Starting = "Starting" } /** - * Defines values for ApprovalMode. \ - * {@link KnownApprovalMode} can be used interchangeably with ApprovalMode, + * Defines values for AccessReviewScheduleDefinitionStatus. \ + * {@link KnownAccessReviewScheduleDefinitionStatus} can be used interchangeably with AccessReviewScheduleDefinitionStatus, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **SingleStage** \ - * **Serial** \ - * **Parallel** \ - * **NoApproval** + * **NotStarted** \ + * **InProgress** \ + * **Completed** \ + * **Applied** \ + * **Initializing** \ + * **Applying** \ + * **Completing** \ + * **Scheduled** \ + * **AutoReviewing** \ + * **AutoReviewed** \ + * **Starting** */ -export type ApprovalMode = string; +export type AccessReviewScheduleDefinitionStatus = string; -/** Known values of {@link UserType} that the service accepts. */ -export enum KnownUserType { - User = "User", - Group = "Group" +/** Known values of {@link DefaultDecisionType} that the service accepts. */ +export enum KnownDefaultDecisionType { + Approve = "Approve", + Deny = "Deny", + Recommendation = "Recommendation" } /** - * Defines values for UserType. \ - * {@link KnownUserType} can be used interchangeably with UserType, + * Defines values for DefaultDecisionType. \ + * {@link KnownDefaultDecisionType} can be used interchangeably with DefaultDecisionType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Group** + * **Approve** \ + * **Deny** \ + * **Recommendation** */ -export type UserType = string; +export type DefaultDecisionType = string; -/** Known values of {@link EnablementRules} that the service accepts. */ -export enum KnownEnablementRules { - MultiFactorAuthentication = "MultiFactorAuthentication", - Justification = "Justification", - Ticketing = "Ticketing" +/** Known values of {@link AccessReviewReviewerType} that the service accepts. */ +export enum KnownAccessReviewReviewerType { + User = "user", + ServicePrincipal = "servicePrincipal" } /** - * Defines values for EnablementRules. \ - * {@link KnownEnablementRules} can be used interchangeably with EnablementRules, + * Defines values for AccessReviewReviewerType. \ + * {@link KnownAccessReviewReviewerType} can be used interchangeably with AccessReviewReviewerType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **MultiFactorAuthentication** \ - * **Justification** \ - * **Ticketing** + * **user** \ + * **servicePrincipal** */ -export type EnablementRules = string; +export type AccessReviewReviewerType = string; -/** Known values of {@link NotificationDeliveryMechanism} that the service accepts. */ -export enum KnownNotificationDeliveryMechanism { - Email = "Email" +/** Known values of {@link AccessReviewScheduleDefinitionReviewersType} that the service accepts. */ +export enum KnownAccessReviewScheduleDefinitionReviewersType { + Assigned = "Assigned", + Self = "Self", + Managers = "Managers" } /** - * Defines values for NotificationDeliveryMechanism. \ - * {@link KnownNotificationDeliveryMechanism} can be used interchangeably with NotificationDeliveryMechanism, + * Defines values for AccessReviewScheduleDefinitionReviewersType. \ + * {@link KnownAccessReviewScheduleDefinitionReviewersType} can be used interchangeably with AccessReviewScheduleDefinitionReviewersType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Email** + * **Assigned** \ + * **Self** \ + * **Managers** */ -export type NotificationDeliveryMechanism = string; - -/** Known values of {@link NotificationLevel} that the service accepts. */ -export enum KnownNotificationLevel { - None = "None", - Critical = "Critical", - All = "All" +export type AccessReviewScheduleDefinitionReviewersType = string; + +/** Known values of {@link AccessReviewInstanceStatus} that the service accepts. */ +export enum KnownAccessReviewInstanceStatus { + NotStarted = "NotStarted", + InProgress = "InProgress", + Completed = "Completed", + Applied = "Applied", + Initializing = "Initializing", + Applying = "Applying", + Completing = "Completing", + Scheduled = "Scheduled", + AutoReviewing = "AutoReviewing", + AutoReviewed = "AutoReviewed", + Starting = "Starting" } /** - * Defines values for NotificationLevel. \ - * {@link KnownNotificationLevel} can be used interchangeably with NotificationLevel, + * Defines values for AccessReviewInstanceStatus. \ + * {@link KnownAccessReviewInstanceStatus} can be used interchangeably with AccessReviewInstanceStatus, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **None** \ - * **Critical** \ - * **All** + * **NotStarted** \ + * **InProgress** \ + * **Completed** \ + * **Applied** \ + * **Initializing** \ + * **Applying** \ + * **Completing** \ + * **Scheduled** \ + * **AutoReviewing** \ + * **AutoReviewed** \ + * **Starting** */ -export type NotificationLevel = string; +export type AccessReviewInstanceStatus = string; -/** Known values of {@link RecipientType} that the service accepts. */ -export enum KnownRecipientType { - Requestor = "Requestor", - Approver = "Approver", - Admin = "Admin" +/** Known values of {@link AccessReviewInstanceReviewersType} that the service accepts. */ +export enum KnownAccessReviewInstanceReviewersType { + Assigned = "Assigned", + Self = "Self", + Managers = "Managers" } /** - * Defines values for RecipientType. \ - * {@link KnownRecipientType} can be used interchangeably with RecipientType, + * Defines values for AccessReviewInstanceReviewersType. \ + * {@link KnownAccessReviewInstanceReviewersType} can be used interchangeably with AccessReviewInstanceReviewersType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Requestor** \ - * **Approver** \ - * **Admin** + * **Assigned** \ + * **Self** \ + * **Managers** */ -export type RecipientType = string; - -/** Optional parameters. */ -export interface RoleAssignmentSchedulesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type RoleAssignmentSchedulesGetResponse = RoleAssignmentSchedule; +export type AccessReviewInstanceReviewersType = string; -/** Optional parameters. */ -export interface RoleAssignmentSchedulesListForScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. */ - filter?: string; +/** Known values of {@link DecisionTargetType} that the service accepts. */ +export enum KnownDecisionTargetType { + User = "user", + ServicePrincipal = "servicePrincipal" } -/** Contains response data for the listForScope operation. */ -export type RoleAssignmentSchedulesListForScopeResponse = RoleAssignmentScheduleListResult; +/** + * Defines values for DecisionTargetType. \ + * {@link KnownDecisionTargetType} can be used interchangeably with DecisionTargetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **servicePrincipal** + */ +export type DecisionTargetType = string; -/** Optional parameters. */ -export interface RoleAssignmentSchedulesListForScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. */ - filter?: string; +/** Known values of {@link DecisionResourceType} that the service accepts. */ +export enum KnownDecisionResourceType { + AzureRole = "azureRole" } -/** Contains response data for the listForScopeNext operation. */ -export type RoleAssignmentSchedulesListForScopeNextResponse = RoleAssignmentScheduleListResult; +/** + * Defines values for DecisionResourceType. \ + * {@link KnownDecisionResourceType} can be used interchangeably with DecisionResourceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **azureRole** + */ +export type DecisionResourceType = string; -/** Optional parameters. */ -export interface RoleAssignmentScheduleInstancesListForScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. */ - filter?: string; +/** Known values of {@link AccessRecommendationType} that the service accepts. */ +export enum KnownAccessRecommendationType { + Approve = "Approve", + Deny = "Deny", + NoInfoAvailable = "NoInfoAvailable" } -/** Contains response data for the listForScope operation. */ -export type RoleAssignmentScheduleInstancesListForScopeResponse = RoleAssignmentScheduleInstanceListResult; - -/** Optional parameters. */ -export interface RoleAssignmentScheduleInstancesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type RoleAssignmentScheduleInstancesGetResponse = RoleAssignmentScheduleInstance; +/** + * Defines values for AccessRecommendationType. \ + * {@link KnownAccessRecommendationType} can be used interchangeably with AccessRecommendationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approve** \ + * **Deny** \ + * **NoInfoAvailable** + */ +export type AccessRecommendationType = string; -/** Optional parameters. */ -export interface RoleAssignmentScheduleInstancesListForScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. */ - filter?: string; +/** Known values of {@link AccessReviewApplyResult} that the service accepts. */ +export enum KnownAccessReviewApplyResult { + New = "New", + Applying = "Applying", + AppliedSuccessfully = "AppliedSuccessfully", + AppliedWithUnknownFailure = "AppliedWithUnknownFailure", + AppliedSuccessfullyButObjectNotFound = "AppliedSuccessfullyButObjectNotFound", + ApplyNotSupported = "ApplyNotSupported" } -/** Contains response data for the listForScopeNext operation. */ -export type RoleAssignmentScheduleInstancesListForScopeNextResponse = RoleAssignmentScheduleInstanceListResult; +/** + * Defines values for AccessReviewApplyResult. \ + * {@link KnownAccessReviewApplyResult} can be used interchangeably with AccessReviewApplyResult, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **New** \ + * **Applying** \ + * **AppliedSuccessfully** \ + * **AppliedWithUnknownFailure** \ + * **AppliedSuccessfullyButObjectNotFound** \ + * **ApplyNotSupported** + */ +export type AccessReviewApplyResult = string; /** Optional parameters. */ -export interface RoleAssignmentScheduleRequestsCreateOptionalParams +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type RoleAssignmentScheduleRequestsCreateResponse = RoleAssignmentScheduleRequest; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface RoleAssignmentScheduleRequestsGetOptionalParams +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type RoleAssignmentScheduleRequestsGetResponse = RoleAssignmentScheduleRequest; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface RoleAssignmentScheduleRequestsListForScopeOptionalParams +export interface AccessReviewHistoryDefinitionsListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. */ + /** The filter to apply on the operation. Only standard filters on definition name and created date are supported */ filter?: string; } -/** Contains response data for the listForScope operation. */ -export type RoleAssignmentScheduleRequestsListForScopeResponse = RoleAssignmentScheduleRequestListResult; +/** Contains response data for the list operation. */ +export type AccessReviewHistoryDefinitionsListResponse = AccessReviewHistoryDefinitionListResult; /** Optional parameters. */ -export interface RoleAssignmentScheduleRequestsCancelOptionalParams +export interface AccessReviewHistoryDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the getById operation. */ +export type AccessReviewHistoryDefinitionsGetByIdResponse = AccessReviewHistoryDefinition; + /** Optional parameters. */ -export interface RoleAssignmentScheduleRequestsListForScopeNextOptionalParams +export interface AccessReviewHistoryDefinitionsListNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. */ + /** The filter to apply on the operation. Only standard filters on definition name and created date are supported */ filter?: string; } -/** Contains response data for the listForScopeNext operation. */ -export type RoleAssignmentScheduleRequestsListForScopeNextResponse = RoleAssignmentScheduleRequestListResult; +/** Contains response data for the listNext operation. */ +export type AccessReviewHistoryDefinitionsListNextResponse = AccessReviewHistoryDefinitionListResult; /** Optional parameters. */ -export interface RoleEligibilitySchedulesGetOptionalParams +export interface AccessReviewHistoryDefinitionCreateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type RoleEligibilitySchedulesGetResponse = RoleEligibilitySchedule; +/** Contains response data for the create operation. */ +export type AccessReviewHistoryDefinitionCreateResponse = AccessReviewHistoryDefinition; /** Optional parameters. */ -export interface RoleEligibilitySchedulesListForScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ - filter?: string; -} - -/** Contains response data for the listForScope operation. */ -export type RoleEligibilitySchedulesListForScopeResponse = RoleEligibilityScheduleListResult; +export interface AccessReviewHistoryDefinitionDeleteByIdOptionalParams + extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface RoleEligibilitySchedulesListForScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ - filter?: string; -} +export interface AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForScopeNext operation. */ -export type RoleEligibilitySchedulesListForScopeNextResponse = RoleEligibilityScheduleListResult; +/** Contains response data for the generateDownloadUri operation. */ +export type AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse = AccessReviewHistoryInstance; /** Optional parameters. */ -export interface RoleEligibilityScheduleInstancesListForScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ - filter?: string; -} +export interface AccessReviewHistoryDefinitionInstancesListOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForScope operation. */ -export type RoleEligibilityScheduleInstancesListForScopeResponse = RoleEligibilityScheduleInstanceListResult; +/** Contains response data for the list operation. */ +export type AccessReviewHistoryDefinitionInstancesListResponse = AccessReviewHistoryDefinitionInstanceListResult; /** Optional parameters. */ -export interface RoleEligibilityScheduleInstancesGetOptionalParams +export interface AccessReviewHistoryDefinitionInstancesListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type RoleEligibilityScheduleInstancesGetResponse = RoleEligibilityScheduleInstance; +/** Contains response data for the listNext operation. */ +export type AccessReviewHistoryDefinitionInstancesListNextResponse = AccessReviewHistoryDefinitionInstanceListResult; /** Optional parameters. */ -export interface RoleEligibilityScheduleInstancesListForScopeNextOptionalParams +export interface AccessReviewScheduleDefinitionsListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ filter?: string; } -/** Contains response data for the listForScopeNext operation. */ -export type RoleEligibilityScheduleInstancesListForScopeNextResponse = RoleEligibilityScheduleInstanceListResult; +/** Contains response data for the list operation. */ +export type AccessReviewScheduleDefinitionsListResponse = AccessReviewScheduleDefinitionListResult; /** Optional parameters. */ -export interface RoleEligibilityScheduleRequestsCreateOptionalParams +export interface AccessReviewScheduleDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type RoleEligibilityScheduleRequestsCreateResponse = RoleEligibilityScheduleRequest; +/** Contains response data for the getById operation. */ +export type AccessReviewScheduleDefinitionsGetByIdResponse = AccessReviewScheduleDefinition; /** Optional parameters. */ -export interface RoleEligibilityScheduleRequestsGetOptionalParams +export interface AccessReviewScheduleDefinitionsDeleteByIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type RoleEligibilityScheduleRequestsGetResponse = RoleEligibilityScheduleRequest; - /** Optional parameters. */ -export interface RoleEligibilityScheduleRequestsListForScopeOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. */ - filter?: string; -} +export interface AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForScope operation. */ -export type RoleEligibilityScheduleRequestsListForScopeResponse = RoleEligibilityScheduleRequestListResult; +/** Contains response data for the createOrUpdateById operation. */ +export type AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse = AccessReviewScheduleDefinition; /** Optional parameters. */ -export interface RoleEligibilityScheduleRequestsCancelOptionalParams +export interface AccessReviewScheduleDefinitionsStopOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface RoleEligibilityScheduleRequestsListForScopeNextOptionalParams +export interface AccessReviewScheduleDefinitionsListNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. */ + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ filter?: string; } -/** Contains response data for the listForScopeNext operation. */ -export type RoleEligibilityScheduleRequestsListForScopeNextResponse = RoleEligibilityScheduleRequestListResult; +/** Contains response data for the listNext operation. */ +export type AccessReviewScheduleDefinitionsListNextResponse = AccessReviewScheduleDefinitionListResult; /** Optional parameters. */ -export interface RoleManagementPoliciesGetOptionalParams - extends coreClient.OperationOptions {} +export interface AccessReviewInstancesListOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + filter?: string; +} -/** Contains response data for the get operation. */ -export type RoleManagementPoliciesGetResponse = RoleManagementPolicy; +/** Contains response data for the list operation. */ +export type AccessReviewInstancesListResponse = AccessReviewInstanceListResult; /** Optional parameters. */ -export interface RoleManagementPoliciesUpdateOptionalParams +export interface AccessReviewInstancesGetByIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the update operation. */ -export type RoleManagementPoliciesUpdateResponse = RoleManagementPolicy; - -/** Optional parameters. */ -export interface RoleManagementPoliciesDeleteOptionalParams - extends coreClient.OperationOptions {} +/** Contains response data for the getById operation. */ +export type AccessReviewInstancesGetByIdResponse = AccessReviewInstance; /** Optional parameters. */ -export interface RoleManagementPoliciesListForScopeOptionalParams +export interface AccessReviewInstancesCreateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForScope operation. */ -export type RoleManagementPoliciesListForScopeResponse = RoleManagementPolicyListResult; +/** Contains response data for the create operation. */ +export type AccessReviewInstancesCreateResponse = AccessReviewInstance; /** Optional parameters. */ -export interface RoleManagementPoliciesListForScopeNextOptionalParams - extends coreClient.OperationOptions {} +export interface AccessReviewInstancesListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + filter?: string; +} -/** Contains response data for the listForScopeNext operation. */ -export type RoleManagementPoliciesListForScopeNextResponse = RoleManagementPolicyListResult; +/** Contains response data for the listNext operation. */ +export type AccessReviewInstancesListNextResponse = AccessReviewInstanceListResult; /** Optional parameters. */ -export interface RoleManagementPolicyAssignmentsGetOptionalParams +export interface AccessReviewInstanceStopOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type RoleManagementPolicyAssignmentsGetResponse = RoleManagementPolicyAssignment; - /** Optional parameters. */ -export interface RoleManagementPolicyAssignmentsCreateOptionalParams +export interface AccessReviewInstanceResetDecisionsOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type RoleManagementPolicyAssignmentsCreateResponse = RoleManagementPolicyAssignment; - /** Optional parameters. */ -export interface RoleManagementPolicyAssignmentsDeleteOptionalParams +export interface AccessReviewInstanceApplyDecisionsOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface RoleManagementPolicyAssignmentsListForScopeOptionalParams +export interface AccessReviewInstanceSendRemindersOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForScope operation. */ -export type RoleManagementPolicyAssignmentsListForScopeResponse = RoleManagementPolicyAssignmentListResult; - /** Optional parameters. */ -export interface RoleManagementPolicyAssignmentsListForScopeNextOptionalParams +export interface AccessReviewInstanceAcceptRecommendationsOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForScopeNext operation. */ -export type RoleManagementPolicyAssignmentsListForScopeNextResponse = RoleManagementPolicyAssignmentListResult; - /** Optional parameters. */ -export interface EligibleChildResourcesGetOptionalParams +export interface AccessReviewInstanceDecisionsListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup' */ + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ filter?: string; } -/** Contains response data for the get operation. */ -export type EligibleChildResourcesGetResponse = EligibleChildResourcesListResult; +/** Contains response data for the list operation. */ +export type AccessReviewInstanceDecisionsListResponse = AccessReviewDecisionListResult; /** Optional parameters. */ -export interface EligibleChildResourcesGetNextOptionalParams +export interface AccessReviewInstanceDecisionsListNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup' */ + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ filter?: string; } -/** Contains response data for the getNext operation. */ -export type EligibleChildResourcesGetNextResponse = EligibleChildResourcesListResult; +/** Contains response data for the listNext operation. */ +export type AccessReviewInstanceDecisionsListNextResponse = AccessReviewDecisionListResult; /** Optional parameters. */ -export interface RoleAssignmentsListForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ - filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} - -/** Contains response data for the listForSubscription operation. */ -export type RoleAssignmentsListForSubscriptionResponse = RoleAssignmentListResult; - -/** Optional parameters. */ -export interface RoleAssignmentsListForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ - filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface AccessReviewInstanceContactedReviewersListOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceGroup operation. */ -export type RoleAssignmentsListForResourceGroupResponse = RoleAssignmentListResult; +/** Contains response data for the list operation. */ +export type AccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; /** Optional parameters. */ -export interface RoleAssignmentsListForResourceOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ - filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface AccessReviewInstanceContactedReviewersListNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForResource operation. */ -export type RoleAssignmentsListForResourceResponse = RoleAssignmentListResult; +/** Contains response data for the listNext operation. */ +export type AccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; /** Optional parameters. */ -export interface RoleAssignmentsGetOptionalParams - extends coreClient.OperationOptions { - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface AccessReviewDefaultSettingsGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type RoleAssignmentsGetResponse = RoleAssignment; +export type AccessReviewDefaultSettingsGetResponse = AccessReviewDefaultSettings; /** Optional parameters. */ -export interface RoleAssignmentsCreateOptionalParams +export interface AccessReviewDefaultSettingsPutOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type RoleAssignmentsCreateResponse = RoleAssignment; +/** Contains response data for the put operation. */ +export type AccessReviewDefaultSettingsPutResponse = AccessReviewDefaultSettings; /** Optional parameters. */ -export interface RoleAssignmentsDeleteOptionalParams +export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams extends coreClient.OperationOptions { - /** Tenant ID for cross-tenant request */ - tenantId?: string; + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + filter?: string; } -/** Contains response data for the delete operation. */ -export type RoleAssignmentsDeleteResponse = RoleAssignment; +/** Contains response data for the list operation. */ +export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListResponse = AccessReviewScheduleDefinitionListResult; /** Optional parameters. */ -export interface RoleAssignmentsValidateOptionalParams - extends coreClient.OperationOptions {} +export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + filter?: string; +} -/** Contains response data for the validate operation. */ -export type RoleAssignmentsValidateResponse = ValidationResponse; +/** Contains response data for the listNext operation. */ +export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse = AccessReviewScheduleDefinitionListResult; /** Optional parameters. */ -export interface RoleAssignmentsListForScopeOptionalParams +export interface AccessReviewInstancesAssignedForMyApprovalListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; } -/** Contains response data for the listForScope operation. */ -export type RoleAssignmentsListForScopeResponse = RoleAssignmentListResult; +/** Contains response data for the list operation. */ +export type AccessReviewInstancesAssignedForMyApprovalListResponse = AccessReviewInstanceListResult; /** Optional parameters. */ -export interface RoleAssignmentsGetByIdOptionalParams - extends coreClient.OperationOptions { - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the getById operation. */ -export type RoleAssignmentsGetByIdResponse = RoleAssignment; +export type AccessReviewInstancesAssignedForMyApprovalGetByIdResponse = AccessReviewInstance; /** Optional parameters. */ -export interface RoleAssignmentsCreateByIdOptionalParams - extends coreClient.OperationOptions {} +export interface AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + filter?: string; +} -/** Contains response data for the createById operation. */ -export type RoleAssignmentsCreateByIdResponse = RoleAssignment; +/** Contains response data for the listNext operation. */ +export type AccessReviewInstancesAssignedForMyApprovalListNextResponse = AccessReviewInstanceListResult; /** Optional parameters. */ -export interface RoleAssignmentsDeleteByIdOptionalParams +export interface AccessReviewInstanceMyDecisionsListOptionalParams extends coreClient.OperationOptions { - /** Tenant ID for cross-tenant request */ - tenantId?: string; + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + filter?: string; } -/** Contains response data for the deleteById operation. */ -export type RoleAssignmentsDeleteByIdResponse = RoleAssignment; +/** Contains response data for the list operation. */ +export type AccessReviewInstanceMyDecisionsListResponse = AccessReviewDecisionListResult; /** Optional parameters. */ -export interface RoleAssignmentsValidateByIdOptionalParams +export interface AccessReviewInstanceMyDecisionsGetByIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the validateById operation. */ -export type RoleAssignmentsValidateByIdResponse = ValidationResponse; +/** Contains response data for the getById operation. */ +export type AccessReviewInstanceMyDecisionsGetByIdResponse = AccessReviewDecision; /** Optional parameters. */ -export interface RoleAssignmentsListForSubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ - filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface AccessReviewInstanceMyDecisionsPatchOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForSubscriptionNext operation. */ -export type RoleAssignmentsListForSubscriptionNextResponse = RoleAssignmentListResult; +/** Contains response data for the patch operation. */ +export type AccessReviewInstanceMyDecisionsPatchResponse = AccessReviewDecision; /** Optional parameters. */ -export interface RoleAssignmentsListForResourceGroupNextOptionalParams +export interface AccessReviewInstanceMyDecisionsListNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ + /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; } -/** Contains response data for the listForResourceGroupNext operation. */ -export type RoleAssignmentsListForResourceGroupNextResponse = RoleAssignmentListResult; +/** Contains response data for the listNext operation. */ +export type AccessReviewInstanceMyDecisionsListNextResponse = AccessReviewDecisionListResult; /** Optional parameters. */ -export interface RoleAssignmentsListForResourceNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ - filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceNext operation. */ -export type RoleAssignmentsListForResourceNextResponse = RoleAssignmentListResult; +/** Contains response data for the list operation. */ +export type TenantLevelAccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; /** Optional parameters. */ -export interface RoleAssignmentsListForScopeNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal. */ - filter?: string; - /** Tenant ID for cross-tenant request */ - tenantId?: string; -} +export interface TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listForScopeNext operation. */ -export type RoleAssignmentsListForScopeNextResponse = RoleAssignmentListResult; +/** Contains response data for the listNext operation. */ +export type TenantLevelAccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; /** Optional parameters. */ export interface AuthorizationManagementClientOptionalParams diff --git a/sdk/authorization/arm-authorization/src/models/mappers.ts b/sdk/authorization/arm-authorization/src/models/mappers.ts index 9c89e14d75ea..850350cc2da6 100644 --- a/sdk/authorization/arm-authorization/src/models/mappers.ts +++ b/sdk/authorization/arm-authorization/src/models/mappers.ts @@ -8,209 +8,59 @@ import * as coreClient from "@azure/core-client"; -export const RoleAssignmentSchedule: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentSchedule", + className: "OperationListResult", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - scope: { - serializedName: "properties.scope", - type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", - type: { - name: "String" - } - }, - principalId: { - serializedName: "properties.principalId", - type: { - name: "String" - } - }, - principalType: { - serializedName: "properties.principalType", - type: { - name: "String" - } - }, - roleAssignmentScheduleRequestId: { - serializedName: "properties.roleAssignmentScheduleRequestId", - type: { - name: "String" - } - }, - linkedRoleEligibilityScheduleId: { - serializedName: "properties.linkedRoleEligibilityScheduleId", - type: { - name: "String" - } - }, - assignmentType: { - serializedName: "properties.assignmentType", - type: { - name: "String" - } - }, - memberType: { - serializedName: "properties.memberType", - type: { - name: "String" - } - }, - status: { - serializedName: "properties.status", - type: { - name: "String" - } - }, - startDateTime: { - serializedName: "properties.startDateTime", - type: { - name: "DateTime" - } - }, - endDateTime: { - serializedName: "properties.endDateTime", - type: { - name: "DateTime" - } - }, - condition: { - serializedName: "properties.condition", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - createdOn: { - serializedName: "properties.createdOn", - type: { - name: "DateTime" - } - }, - updatedOn: { - serializedName: "properties.updatedOn", - type: { - name: "DateTime" - } - }, - expandedProperties: { - serializedName: "properties.expandedProperties", - type: { - name: "Composite", - className: "ExpandedProperties" - } - } - } - } -}; - -export const ExpandedProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExpandedProperties", - modelProperties: { - scope: { - serializedName: "scope", - type: { - name: "Composite", - className: "ExpandedPropertiesScope" - } - }, - roleDefinition: { - serializedName: "roleDefinition", - type: { - name: "Composite", - className: "ExpandedPropertiesRoleDefinition" - } - }, - principal: { - serializedName: "principal", - type: { - name: "Composite", - className: "ExpandedPropertiesPrincipal" - } } } } }; -export const ExpandedPropertiesScope: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExpandedPropertiesScope", + className: "Operation", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - displayName: { - serializedName: "displayName", + name: { + serializedName: "name", type: { name: "String" } }, - type: { - serializedName: "type", + isDataAction: { + serializedName: "isDataAction", type: { - name: "String" - } - } - } - } -}; - -export const ExpandedPropertiesRoleDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExpandedPropertiesRoleDefinition", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" + name: "Boolean" } }, - displayName: { - serializedName: "displayName", + display: { + serializedName: "display", type: { - name: "String" + name: "Composite", + className: "OperationDisplay" } }, - type: { - serializedName: "type", + origin: { + serializedName: "origin", type: { name: "String" } @@ -219,31 +69,35 @@ export const ExpandedPropertiesRoleDefinition: coreClient.CompositeMapper = { } }; -export const ExpandedPropertiesPrincipal: coreClient.CompositeMapper = { +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExpandedPropertiesPrincipal", + className: "OperationDisplay", modelProperties: { - id: { - serializedName: "id", + provider: { + serializedName: "provider", + readOnly: true, type: { name: "String" } }, - displayName: { - serializedName: "displayName", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String" } }, - email: { - serializedName: "email", + operation: { + serializedName: "operation", + readOnly: true, type: { name: "String" } }, - type: { - serializedName: "type", + description: { + serializedName: "description", + readOnly: true, type: { name: "String" } @@ -252,62 +106,36 @@ export const ExpandedPropertiesPrincipal: coreClient.CompositeMapper = { } }; -export const CloudError: coreClient.CompositeMapper = { +export const ErrorDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudError", + className: "ErrorDefinition", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "CloudErrorBody" + className: "ErrorDefinitionProperties" } } } } }; -export const CloudErrorBody: coreClient.CompositeMapper = { +export const ErrorDefinitionProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudErrorBody", + className: "ErrorDefinitionProperties", modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, message: { serializedName: "message", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const RoleAssignmentScheduleListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentScheduleListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleAssignmentSchedule" - } - } - } }, - nextLink: { - serializedName: "nextLink", + code: { + serializedName: "code", type: { name: "String" } @@ -316,10 +144,10 @@ export const RoleAssignmentScheduleListResult: coreClient.CompositeMapper = { } }; -export const RoleAssignmentScheduleInstanceListResult: coreClient.CompositeMapper = { +export const AccessReviewHistoryDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentScheduleInstanceListResult", + className: "AccessReviewHistoryDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -328,7 +156,7 @@ export const RoleAssignmentScheduleInstanceListResult: coreClient.CompositeMappe element: { type: { name: "Composite", - className: "RoleAssignmentScheduleInstance" + className: "AccessReviewHistoryDefinition" } } } @@ -343,10 +171,10 @@ export const RoleAssignmentScheduleInstanceListResult: coreClient.CompositeMappe } }; -export const RoleAssignmentScheduleInstance: coreClient.CompositeMapper = { +export const AccessReviewHistoryDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentScheduleInstance", + className: "AccessReviewHistoryDefinition", modelProperties: { id: { serializedName: "id", @@ -369,362 +197,366 @@ export const RoleAssignmentScheduleInstance: coreClient.CompositeMapper = { name: "String" } }, - scope: { - serializedName: "properties.scope", + displayName: { + serializedName: "properties.displayName", type: { name: "String" } }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", + reviewHistoryPeriodStartDateTime: { + serializedName: "properties.reviewHistoryPeriodStartDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - principalId: { - serializedName: "properties.principalId", + reviewHistoryPeriodEndDateTime: { + serializedName: "properties.reviewHistoryPeriodEndDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - principalType: { - serializedName: "properties.principalType", + decisions: { + serializedName: "properties.decisions", + nullable: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - roleAssignmentScheduleId: { - serializedName: "properties.roleAssignmentScheduleId", + status: { + serializedName: "properties.status", + readOnly: true, type: { name: "String" } }, - originRoleAssignmentId: { - serializedName: "properties.originRoleAssignmentId", + createdDateTime: { + serializedName: "properties.createdDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - status: { - serializedName: "properties.status", + scopes: { + serializedName: "properties.scopes", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewScope" + } + } } }, - startDateTime: { - serializedName: "properties.startDateTime", + instances: { + serializedName: "properties.instances", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewHistoryInstance" + } + } } }, - endDateTime: { - serializedName: "properties.endDateTime", + typePropertiesSettingsRangeType: { + serializedName: "properties.settings.range.type", + nullable: true, type: { - name: "DateTime" + name: "String" } }, - linkedRoleEligibilityScheduleId: { - serializedName: "properties.linkedRoleEligibilityScheduleId", + numberOfOccurrences: { + serializedName: "properties.settings.range.numberOfOccurrences", + nullable: true, type: { - name: "String" + name: "Number" } }, - linkedRoleEligibilityScheduleInstanceId: { - serializedName: "properties.linkedRoleEligibilityScheduleInstanceId", + startDate: { + serializedName: "properties.settings.range.startDate", + nullable: true, type: { - name: "String" + name: "DateTime" } }, - assignmentType: { - serializedName: "properties.assignmentType", + endDate: { + serializedName: "properties.settings.range.endDate", + nullable: true, type: { - name: "String" + name: "DateTime" } }, - memberType: { - serializedName: "properties.memberType", + typePropertiesSettingsPatternType: { + serializedName: "properties.settings.pattern.type", + nullable: true, type: { name: "String" } }, - condition: { - serializedName: "properties.condition", + interval: { + serializedName: "properties.settings.pattern.interval", + nullable: true, + type: { + name: "Number" + } + }, + principalId: { + serializedName: "properties.createdBy.principalId", + readOnly: true, + nullable: true, type: { name: "String" } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + principalType: { + serializedName: "properties.createdBy.principalType", + readOnly: true, + nullable: true, type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", + principalName: { + serializedName: "properties.createdBy.principalName", + readOnly: true, + nullable: true, type: { - name: "DateTime" + name: "String" } }, - expandedProperties: { - serializedName: "properties.expandedProperties", + userPrincipalName: { + serializedName: "properties.createdBy.userPrincipalName", + readOnly: true, + nullable: true, type: { - name: "Composite", - className: "ExpandedProperties" + name: "String" } } } } }; -export const RoleAssignmentScheduleRequest: coreClient.CompositeMapper = { +export const AccessReviewHistoryDefinitionProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentScheduleRequest", + className: "AccessReviewHistoryDefinitionProperties", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, + displayName: { + serializedName: "displayName", type: { name: "String" } }, - type: { - serializedName: "type", + reviewHistoryPeriodStartDateTime: { + serializedName: "reviewHistoryPeriodStartDateTime", readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - scope: { - serializedName: "properties.scope", + reviewHistoryPeriodEndDateTime: { + serializedName: "reviewHistoryPeriodEndDateTime", readOnly: true, + nullable: true, type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", - type: { - name: "String" + name: "DateTime" } }, - principalId: { - serializedName: "properties.principalId", + decisions: { + serializedName: "decisions", + nullable: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - principalType: { - serializedName: "properties.principalType", + status: { + serializedName: "status", readOnly: true, type: { name: "String" } }, - requestType: { - serializedName: "properties.requestType", + createdDateTime: { + serializedName: "createdDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - status: { - serializedName: "properties.status", - readOnly: true, + scopes: { + serializedName: "scopes", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewScope" + } + } } }, - approvalId: { - serializedName: "properties.approvalId", - readOnly: true, + instances: { + serializedName: "instances", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewHistoryInstance" + } + } } }, - targetRoleAssignmentScheduleId: { - serializedName: "properties.targetRoleAssignmentScheduleId", + typeSettingsRangeType: { + serializedName: "settings.range.type", + nullable: true, type: { name: "String" } }, - targetRoleAssignmentScheduleInstanceId: { - serializedName: "properties.targetRoleAssignmentScheduleInstanceId", + numberOfOccurrences: { + serializedName: "settings.range.numberOfOccurrences", + nullable: true, type: { - name: "String" + name: "Number" } }, - scheduleInfo: { - serializedName: "properties.scheduleInfo", + startDate: { + serializedName: "settings.range.startDate", + nullable: true, type: { - name: "Composite", - className: "RoleAssignmentScheduleRequestPropertiesScheduleInfo" + name: "DateTime" } }, - linkedRoleEligibilityScheduleId: { - serializedName: "properties.linkedRoleEligibilityScheduleId", + endDate: { + serializedName: "settings.range.endDate", + nullable: true, type: { - name: "String" + name: "DateTime" } }, - justification: { - serializedName: "properties.justification", + typeSettingsPatternType: { + serializedName: "settings.pattern.type", + nullable: true, type: { name: "String" } }, - ticketInfo: { - serializedName: "properties.ticketInfo", + interval: { + serializedName: "settings.pattern.interval", + nullable: true, type: { - name: "Composite", - className: "RoleAssignmentScheduleRequestPropertiesTicketInfo" + name: "Number" } }, - condition: { - serializedName: "properties.condition", + principalId: { + serializedName: "createdBy.principalId", + readOnly: true, + nullable: true, type: { name: "String" } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + principalType: { + serializedName: "createdBy.principalType", + readOnly: true, + nullable: true, type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", + principalName: { + serializedName: "createdBy.principalName", readOnly: true, + nullable: true, type: { - name: "DateTime" + name: "String" } }, - requestorId: { - serializedName: "properties.requestorId", + userPrincipalName: { + serializedName: "createdBy.userPrincipalName", readOnly: true, + nullable: true, type: { name: "String" } - }, - expandedProperties: { - serializedName: "properties.expandedProperties", - type: { - name: "Composite", - className: "ExpandedProperties" - } - } - } - } -}; - -export const RoleAssignmentScheduleRequestPropertiesScheduleInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentScheduleRequestPropertiesScheduleInfo", - modelProperties: { - startDateTime: { - serializedName: "startDateTime", - type: { - name: "DateTime" - } - }, - expiration: { - serializedName: "expiration", - type: { - name: "Composite", - className: - "RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration" - } } } } }; -export const RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration: coreClient.CompositeMapper = { +export const AccessReviewScope: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration", + className: "AccessReviewScope", modelProperties: { - type: { - serializedName: "type", + resourceId: { + serializedName: "resourceId", + readOnly: true, type: { name: "String" } }, - endDateTime: { - serializedName: "endDateTime", - type: { - name: "DateTime" - } - }, - duration: { - serializedName: "duration", + roleDefinitionId: { + serializedName: "roleDefinitionId", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const RoleAssignmentScheduleRequestPropertiesTicketInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentScheduleRequestPropertiesTicketInfo", - modelProperties: { - ticketNumber: { - serializedName: "ticketNumber", + }, + principalType: { + serializedName: "principalType", + readOnly: true, type: { name: "String" } }, - ticketSystem: { - serializedName: "ticketSystem", + assignmentState: { + serializedName: "assignmentState", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const RoleAssignmentScheduleRequestListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentScheduleRequestListResult", - modelProperties: { - value: { - serializedName: "value", + }, + inactiveDuration: { + serializedName: "inactiveDuration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleAssignmentScheduleRequest" - } - } + name: "TimeSpan" } }, - nextLink: { - serializedName: "nextLink", + expandNestedMemberships: { + serializedName: "expandNestedMemberships", type: { - name: "String" + name: "Boolean" } } } } }; -export const RoleEligibilitySchedule: coreClient.CompositeMapper = { +export const AccessReviewHistoryInstance: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilitySchedule", + className: "AccessReviewHistoryInstance", modelProperties: { id: { serializedName: "id", @@ -747,99 +579,67 @@ export const RoleEligibilitySchedule: coreClient.CompositeMapper = { name: "String" } }, - scope: { - serializedName: "properties.scope", - type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", - type: { - name: "String" - } - }, - principalId: { - serializedName: "properties.principalId", - type: { - name: "String" - } - }, - principalType: { - serializedName: "properties.principalType", + reviewHistoryPeriodStartDateTime: { + serializedName: "properties.reviewHistoryPeriodStartDateTime", type: { - name: "String" + name: "DateTime" } }, - roleEligibilityScheduleRequestId: { - serializedName: "properties.roleEligibilityScheduleRequestId", + reviewHistoryPeriodEndDateTime: { + serializedName: "properties.reviewHistoryPeriodEndDateTime", type: { - name: "String" + name: "DateTime" } }, - memberType: { - serializedName: "properties.memberType", + displayName: { + serializedName: "properties.displayName", type: { name: "String" } }, status: { serializedName: "properties.status", + readOnly: true, type: { name: "String" } }, - startDateTime: { - serializedName: "properties.startDateTime", + runDateTime: { + serializedName: "properties.runDateTime", + nullable: true, type: { name: "DateTime" } }, - endDateTime: { - serializedName: "properties.endDateTime", + fulfilledDateTime: { + serializedName: "properties.fulfilledDateTime", + nullable: true, type: { name: "DateTime" } }, - condition: { - serializedName: "properties.condition", - type: { - name: "String" - } - }, - conditionVersion: { - serializedName: "properties.conditionVersion", + downloadUri: { + serializedName: "properties.downloadUri", + readOnly: true, type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", - type: { - name: "DateTime" - } - }, - updatedOn: { - serializedName: "properties.updatedOn", + expiration: { + serializedName: "properties.expiration", + nullable: true, type: { name: "DateTime" } - }, - expandedProperties: { - serializedName: "properties.expandedProperties", - type: { - name: "Composite", - className: "ExpandedProperties" - } } } } }; -export const RoleEligibilityScheduleListResult: coreClient.CompositeMapper = { +export const AccessReviewHistoryDefinitionInstanceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleListResult", + className: "AccessReviewHistoryDefinitionInstanceListResult", modelProperties: { value: { serializedName: "value", @@ -848,7 +648,7 @@ export const RoleEligibilityScheduleListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RoleEligibilitySchedule" + className: "AccessReviewHistoryInstance" } } } @@ -863,10 +663,10 @@ export const RoleEligibilityScheduleListResult: coreClient.CompositeMapper = { } }; -export const RoleEligibilityScheduleInstanceListResult: coreClient.CompositeMapper = { +export const AccessReviewScheduleDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleInstanceListResult", + className: "AccessReviewScheduleDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -875,7 +675,7 @@ export const RoleEligibilityScheduleInstanceListResult: coreClient.CompositeMapp element: { type: { name: "Composite", - className: "RoleEligibilityScheduleInstance" + className: "AccessReviewScheduleDefinition" } } } @@ -890,10 +690,10 @@ export const RoleEligibilityScheduleInstanceListResult: coreClient.CompositeMapp } }; -export const RoleEligibilityScheduleInstance: coreClient.CompositeMapper = { +export const AccessReviewScheduleDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleInstance", + className: "AccessReviewScheduleDefinition", modelProperties: { id: { serializedName: "id", @@ -916,761 +716,671 @@ export const RoleEligibilityScheduleInstance: coreClient.CompositeMapper = { name: "String" } }, - scope: { - serializedName: "properties.scope", + displayName: { + serializedName: "properties.displayName", type: { name: "String" } }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", + status: { + serializedName: "properties.status", + readOnly: true, type: { name: "String" } }, - principalId: { - serializedName: "properties.principalId", + descriptionForAdmins: { + serializedName: "properties.descriptionForAdmins", type: { name: "String" } }, - principalType: { - serializedName: "properties.principalType", + descriptionForReviewers: { + serializedName: "properties.descriptionForReviewers", type: { name: "String" } }, - roleEligibilityScheduleId: { - serializedName: "properties.roleEligibilityScheduleId", + reviewers: { + serializedName: "properties.reviewers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewReviewer" + } + } } }, - status: { - serializedName: "properties.status", + backupReviewers: { + serializedName: "properties.backupReviewers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewReviewer" + } + } } }, - startDateTime: { - serializedName: "properties.startDateTime", + reviewersType: { + serializedName: "properties.reviewersType", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - endDateTime: { - serializedName: "properties.endDateTime", + instances: { + serializedName: "properties.instances", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewInstance" + } + } } }, - memberType: { - serializedName: "properties.memberType", + resourceId: { + serializedName: "properties.scope.resourceId", + readOnly: true, type: { name: "String" } }, - condition: { - serializedName: "properties.condition", + roleDefinitionId: { + serializedName: "properties.scope.roleDefinitionId", + readOnly: true, type: { name: "String" } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + principalTypePropertiesScopePrincipalType: { + serializedName: "properties.scope.principalType", + readOnly: true, type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", + assignmentState: { + serializedName: "properties.scope.assignmentState", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - expandedProperties: { - serializedName: "properties.expandedProperties", + inactiveDuration: { + serializedName: "properties.scope.inactiveDuration", type: { - name: "Composite", - className: "ExpandedProperties" + name: "TimeSpan" } - } - } - } -}; - -export const RoleEligibilityScheduleRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleEligibilityScheduleRequest", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + }, + expandNestedMemberships: { + serializedName: "properties.scope.expandNestedMemberships", type: { - name: "String" + name: "Boolean" } }, - name: { - serializedName: "name", - readOnly: true, + mailNotificationsEnabled: { + serializedName: "properties.settings.mailNotificationsEnabled", type: { - name: "String" + name: "Boolean" } }, - type: { - serializedName: "type", - readOnly: true, + reminderNotificationsEnabled: { + serializedName: "properties.settings.reminderNotificationsEnabled", type: { - name: "String" + name: "Boolean" } }, - scope: { - serializedName: "properties.scope", - readOnly: true, + defaultDecisionEnabled: { + serializedName: "properties.settings.defaultDecisionEnabled", type: { - name: "String" + name: "Boolean" } }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", + justificationRequiredOnApproval: { + serializedName: "properties.settings.justificationRequiredOnApproval", type: { - name: "String" + name: "Boolean" } }, - principalId: { - serializedName: "properties.principalId", + defaultDecision: { + serializedName: "properties.settings.defaultDecision", type: { name: "String" } }, - principalType: { - serializedName: "properties.principalType", - readOnly: true, - type: { - name: "String" - } - }, - requestType: { - serializedName: "properties.requestType", + autoApplyDecisionsEnabled: { + serializedName: "properties.settings.autoApplyDecisionsEnabled", type: { - name: "String" + name: "Boolean" } }, - status: { - serializedName: "properties.status", - readOnly: true, + recommendationsEnabled: { + serializedName: "properties.settings.recommendationsEnabled", type: { - name: "String" + name: "Boolean" } }, - approvalId: { - serializedName: "properties.approvalId", - readOnly: true, + recommendationLookBackDuration: { + serializedName: "properties.settings.recommendationLookBackDuration", type: { - name: "String" + name: "TimeSpan" } }, - scheduleInfo: { - serializedName: "properties.scheduleInfo", + instanceDurationInDays: { + serializedName: "properties.settings.instanceDurationInDays", type: { - name: "Composite", - className: "RoleEligibilityScheduleRequestPropertiesScheduleInfo" + name: "Number" } }, - targetRoleEligibilityScheduleId: { - serializedName: "properties.targetRoleEligibilityScheduleId", + typePropertiesSettingsRecurrenceRangeType: { + serializedName: "properties.settings.recurrence.range.type", type: { name: "String" } }, - targetRoleEligibilityScheduleInstanceId: { - serializedName: "properties.targetRoleEligibilityScheduleInstanceId", + numberOfOccurrences: { + serializedName: + "properties.settings.recurrence.range.numberOfOccurrences", type: { - name: "String" + name: "Number" } }, - justification: { - serializedName: "properties.justification", + startDate: { + serializedName: "properties.settings.recurrence.range.startDate", + nullable: true, type: { - name: "String" + name: "DateTime" } }, - ticketInfo: { - serializedName: "properties.ticketInfo", + endDate: { + serializedName: "properties.settings.recurrence.range.endDate", + nullable: true, type: { - name: "Composite", - className: "RoleEligibilityScheduleRequestPropertiesTicketInfo" + name: "DateTime" } }, - condition: { - serializedName: "properties.condition", + typePropertiesSettingsRecurrencePatternType: { + serializedName: "properties.settings.recurrence.pattern.type", type: { name: "String" } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + interval: { + serializedName: "properties.settings.recurrence.pattern.interval", type: { - name: "String" + name: "Number" } }, - createdOn: { - serializedName: "properties.createdOn", + principalId: { + serializedName: "properties.createdBy.principalId", readOnly: true, type: { - name: "DateTime" + name: "String" } }, - requestorId: { - serializedName: "properties.requestorId", + principalTypePropertiesCreatedByPrincipalType: { + serializedName: "properties.createdBy.principalType", readOnly: true, type: { name: "String" } }, - expandedProperties: { - serializedName: "properties.expandedProperties", - type: { - name: "Composite", - className: "ExpandedProperties" - } - } - } - } -}; - -export const RoleEligibilityScheduleRequestPropertiesScheduleInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleEligibilityScheduleRequestPropertiesScheduleInfo", - modelProperties: { - startDateTime: { - serializedName: "startDateTime", + principalName: { + serializedName: "properties.createdBy.principalName", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - expiration: { - serializedName: "expiration", + userPrincipalName: { + serializedName: "properties.createdBy.userPrincipalName", + readOnly: true, type: { - name: "Composite", - className: - "RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration" + name: "String" } } } } }; -export const RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration: coreClient.CompositeMapper = { +export const AccessReviewScheduleDefinitionProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration", + className: "AccessReviewScheduleDefinitionProperties", modelProperties: { - type: { - serializedName: "type", + displayName: { + serializedName: "displayName", type: { name: "String" } }, - endDateTime: { - serializedName: "endDateTime", + status: { + serializedName: "status", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - duration: { - serializedName: "duration", + descriptionForAdmins: { + serializedName: "descriptionForAdmins", type: { name: "String" } - } - } - } -}; - -export const RoleEligibilityScheduleRequestPropertiesTicketInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleEligibilityScheduleRequestPropertiesTicketInfo", - modelProperties: { - ticketNumber: { - serializedName: "ticketNumber", + }, + descriptionForReviewers: { + serializedName: "descriptionForReviewers", type: { name: "String" } }, - ticketSystem: { - serializedName: "ticketSystem", + reviewers: { + serializedName: "reviewers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewReviewer" + } + } } - } - } - } -}; - -export const RoleEligibilityScheduleRequestListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleEligibilityScheduleRequestListResult", - modelProperties: { - value: { - serializedName: "value", + }, + backupReviewers: { + serializedName: "backupReviewers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "RoleEligibilityScheduleRequest" + className: "AccessReviewReviewer" } } } }, - nextLink: { - serializedName: "nextLink", + reviewersType: { + serializedName: "reviewersType", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const RoleManagementPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleManagementPolicy", - modelProperties: { - id: { - serializedName: "id", + }, + instances: { + serializedName: "instances", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewInstance" + } + } + } + }, + resourceId: { + serializedName: "scope.resourceId", readOnly: true, type: { name: "String" } }, - name: { - serializedName: "name", + roleDefinitionId: { + serializedName: "scope.roleDefinitionId", readOnly: true, type: { name: "String" } }, - type: { - serializedName: "type", + principalTypeScopePrincipalType: { + serializedName: "scope.principalType", readOnly: true, type: { name: "String" } }, - scope: { - serializedName: "properties.scope", + assignmentState: { + serializedName: "scope.assignmentState", + readOnly: true, type: { name: "String" } }, - displayName: { - serializedName: "properties.displayName", + inactiveDuration: { + serializedName: "scope.inactiveDuration", type: { - name: "String" + name: "TimeSpan" } }, - description: { - serializedName: "properties.description", + expandNestedMemberships: { + serializedName: "scope.expandNestedMemberships", type: { - name: "String" + name: "Boolean" } }, - isOrganizationDefault: { - serializedName: "properties.isOrganizationDefault", + mailNotificationsEnabled: { + serializedName: "settings.mailNotificationsEnabled", type: { name: "Boolean" } }, - lastModifiedBy: { - serializedName: "properties.lastModifiedBy", + reminderNotificationsEnabled: { + serializedName: "settings.reminderNotificationsEnabled", type: { - name: "Composite", - className: "Principal" + name: "Boolean" } }, - lastModifiedDateTime: { - serializedName: "properties.lastModifiedDateTime", - readOnly: true, + defaultDecisionEnabled: { + serializedName: "settings.defaultDecisionEnabled", type: { - name: "DateTime" + name: "Boolean" } }, - rules: { - serializedName: "properties.rules", + justificationRequiredOnApproval: { + serializedName: "settings.justificationRequiredOnApproval", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleManagementPolicyRule" - } - } + name: "Boolean" } }, - effectiveRules: { - serializedName: "properties.effectiveRules", - readOnly: true, + defaultDecision: { + serializedName: "settings.defaultDecision", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleManagementPolicyRule" - } - } + name: "String" } }, - policyProperties: { - serializedName: "properties.policyProperties", + autoApplyDecisionsEnabled: { + serializedName: "settings.autoApplyDecisionsEnabled", type: { - name: "Composite", - className: "PolicyProperties" + name: "Boolean" } - } - } - } -}; - -export const Principal: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Principal", - modelProperties: { - id: { - serializedName: "id", + }, + recommendationsEnabled: { + serializedName: "settings.recommendationsEnabled", type: { - name: "String" + name: "Boolean" } }, - displayName: { - serializedName: "displayName", + recommendationLookBackDuration: { + serializedName: "settings.recommendationLookBackDuration", type: { - name: "String" + name: "TimeSpan" } }, - type: { - serializedName: "type", + instanceDurationInDays: { + serializedName: "settings.instanceDurationInDays", type: { - name: "String" + name: "Number" } }, - email: { - serializedName: "email", + typeSettingsRecurrenceRangeType: { + serializedName: "settings.recurrence.range.type", type: { name: "String" } - } - } - } -}; - -export const RoleManagementPolicyRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleManagementPolicyRule", - uberParent: "RoleManagementPolicyRule", - polymorphicDiscriminator: { - serializedName: "ruleType", - clientName: "ruleType" - }, - modelProperties: { - id: { - serializedName: "id", + }, + numberOfOccurrences: { + serializedName: "settings.recurrence.range.numberOfOccurrences", type: { - name: "String" + name: "Number" } }, - ruleType: { - serializedName: "ruleType", - required: true, + startDate: { + serializedName: "settings.recurrence.range.startDate", + nullable: true, type: { - name: "String" + name: "DateTime" } }, - target: { - serializedName: "target", + endDate: { + serializedName: "settings.recurrence.range.endDate", + nullable: true, type: { - name: "Composite", - className: "RoleManagementPolicyRuleTarget" + name: "DateTime" } - } - } - } -}; - -export const RoleManagementPolicyRuleTarget: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleManagementPolicyRuleTarget", - modelProperties: { - caller: { - serializedName: "caller", + }, + typeSettingsRecurrencePatternType: { + serializedName: "settings.recurrence.pattern.type", type: { name: "String" } }, - operations: { - serializedName: "operations", + interval: { + serializedName: "settings.recurrence.pattern.interval", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - level: { - serializedName: "level", + principalId: { + serializedName: "createdBy.principalId", + readOnly: true, type: { name: "String" } }, - targetObjects: { - serializedName: "targetObjects", + principalTypeCreatedByPrincipalType: { + serializedName: "createdBy.principalType", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - inheritableSettings: { - serializedName: "inheritableSettings", + principalName: { + serializedName: "createdBy.principalName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - enforcedSettings: { - serializedName: "enforcedSettings", + userPrincipalName: { + serializedName: "createdBy.userPrincipalName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const PolicyProperties: coreClient.CompositeMapper = { +export const AccessReviewScheduleSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyProperties", + className: "AccessReviewScheduleSettings", modelProperties: { - scope: { - serializedName: "scope", + mailNotificationsEnabled: { + serializedName: "mailNotificationsEnabled", type: { - name: "Composite", - className: "PolicyPropertiesScope" + name: "Boolean" } - } - } - } -}; - -export const PolicyPropertiesScope: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyPropertiesScope", - modelProperties: { - id: { - serializedName: "id", + }, + reminderNotificationsEnabled: { + serializedName: "reminderNotificationsEnabled", type: { - name: "String" + name: "Boolean" } }, - displayName: { - serializedName: "displayName", + defaultDecisionEnabled: { + serializedName: "defaultDecisionEnabled", type: { - name: "String" + name: "Boolean" } }, - type: { - serializedName: "type", + justificationRequiredOnApproval: { + serializedName: "justificationRequiredOnApproval", + type: { + name: "Boolean" + } + }, + defaultDecision: { + serializedName: "defaultDecision", type: { name: "String" } - } - } - } -}; - -export const RoleManagementPolicyListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleManagementPolicyListResult", - modelProperties: { - value: { - serializedName: "value", + }, + autoApplyDecisionsEnabled: { + serializedName: "autoApplyDecisionsEnabled", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleManagementPolicy" - } - } + name: "Boolean" } }, - nextLink: { - serializedName: "nextLink", + recommendationsEnabled: { + serializedName: "recommendationsEnabled", type: { - name: "String" + name: "Boolean" } - } - } - } -}; - -export const RoleManagementPolicyAssignment: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleManagementPolicyAssignment", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + }, + recommendationLookBackDuration: { + serializedName: "recommendationLookBackDuration", type: { - name: "String" + name: "TimeSpan" } }, - name: { - serializedName: "name", - readOnly: true, + instanceDurationInDays: { + serializedName: "instanceDurationInDays", type: { - name: "String" + name: "Number" } }, - type: { - serializedName: "type", - readOnly: true, + typeRecurrenceRangeType: { + serializedName: "recurrence.range.type", type: { name: "String" } }, - scope: { - serializedName: "properties.scope", + numberOfOccurrences: { + serializedName: "recurrence.range.numberOfOccurrences", type: { - name: "String" + name: "Number" } }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", + startDate: { + serializedName: "recurrence.range.startDate", + nullable: true, type: { - name: "String" + name: "DateTime" + } + }, + endDate: { + serializedName: "recurrence.range.endDate", + nullable: true, + type: { + name: "DateTime" } }, - policyId: { - serializedName: "properties.policyId", + typeRecurrencePatternType: { + serializedName: "recurrence.pattern.type", type: { name: "String" } }, - policyAssignmentProperties: { - serializedName: "properties.policyAssignmentProperties", + interval: { + serializedName: "recurrence.pattern.interval", type: { - name: "Composite", - className: "PolicyAssignmentProperties" + name: "Number" } } } } }; -export const PolicyAssignmentProperties: coreClient.CompositeMapper = { +export const AccessReviewReviewer: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentProperties", + className: "AccessReviewReviewer", modelProperties: { - scope: { - serializedName: "scope", - type: { - name: "Composite", - className: "PolicyAssignmentPropertiesScope" - } - }, - roleDefinition: { - serializedName: "roleDefinition", + principalId: { + serializedName: "principalId", type: { - name: "Composite", - className: "PolicyAssignmentPropertiesRoleDefinition" + name: "String" } }, - policy: { - serializedName: "policy", + principalType: { + serializedName: "principalType", + readOnly: true, type: { - name: "Composite", - className: "PolicyAssignmentPropertiesPolicy" + name: "String" } } } } }; -export const PolicyAssignmentPropertiesScope: coreClient.CompositeMapper = { +export const AccessReviewInstance: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentPropertiesScope", + className: "AccessReviewInstance", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { name: "String" } }, - displayName: { - serializedName: "displayName", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { serializedName: "type", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const PolicyAssignmentPropertiesRoleDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyAssignmentPropertiesRoleDefinition", - modelProperties: { - id: { - serializedName: "id", + }, + status: { + serializedName: "properties.status", + readOnly: true, type: { name: "String" } }, - displayName: { - serializedName: "displayName", + startDateTime: { + serializedName: "properties.startDateTime", type: { - name: "String" + name: "DateTime" } }, - type: { - serializedName: "type", + endDateTime: { + serializedName: "properties.endDateTime", + type: { + name: "DateTime" + } + }, + reviewers: { + serializedName: "properties.reviewers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewReviewer" + } + } + } + }, + backupReviewers: { + serializedName: "properties.backupReviewers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewReviewer" + } + } + } + }, + reviewersType: { + serializedName: "properties.reviewersType", + readOnly: true, type: { name: "String" } @@ -1679,53 +1389,57 @@ export const PolicyAssignmentPropertiesRoleDefinition: coreClient.CompositeMappe } }; -export const PolicyAssignmentPropertiesPolicy: coreClient.CompositeMapper = { +export const AccessReviewInstanceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentPropertiesPolicy", + className: "AccessReviewInstanceProperties", modelProperties: { - id: { - serializedName: "id", + status: { + serializedName: "status", + readOnly: true, type: { name: "String" } }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + startDateTime: { + serializedName: "startDateTime", type: { - name: "Composite", - className: "Principal" + name: "DateTime" } }, - lastModifiedDateTime: { - serializedName: "lastModifiedDateTime", + endDateTime: { + serializedName: "endDateTime", type: { name: "DateTime" } - } - } - } -}; - -export const RoleManagementPolicyAssignmentListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleManagementPolicyAssignmentListResult", - modelProperties: { - value: { - serializedName: "value", + }, + reviewers: { + serializedName: "reviewers", type: { name: "Sequence", element: { type: { name: "Composite", - className: "RoleManagementPolicyAssignment" + className: "AccessReviewReviewer" } } } }, - nextLink: { - serializedName: "nextLink", + backupReviewers: { + serializedName: "backupReviewers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewReviewer" + } + } + } + }, + reviewersType: { + serializedName: "reviewersType", + readOnly: true, type: { name: "String" } @@ -1734,10 +1448,10 @@ export const RoleManagementPolicyAssignmentListResult: coreClient.CompositeMappe } }; -export const EligibleChildResourcesListResult: coreClient.CompositeMapper = { +export const AccessReviewInstanceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EligibleChildResourcesListResult", + className: "AccessReviewInstanceListResult", modelProperties: { value: { serializedName: "value", @@ -1746,7 +1460,7 @@ export const EligibleChildResourcesListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EligibleChildResource" + className: "AccessReviewInstance" } } } @@ -1761,40 +1475,10 @@ export const EligibleChildResourcesListResult: coreClient.CompositeMapper = { } }; -export const EligibleChildResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EligibleChildResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const RoleAssignmentListResult: coreClient.CompositeMapper = { +export const AccessReviewDecisionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentListResult", + className: "AccessReviewDecisionListResult", modelProperties: { value: { serializedName: "value", @@ -1803,14 +1487,13 @@ export const RoleAssignmentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RoleAssignment" + className: "AccessReviewDecision" } } } }, nextLink: { serializedName: "nextLink", - readOnly: true, type: { name: "String" } @@ -1819,10 +1502,10 @@ export const RoleAssignmentListResult: coreClient.CompositeMapper = { } }; -export const RoleAssignment: coreClient.CompositeMapper = { +export const AccessReviewDecision: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignment", + className: "AccessReviewDecision", modelProperties: { id: { serializedName: "id", @@ -1845,369 +1528,315 @@ export const RoleAssignment: coreClient.CompositeMapper = { name: "String" } }, - scope: { - serializedName: "properties.scope", + recommendation: { + serializedName: "properties.recommendation", readOnly: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", + decision: { + serializedName: "properties.decision", type: { name: "String" } }, - principalId: { - serializedName: "properties.principalId", + justification: { + serializedName: "properties.justification", type: { name: "String" } }, - principalType: { - serializedName: "properties.principalType", + reviewedDateTime: { + serializedName: "properties.reviewedDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - description: { - serializedName: "properties.description", + applyResult: { + serializedName: "properties.applyResult", + readOnly: true, type: { name: "String" } }, - condition: { - serializedName: "properties.condition", + appliedDateTime: { + serializedName: "properties.appliedDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + principalIdPropertiesAppliedByPrincipalId: { + serializedName: "properties.appliedBy.principalId", + readOnly: true, + nullable: true, type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", + principalTypePropertiesAppliedByPrincipalType: { + serializedName: "properties.appliedBy.principalType", readOnly: true, + nullable: true, type: { - name: "DateTime" + name: "String" } }, - updatedOn: { - serializedName: "properties.updatedOn", + principalNamePropertiesAppliedByPrincipalName: { + serializedName: "properties.appliedBy.principalName", readOnly: true, + nullable: true, type: { - name: "DateTime" + name: "String" } }, - createdBy: { - serializedName: "properties.createdBy", + userPrincipalNamePropertiesAppliedByUserPrincipalName: { + serializedName: "properties.appliedBy.userPrincipalName", readOnly: true, + nullable: true, type: { name: "String" } }, - updatedBy: { - serializedName: "properties.updatedBy", + principalIdPropertiesReviewedByPrincipalId: { + serializedName: "properties.reviewedBy.principalId", readOnly: true, + nullable: true, type: { name: "String" } }, - delegatedManagedIdentityResourceId: { - serializedName: "properties.delegatedManagedIdentityResourceId", + principalTypePropertiesReviewedByPrincipalType: { + serializedName: "properties.reviewedBy.principalType", + readOnly: true, + nullable: true, type: { name: "String" } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", + }, + principalNamePropertiesReviewedByPrincipalName: { + serializedName: "properties.reviewedBy.principalName", + readOnly: true, + nullable: true, type: { - name: "Composite", - className: "ErrorDetail" + name: "String" } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", + }, + userPrincipalNamePropertiesReviewedByUserPrincipalName: { + serializedName: "properties.reviewedBy.userPrincipalName", readOnly: true, + nullable: true, type: { name: "String" } }, - message: { - serializedName: "message", - readOnly: true, + typePropertiesResourceType: { + serializedName: "properties.resource.type", + nullable: true, type: { name: "String" } }, - target: { - serializedName: "target", + idPropertiesResourceId: { + serializedName: "properties.resource.id", readOnly: true, + nullable: true, type: { name: "String" } }, - details: { - serializedName: "details", + displayNamePropertiesResourceDisplayName: { + serializedName: "properties.resource.displayName", readOnly: true, + nullable: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } + name: "String" } }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + typePropertiesPrincipalType: { + serializedName: "properties.principal.type", + nullable: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } + name: "String" } - } - } - } -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", + }, + idPropertiesPrincipalId: { + serializedName: "properties.principal.id", readOnly: true, + nullable: true, type: { name: "String" } }, - info: { - serializedName: "info", + displayNamePropertiesPrincipalDisplayName: { + serializedName: "properties.principal.displayName", readOnly: true, + nullable: true, type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" } } } } }; -export const RoleAssignmentCreateParameters: coreClient.CompositeMapper = { +export const AccessReviewDecisionProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentCreateParameters", + className: "AccessReviewDecisionProperties", modelProperties: { - scope: { - serializedName: "properties.scope", + recommendation: { + serializedName: "recommendation", readOnly: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", - required: true, - type: { - name: "String" - } - }, - principalId: { - serializedName: "properties.principalId", - required: true, - type: { - name: "String" - } - }, - principalType: { - serializedName: "properties.principalType", + decision: { + serializedName: "decision", type: { name: "String" } }, - description: { - serializedName: "properties.description", + justification: { + serializedName: "justification", type: { name: "String" } }, - condition: { - serializedName: "properties.condition", + reviewedDateTime: { + serializedName: "reviewedDateTime", + readOnly: true, + nullable: true, type: { - name: "String" + name: "DateTime" } }, - conditionVersion: { - serializedName: "properties.conditionVersion", + applyResult: { + serializedName: "applyResult", + readOnly: true, type: { name: "String" } }, - createdOn: { - serializedName: "properties.createdOn", + appliedDateTime: { + serializedName: "appliedDateTime", readOnly: true, + nullable: true, type: { name: "DateTime" } }, - updatedOn: { - serializedName: "properties.updatedOn", + principalIdAppliedByPrincipalId: { + serializedName: "appliedBy.principalId", readOnly: true, + nullable: true, type: { - name: "DateTime" + name: "String" } }, - createdBy: { - serializedName: "properties.createdBy", + principalTypeAppliedByPrincipalType: { + serializedName: "appliedBy.principalType", readOnly: true, + nullable: true, type: { name: "String" } }, - updatedBy: { - serializedName: "properties.updatedBy", + principalNameAppliedByPrincipalName: { + serializedName: "appliedBy.principalName", readOnly: true, + nullable: true, type: { name: "String" } }, - delegatedManagedIdentityResourceId: { - serializedName: "properties.delegatedManagedIdentityResourceId", + userPrincipalNameAppliedByUserPrincipalName: { + serializedName: "appliedBy.userPrincipalName", + readOnly: true, + nullable: true, type: { name: "String" } - } - } - } -}; - -export const ValidationResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ValidationResponse", - modelProperties: { - isValid: { - serializedName: "isValid", + }, + principalIdReviewedByPrincipalId: { + serializedName: "reviewedBy.principalId", readOnly: true, + nullable: true, type: { - name: "Boolean" + name: "String" } }, - errorInfo: { - serializedName: "errorInfo", - type: { - name: "Composite", - className: "ValidationResponseErrorInfo" - } - } - } - } -}; - -export const ValidationResponseErrorInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ValidationResponseErrorInfo", - modelProperties: { - code: { - serializedName: "code", + principalTypeReviewedByPrincipalType: { + serializedName: "reviewedBy.principalType", readOnly: true, + nullable: true, type: { name: "String" } }, - message: { - serializedName: "message", + principalNameReviewedByPrincipalName: { + serializedName: "reviewedBy.principalName", readOnly: true, + nullable: true, type: { name: "String" } - } - } - } -}; - -export const RoleAssignmentScheduleFilter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentScheduleFilter", - modelProperties: { - principalId: { - serializedName: "principalId", + }, + userPrincipalNameReviewedByUserPrincipalName: { + serializedName: "reviewedBy.userPrincipalName", + readOnly: true, + nullable: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "roleDefinitionId", + typeResourceType: { + serializedName: "resource.type", + nullable: true, type: { name: "String" } }, - status: { - serializedName: "status", + idResourceId: { + serializedName: "resource.id", + readOnly: true, + nullable: true, type: { name: "String" } - } - } - } -}; - -export const RoleAssignmentScheduleInstanceFilter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentScheduleInstanceFilter", - modelProperties: { - principalId: { - serializedName: "principalId", + }, + displayNameResourceDisplayName: { + serializedName: "resource.displayName", + readOnly: true, + nullable: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "roleDefinitionId", + typePrincipalType: { + serializedName: "principal.type", + nullable: true, type: { name: "String" } }, - status: { - serializedName: "status", + idPrincipalId: { + serializedName: "principal.id", + readOnly: true, + nullable: true, type: { name: "String" } }, - roleAssignmentScheduleId: { - serializedName: "roleAssignmentScheduleId", + displayNamePrincipalDisplayName: { + serializedName: "principal.displayName", + readOnly: true, + nullable: true, type: { name: "String" } @@ -2216,31 +1845,33 @@ export const RoleAssignmentScheduleInstanceFilter: coreClient.CompositeMapper = } }; -export const RoleAssignmentScheduleRequestFilter: coreClient.CompositeMapper = { +export const AccessReviewDecisionIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleAssignmentScheduleRequestFilter", + className: "AccessReviewDecisionIdentity", + uberParent: "AccessReviewDecisionIdentity", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, modelProperties: { - principalId: { - serializedName: "principalId", - type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "roleDefinitionId", + type: { + serializedName: "type", + required: true, type: { name: "String" } }, - requestorId: { - serializedName: "requestorId", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - status: { - serializedName: "status", + displayName: { + serializedName: "displayName", + readOnly: true, type: { name: "String" } @@ -2249,25 +1880,33 @@ export const RoleAssignmentScheduleRequestFilter: coreClient.CompositeMapper = { } }; -export const RoleEligibilityScheduleFilter: coreClient.CompositeMapper = { +export const AccessReviewDecisionResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleFilter", + className: "AccessReviewDecisionResource", + uberParent: "AccessReviewDecisionResource", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, modelProperties: { - principalId: { - serializedName: "principalId", + type: { + serializedName: "type", + required: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "roleDefinitionId", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - status: { - serializedName: "status", + displayName: { + serializedName: "displayName", + readOnly: true, type: { name: "String" } @@ -2276,31 +1915,25 @@ export const RoleEligibilityScheduleFilter: coreClient.CompositeMapper = { } }; -export const RoleEligibilityScheduleInstanceFilter: coreClient.CompositeMapper = { +export const AccessReviewContactedReviewerListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleInstanceFilter", + className: "AccessReviewContactedReviewerListResult", modelProperties: { - principalId: { - serializedName: "principalId", - type: { - name: "String" - } - }, - roleDefinitionId: { - serializedName: "roleDefinitionId", - type: { - name: "String" - } - }, - status: { - serializedName: "status", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessReviewContactedReviewer" + } + } } }, - roleEligibilityScheduleId: { - serializedName: "roleEligibilityScheduleId", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -2309,279 +1942,214 @@ export const RoleEligibilityScheduleInstanceFilter: coreClient.CompositeMapper = } }; -export const RoleEligibilityScheduleRequestFilter: coreClient.CompositeMapper = { +export const AccessReviewContactedReviewer: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoleEligibilityScheduleRequestFilter", + className: "AccessReviewContactedReviewer", modelProperties: { - principalId: { - serializedName: "principalId", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "roleDefinitionId", + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - requestorId: { - serializedName: "requestorId", + userDisplayName: { + serializedName: "properties.userDisplayName", + readOnly: true, type: { name: "String" } }, - status: { - serializedName: "status", + userPrincipalName: { + serializedName: "properties.userPrincipalName", + readOnly: true, type: { name: "String" } + }, + createdDateTime: { + serializedName: "properties.createdDateTime", + readOnly: true, + nullable: true, + type: { + name: "DateTime" + } } } } }; -export const ApprovalSettings: coreClient.CompositeMapper = { +export const AccessReviewDefaultSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApprovalSettings", + className: "AccessReviewDefaultSettings", modelProperties: { - isApprovalRequired: { - serializedName: "isApprovalRequired", - type: { - name: "Boolean" - } - }, - isApprovalRequiredForExtension: { - serializedName: "isApprovalRequiredForExtension", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - isRequestorJustificationRequired: { - serializedName: "isRequestorJustificationRequired", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - approvalMode: { - serializedName: "approvalMode", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - approvalStages: { - serializedName: "approvalStages", + mailNotificationsEnabled: { + serializedName: "properties.mailNotificationsEnabled", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApprovalStage" - } - } + name: "Boolean" } - } - } - } -}; - -export const ApprovalStage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApprovalStage", - modelProperties: { - approvalStageTimeOutInDays: { - serializedName: "approvalStageTimeOutInDays", + }, + reminderNotificationsEnabled: { + serializedName: "properties.reminderNotificationsEnabled", type: { - name: "Number" + name: "Boolean" } }, - isApproverJustificationRequired: { - serializedName: "isApproverJustificationRequired", + defaultDecisionEnabled: { + serializedName: "properties.defaultDecisionEnabled", type: { name: "Boolean" } }, - escalationTimeInMinutes: { - serializedName: "escalationTimeInMinutes", + justificationRequiredOnApproval: { + serializedName: "properties.justificationRequiredOnApproval", type: { - name: "Number" + name: "Boolean" } }, - primaryApprovers: { - serializedName: "primaryApprovers", + defaultDecision: { + serializedName: "properties.defaultDecision", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UserSet" - } - } + name: "String" } }, - isEscalationEnabled: { - serializedName: "isEscalationEnabled", + autoApplyDecisionsEnabled: { + serializedName: "properties.autoApplyDecisionsEnabled", type: { name: "Boolean" } }, - escalationApprovers: { - serializedName: "escalationApprovers", + recommendationsEnabled: { + serializedName: "properties.recommendationsEnabled", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UserSet" - } - } + name: "Boolean" } - } - } - } -}; - -export const UserSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserSet", - modelProperties: { - userType: { - serializedName: "userType", + }, + recommendationLookBackDuration: { + serializedName: "properties.recommendationLookBackDuration", type: { - name: "String" + name: "TimeSpan" } }, - isBackup: { - serializedName: "isBackup", + instanceDurationInDays: { + serializedName: "properties.instanceDurationInDays", type: { - name: "Boolean" + name: "Number" } }, - id: { - serializedName: "id", + typePropertiesRecurrenceRangeType: { + serializedName: "properties.recurrence.range.type", type: { name: "String" } }, - description: { - serializedName: "description", + numberOfOccurrences: { + serializedName: "properties.recurrence.range.numberOfOccurrences", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const RoleAssignmentFilter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleAssignmentFilter", - modelProperties: { - principalId: { - serializedName: "principalId", + }, + startDate: { + serializedName: "properties.recurrence.range.startDate", + nullable: true, type: { - name: "String" + name: "DateTime" } - } - } - } -}; - -export const RoleManagementPolicyApprovalRule: coreClient.CompositeMapper = { - serializedName: "RoleManagementPolicyApprovalRule", - type: { - name: "Composite", - className: "RoleManagementPolicyApprovalRule", - uberParent: "RoleManagementPolicyRule", - polymorphicDiscriminator: - RoleManagementPolicyRule.type.polymorphicDiscriminator, - modelProperties: { - ...RoleManagementPolicyRule.type.modelProperties, - setting: { - serializedName: "setting", + }, + endDate: { + serializedName: "properties.recurrence.range.endDate", + nullable: true, type: { - name: "Composite", - className: "ApprovalSettings" + name: "DateTime" } - } - } - } -}; - -export const RoleManagementPolicyAuthenticationContextRule: coreClient.CompositeMapper = { - serializedName: "RoleManagementPolicyAuthenticationContextRule", - type: { - name: "Composite", - className: "RoleManagementPolicyAuthenticationContextRule", - uberParent: "RoleManagementPolicyRule", - polymorphicDiscriminator: - RoleManagementPolicyRule.type.polymorphicDiscriminator, - modelProperties: { - ...RoleManagementPolicyRule.type.modelProperties, - isEnabled: { - serializedName: "isEnabled", + }, + typePropertiesRecurrencePatternType: { + serializedName: "properties.recurrence.pattern.type", type: { - name: "Boolean" + name: "String" } }, - claimValue: { - serializedName: "claimValue", + interval: { + serializedName: "properties.recurrence.pattern.interval", type: { - name: "String" + name: "Number" } } } } }; -export const RoleManagementPolicyEnablementRule: coreClient.CompositeMapper = { - serializedName: "RoleManagementPolicyEnablementRule", +export const AccessReviewDecisionUserIdentity: coreClient.CompositeMapper = { + serializedName: "user", type: { name: "Composite", - className: "RoleManagementPolicyEnablementRule", - uberParent: "RoleManagementPolicyRule", + className: "AccessReviewDecisionUserIdentity", + uberParent: "AccessReviewDecisionIdentity", polymorphicDiscriminator: - RoleManagementPolicyRule.type.polymorphicDiscriminator, + AccessReviewDecisionIdentity.type.polymorphicDiscriminator, modelProperties: { - ...RoleManagementPolicyRule.type.modelProperties, - enabledRules: { - serializedName: "enabledRules", + ...AccessReviewDecisionIdentity.type.modelProperties, + userPrincipalName: { + serializedName: "userPrincipalName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const RoleManagementPolicyExpirationRule: coreClient.CompositeMapper = { - serializedName: "RoleManagementPolicyExpirationRule", +export const AccessReviewDecisionServicePrincipalIdentity: coreClient.CompositeMapper = { + serializedName: "servicePrincipal", type: { name: "Composite", - className: "RoleManagementPolicyExpirationRule", - uberParent: "RoleManagementPolicyRule", + className: "AccessReviewDecisionServicePrincipalIdentity", + uberParent: "AccessReviewDecisionIdentity", polymorphicDiscriminator: - RoleManagementPolicyRule.type.polymorphicDiscriminator, + AccessReviewDecisionIdentity.type.polymorphicDiscriminator, modelProperties: { - ...RoleManagementPolicyRule.type.modelProperties, - isExpirationRequired: { - serializedName: "isExpirationRequired", - type: { - name: "Boolean" - } - }, - maximumDuration: { - serializedName: "maximumDuration", + ...AccessReviewDecisionIdentity.type.modelProperties, + appId: { + serializedName: "appId", + readOnly: true, type: { name: "String" } @@ -2590,60 +2158,24 @@ export const RoleManagementPolicyExpirationRule: coreClient.CompositeMapper = { } }; -export const RoleManagementPolicyNotificationRule: coreClient.CompositeMapper = { - serializedName: "RoleManagementPolicyNotificationRule", +export const AccessReviewDecisionResourceAzureRole: coreClient.CompositeMapper = { + serializedName: "azureRole", type: { name: "Composite", - className: "RoleManagementPolicyNotificationRule", - uberParent: "RoleManagementPolicyRule", + className: "AccessReviewDecisionResourceAzureRole", + uberParent: "AccessReviewDecisionResource", polymorphicDiscriminator: - RoleManagementPolicyRule.type.polymorphicDiscriminator, + AccessReviewDecisionResource.type.polymorphicDiscriminator, modelProperties: { - ...RoleManagementPolicyRule.type.modelProperties, - notificationType: { - serializedName: "notificationType", - type: { - name: "String" - } - }, - notificationLevel: { - serializedName: "notificationLevel", - type: { - name: "String" - } - }, - recipientType: { - serializedName: "recipientType", - type: { - name: "String" - } - }, - notificationRecipients: { - serializedName: "notificationRecipients", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - isDefaultRecipientsEnabled: { - serializedName: "isDefaultRecipientsEnabled", - type: { - name: "Boolean" - } - } + ...AccessReviewDecisionResource.type.modelProperties } } }; export let discriminators = { - RoleManagementPolicyRule: RoleManagementPolicyRule, - "RoleManagementPolicyRule.RoleManagementPolicyApprovalRule": RoleManagementPolicyApprovalRule, - "RoleManagementPolicyRule.RoleManagementPolicyAuthenticationContextRule": RoleManagementPolicyAuthenticationContextRule, - "RoleManagementPolicyRule.RoleManagementPolicyEnablementRule": RoleManagementPolicyEnablementRule, - "RoleManagementPolicyRule.RoleManagementPolicyExpirationRule": RoleManagementPolicyExpirationRule, - "RoleManagementPolicyRule.RoleManagementPolicyNotificationRule": RoleManagementPolicyNotificationRule + AccessReviewDecisionIdentity: AccessReviewDecisionIdentity, + AccessReviewDecisionResource: AccessReviewDecisionResource, + "AccessReviewDecisionIdentity.user": AccessReviewDecisionUserIdentity, + "AccessReviewDecisionIdentity.servicePrincipal": AccessReviewDecisionServicePrincipalIdentity, + "AccessReviewDecisionResource.azureRole": AccessReviewDecisionResourceAzureRole }; diff --git a/sdk/authorization/arm-authorization/src/models/parameters.ts b/sdk/authorization/arm-authorization/src/models/parameters.ts index e11ce4a859be..a8dc16f96275 100644 --- a/sdk/authorization/arm-authorization/src/models/parameters.ts +++ b/sdk/authorization/arm-authorization/src/models/parameters.ts @@ -12,11 +12,11 @@ import { OperationQueryParameter } from "@azure/core-client"; import { - RoleAssignmentScheduleRequest as RoleAssignmentScheduleRequestMapper, - RoleEligibilityScheduleRequest as RoleEligibilityScheduleRequestMapper, - RoleManagementPolicy as RoleManagementPolicyMapper, - RoleManagementPolicyAssignment as RoleManagementPolicyAssignmentMapper, - RoleAssignmentCreateParameters as RoleAssignmentCreateParametersMapper + AccessReviewHistoryDefinitionProperties as AccessReviewHistoryDefinitionPropertiesMapper, + AccessReviewScheduleDefinitionProperties as AccessReviewScheduleDefinitionPropertiesMapper, + AccessReviewInstanceProperties as AccessReviewInstancePropertiesMapper, + AccessReviewScheduleSettings as AccessReviewScheduleSettingsMapper, + AccessReviewDecisionProperties as AccessReviewDecisionPropertiesMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -43,33 +43,10 @@ export const $host: OperationURLParameter = { skipEncoding: true }; -export const scope: OperationURLParameter = { - parameterPath: "scope", - mapper: { - serializedName: "scope", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const roleAssignmentScheduleName: OperationURLParameter = { - parameterPath: "roleAssignmentScheduleName", - mapper: { - serializedName: "roleAssignmentScheduleName", - required: true, - type: { - name: "String" - } - } -}; - export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2020-10-01-preview", + defaultValue: "2021-11-16-preview", isConstant: true, serializedName: "api-version", type: { @@ -78,16 +55,6 @@ export const apiVersion: OperationQueryParameter = { } }; -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String" - } - } -}; - export const nextLink: OperationURLParameter = { parameterPath: "nextLink", mapper: { @@ -100,10 +67,10 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; -export const roleAssignmentScheduleInstanceName: OperationURLParameter = { - parameterPath: "roleAssignmentScheduleInstanceName", +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - serializedName: "roleAssignmentScheduleInstanceName", + serializedName: "subscriptionId", required: true, type: { name: "String" @@ -111,38 +78,21 @@ export const roleAssignmentScheduleInstanceName: OperationURLParameter = { } }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: RoleAssignmentScheduleRequestMapper -}; - -export const roleAssignmentScheduleRequestName: OperationURLParameter = { - parameterPath: "roleAssignmentScheduleRequestName", +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], mapper: { - serializedName: "roleAssignmentScheduleRequestName", - required: true, + serializedName: "$filter", type: { name: "String" } - } + }, + skipEncoding: true }; -export const roleEligibilityScheduleName: OperationURLParameter = { - parameterPath: "roleEligibilityScheduleName", +export const historyDefinitionId: OperationURLParameter = { + parameterPath: "historyDefinitionId", mapper: { - serializedName: "roleEligibilityScheduleName", + serializedName: "historyDefinitionId", required: true, type: { name: "String" @@ -150,37 +100,27 @@ export const roleEligibilityScheduleName: OperationURLParameter = { } }; -export const roleEligibilityScheduleInstanceName: OperationURLParameter = { - parameterPath: "roleEligibilityScheduleInstanceName", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "roleEligibilityScheduleInstanceName", - required: true, + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: RoleEligibilityScheduleRequestMapper -}; - -export const roleEligibilityScheduleRequestName: OperationURLParameter = { - parameterPath: "roleEligibilityScheduleRequestName", - mapper: { - serializedName: "roleEligibilityScheduleRequestName", - required: true, - type: { - name: "String" - } - } +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: AccessReviewHistoryDefinitionPropertiesMapper }; -export const roleManagementPolicyName: OperationURLParameter = { - parameterPath: "roleManagementPolicyName", +export const instanceId: OperationURLParameter = { + parameterPath: "instanceId", mapper: { - serializedName: "roleManagementPolicyName", + serializedName: "instanceId", required: true, type: { name: "String" @@ -188,15 +128,10 @@ export const roleManagementPolicyName: OperationURLParameter = { } }; -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: RoleManagementPolicyMapper -}; - -export const roleManagementPolicyAssignmentName: OperationURLParameter = { - parameterPath: "roleManagementPolicyAssignmentName", +export const scheduleDefinitionId: OperationURLParameter = { + parameterPath: "scheduleDefinitionId", mapper: { - serializedName: "roleManagementPolicyAssignmentName", + serializedName: "scheduleDefinitionId", required: true, type: { name: "String" @@ -204,18 +139,15 @@ export const roleManagementPolicyAssignmentName: OperationURLParameter = { } }; -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: RoleManagementPolicyAssignmentMapper +export const properties1: OperationParameter = { + parameterPath: "properties", + mapper: AccessReviewScheduleDefinitionPropertiesMapper }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const id: OperationURLParameter = { + parameterPath: "id", mapper: { - constraints: { - MinLength: 1 - }, - serializedName: "subscriptionId", + serializedName: "id", required: true, type: { name: "String" @@ -223,35 +155,20 @@ export const subscriptionId: OperationURLParameter = { } }; -export const filter1: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String" - } - }, - skipEncoding: true +export const properties2: OperationParameter = { + parameterPath: "properties", + mapper: AccessReviewInstancePropertiesMapper }; -export const tenantId: OperationQueryParameter = { - parameterPath: ["options", "tenantId"], - mapper: { - serializedName: "tenantId", - type: { - name: "String" - } - } +export const properties3: OperationParameter = { + parameterPath: "properties", + mapper: AccessReviewScheduleSettingsMapper }; -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", +export const decisionId: OperationURLParameter = { + parameterPath: "decisionId", mapper: { - constraints: { - MaxLength: 90, - MinLength: 1 - }, - serializedName: "resourceGroupName", + serializedName: "decisionId", required: true, type: { name: "String" @@ -259,67 +176,7 @@ export const resourceGroupName: OperationURLParameter = { } }; -export const resourceProviderNamespace: OperationURLParameter = { - parameterPath: "resourceProviderNamespace", - mapper: { - serializedName: "resourceProviderNamespace", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const resourceType: OperationURLParameter = { - parameterPath: "resourceType", - mapper: { - serializedName: "resourceType", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const resourceName: OperationURLParameter = { - parameterPath: "resourceName", - mapper: { - serializedName: "resourceName", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const roleAssignmentName: OperationURLParameter = { - parameterPath: "roleAssignmentName", - mapper: { - serializedName: "roleAssignmentName", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: RoleAssignmentCreateParametersMapper -}; - -export const roleAssignmentId: OperationURLParameter = { - parameterPath: "roleAssignmentId", - mapper: { - serializedName: "roleAssignmentId", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true +export const properties4: OperationParameter = { + parameterPath: "properties", + mapper: AccessReviewDecisionPropertiesMapper }; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts new file mode 100644 index 000000000000..58839bfa576a --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { AccessReviewDefaultSettingsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewDefaultSettingsGetOptionalParams, + AccessReviewDefaultSettingsGetResponse, + AccessReviewScheduleSettings, + AccessReviewDefaultSettingsPutOptionalParams, + AccessReviewDefaultSettingsPutResponse +} from "../models"; + +/** Class containing AccessReviewDefaultSettingsOperations operations. */ +export class AccessReviewDefaultSettingsOperationsImpl + implements AccessReviewDefaultSettingsOperations { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewDefaultSettingsOperations class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review default settings for the subscription + * @param options The options parameters. + */ + get( + options?: AccessReviewDefaultSettingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, getOperationSpec); + } + + /** + * Get access review default settings for the subscription + * @param properties Access review schedule settings. + * @param options The options parameters. + */ + put( + properties: AccessReviewScheduleSettings, + options?: AccessReviewDefaultSettingsPutOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { properties, options }, + putOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDefaultSettings + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const putOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDefaultSettings + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + requestBody: Parameters.properties3, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts new file mode 100644 index 000000000000..1061170f58da --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { AccessReviewHistoryDefinitionInstance } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams, + AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse +} from "../models"; + +/** Class containing AccessReviewHistoryDefinitionInstance operations. */ +export class AccessReviewHistoryDefinitionInstanceImpl + implements AccessReviewHistoryDefinitionInstance { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewHistoryDefinitionInstance class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and + * can be retrieved by fetching the accessReviewHistoryDefinition object. + * @param historyDefinitionId The id of the access review history definition. + * @param instanceId The id of the access review history definition instance to generate a URI for. + * @param options The options parameters. + */ + generateDownloadUri( + historyDefinitionId: string, + instanceId: string, + options?: AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { historyDefinitionId, instanceId, options }, + generateDownloadUriOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const generateDownloadUriOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}/instances/{instanceId}/generateDownloadUri", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryInstance + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.historyDefinitionId, + Parameters.instanceId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts new file mode 100644 index 000000000000..858a755b9d7f --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts @@ -0,0 +1,166 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewHistoryDefinitionInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewHistoryInstance, + AccessReviewHistoryDefinitionInstancesListNextOptionalParams, + AccessReviewHistoryDefinitionInstancesListOptionalParams, + AccessReviewHistoryDefinitionInstancesListResponse, + AccessReviewHistoryDefinitionInstancesListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewHistoryDefinitionInstances operations. */ +export class AccessReviewHistoryDefinitionInstancesImpl + implements AccessReviewHistoryDefinitionInstances { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewHistoryDefinitionInstances class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review history definition instances by definition Id + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + public list( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(historyDefinitionId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(historyDefinitionId, options); + } + }; + } + + private async *listPagingPage( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionInstancesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(historyDefinitionId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + historyDefinitionId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + historyDefinitionId, + options + )) { + yield* page; + } + } + + /** + * Get access review history definition instances by definition Id + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + private _list( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { historyDefinitionId, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param historyDefinitionId The id of the access review history definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + historyDefinitionId: string, + nextLink: string, + options?: AccessReviewHistoryDefinitionInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { historyDefinitionId, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}/instances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryDefinitionInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.historyDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryDefinitionInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.historyDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts new file mode 100644 index 000000000000..b78f8f3e5b37 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { AccessReviewHistoryDefinitionOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewHistoryDefinitionProperties, + AccessReviewHistoryDefinitionCreateOptionalParams, + AccessReviewHistoryDefinitionCreateResponse, + AccessReviewHistoryDefinitionDeleteByIdOptionalParams +} from "../models"; + +/** Class containing AccessReviewHistoryDefinitionOperations operations. */ +export class AccessReviewHistoryDefinitionOperationsImpl + implements AccessReviewHistoryDefinitionOperations { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewHistoryDefinitionOperations class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Create a scheduled or one-time Access Review History Definition + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @param options The options parameters. + */ + create( + historyDefinitionId: string, + properties: AccessReviewHistoryDefinitionProperties, + options?: AccessReviewHistoryDefinitionCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { historyDefinitionId, properties, options }, + createOperationSpec + ); + } + + /** + * Delete an access review history definition + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + deleteById( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionDeleteByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { historyDefinitionId, options }, + deleteByIdOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryDefinition + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.historyDefinitionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteByIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.historyDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts new file mode 100644 index 000000000000..be4fd2dbd809 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewHistoryDefinitions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewHistoryDefinition, + AccessReviewHistoryDefinitionsListNextOptionalParams, + AccessReviewHistoryDefinitionsListOptionalParams, + AccessReviewHistoryDefinitionsListResponse, + AccessReviewHistoryDefinitionsGetByIdOptionalParams, + AccessReviewHistoryDefinitionsGetByIdResponse, + AccessReviewHistoryDefinitionsListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewHistoryDefinitions operations. */ +export class AccessReviewHistoryDefinitionsImpl + implements AccessReviewHistoryDefinitions { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewHistoryDefinitions class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only + * available for 30 days after creation. + * @param options The options parameters. + */ + public list( + options?: AccessReviewHistoryDefinitionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: AccessReviewHistoryDefinitionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: AccessReviewHistoryDefinitionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only + * available for 30 days after creation. + * @param options The options parameters. + */ + private _list( + options?: AccessReviewHistoryDefinitionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Get access review history definition by definition Id + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + getById( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionsGetByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { historyDefinitionId, options }, + getByIdOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: AccessReviewHistoryDefinitionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getByIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryDefinition + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.historyDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewHistoryDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts new file mode 100644 index 000000000000..447d349d61c7 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewInstanceContactedReviewers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewContactedReviewer, + AccessReviewInstanceContactedReviewersListNextOptionalParams, + AccessReviewInstanceContactedReviewersListOptionalParams, + AccessReviewInstanceContactedReviewersListResponse, + AccessReviewInstanceContactedReviewersListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewInstanceContactedReviewers operations. */ +export class AccessReviewInstanceContactedReviewersImpl + implements AccessReviewInstanceContactedReviewers { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewInstanceContactedReviewers class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review instance contacted reviewers + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + public list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceContactedReviewersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scheduleDefinitionId, id, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scheduleDefinitionId, id, options); + } + }; + } + + private async *listPagingPage( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceContactedReviewersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scheduleDefinitionId, id, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + scheduleDefinitionId, + id, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceContactedReviewersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + scheduleDefinitionId, + id, + options + )) { + yield* page; + } + } + + /** + * Get access review instance contacted reviewers + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + private _list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceContactedReviewersListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scheduleDefinitionId: string, + id: string, + nextLink: string, + options?: AccessReviewInstanceContactedReviewersListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/contactedReviewers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewContactedReviewerListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewContactedReviewerListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts new file mode 100644 index 000000000000..279a0dcd6999 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewInstanceDecisions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewDecision, + AccessReviewInstanceDecisionsListNextOptionalParams, + AccessReviewInstanceDecisionsListOptionalParams, + AccessReviewInstanceDecisionsListResponse, + AccessReviewInstanceDecisionsListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewInstanceDecisions operations. */ +export class AccessReviewInstanceDecisionsImpl + implements AccessReviewInstanceDecisions { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewInstanceDecisions class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review instance decisions + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + public list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceDecisionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scheduleDefinitionId, id, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scheduleDefinitionId, id, options); + } + }; + } + + private async *listPagingPage( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceDecisionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scheduleDefinitionId, id, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + scheduleDefinitionId, + id, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceDecisionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + scheduleDefinitionId, + id, + options + )) { + yield* page; + } + } + + /** + * Get access review instance decisions + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + private _list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceDecisionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scheduleDefinitionId: string, + id: string, + nextLink: string, + options?: AccessReviewInstanceDecisionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDecisionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDecisionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts new file mode 100644 index 000000000000..1cb78a3324c6 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts @@ -0,0 +1,267 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewInstanceMyDecisions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewDecision, + AccessReviewInstanceMyDecisionsListNextOptionalParams, + AccessReviewInstanceMyDecisionsListOptionalParams, + AccessReviewInstanceMyDecisionsListResponse, + AccessReviewInstanceMyDecisionsGetByIdOptionalParams, + AccessReviewInstanceMyDecisionsGetByIdResponse, + AccessReviewDecisionProperties, + AccessReviewInstanceMyDecisionsPatchOptionalParams, + AccessReviewInstanceMyDecisionsPatchResponse, + AccessReviewInstanceMyDecisionsListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewInstanceMyDecisions operations. */ +export class AccessReviewInstanceMyDecisionsImpl + implements AccessReviewInstanceMyDecisions { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewInstanceMyDecisions class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get my access review instance decisions. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + public list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceMyDecisionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scheduleDefinitionId, id, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scheduleDefinitionId, id, options); + } + }; + } + + private async *listPagingPage( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceMyDecisionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scheduleDefinitionId, id, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + scheduleDefinitionId, + id, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceMyDecisionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + scheduleDefinitionId, + id, + options + )) { + yield* page; + } + } + + /** + * Get my access review instance decisions. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + private _list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceMyDecisionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + listOperationSpec + ); + } + + /** + * Get my single access review instance decision. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param decisionId The id of the decision record. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + id: string, + decisionId: string, + options?: AccessReviewInstanceMyDecisionsGetByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, decisionId, options }, + getByIdOperationSpec + ); + } + + /** + * Record a decision. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param decisionId The id of the decision record. + * @param properties Access review decision properties to patch. + * @param options The options parameters. + */ + patch( + scheduleDefinitionId: string, + id: string, + decisionId: string, + properties: AccessReviewDecisionProperties, + options?: AccessReviewInstanceMyDecisionsPatchOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, decisionId, properties, options }, + patchOperationSpec + ); + } + + /** + * ListNext + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scheduleDefinitionId: string, + id: string, + nextLink: string, + options?: AccessReviewInstanceMyDecisionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDecisionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByIdOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions/{decisionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDecision + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scheduleDefinitionId, + Parameters.id, + Parameters.decisionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const patchOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions/{decisionId}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDecision + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + requestBody: Parameters.properties4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scheduleDefinitionId, + Parameters.id, + Parameters.decisionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewDecisionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts new file mode 100644 index 000000000000..f05466471bf4 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts @@ -0,0 +1,221 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { AccessReviewInstanceOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewInstanceStopOptionalParams, + AccessReviewInstanceResetDecisionsOptionalParams, + AccessReviewInstanceApplyDecisionsOptionalParams, + AccessReviewInstanceSendRemindersOptionalParams, + AccessReviewInstanceAcceptRecommendationsOptionalParams +} from "../models"; + +/** Class containing AccessReviewInstanceOperations operations. */ +export class AccessReviewInstanceOperationsImpl + implements AccessReviewInstanceOperations { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewInstanceOperations class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * An action to stop an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + stop( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceStopOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + stopOperationSpec + ); + } + + /** + * An action to reset all decisions for an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + resetDecisions( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceResetDecisionsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + resetDecisionsOperationSpec + ); + } + + /** + * An action to apply all decisions for an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + applyDecisions( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceApplyDecisionsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + applyDecisionsOperationSpec + ); + } + + /** + * An action to send reminders for an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + sendReminders( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceSendRemindersOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + sendRemindersOperationSpec + ); + } + + /** + * An action to accept recommendations for decision in an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + acceptRecommendations( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceAcceptRecommendationsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + acceptRecommendationsOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/stop", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const resetDecisionsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/resetDecisions", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const applyDecisionsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/applyDecisions", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const sendRemindersOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/sendReminders", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const acceptRecommendationsOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/acceptRecommendations", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts new file mode 100644 index 000000000000..70922c853751 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts @@ -0,0 +1,252 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewInstance, + AccessReviewInstancesListNextOptionalParams, + AccessReviewInstancesListOptionalParams, + AccessReviewInstancesListResponse, + AccessReviewInstancesGetByIdOptionalParams, + AccessReviewInstancesGetByIdResponse, + AccessReviewInstanceProperties, + AccessReviewInstancesCreateOptionalParams, + AccessReviewInstancesCreateResponse, + AccessReviewInstancesListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewInstances operations. */ +export class AccessReviewInstancesImpl implements AccessReviewInstances { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewInstances class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review instances + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + public list( + scheduleDefinitionId: string, + options?: AccessReviewInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scheduleDefinitionId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scheduleDefinitionId, options); + } + }; + } + + private async *listPagingPage( + scheduleDefinitionId: string, + options?: AccessReviewInstancesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scheduleDefinitionId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + scheduleDefinitionId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scheduleDefinitionId: string, + options?: AccessReviewInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + scheduleDefinitionId, + options + )) { + yield* page; + } + } + + /** + * Get access review instances + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + private _list( + scheduleDefinitionId: string, + options?: AccessReviewInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, options }, + listOperationSpec + ); + } + + /** + * Get access review instances + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstancesGetByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + getByIdOperationSpec + ); + } + + /** + * Update access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Access review instance properties. + * @param options The options parameters. + */ + create( + scheduleDefinitionId: string, + id: string, + properties: AccessReviewInstanceProperties, + options?: AccessReviewInstancesCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, properties, options }, + createOperationSpec + ); + } + + /** + * ListNext + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scheduleDefinitionId: string, + nextLink: string, + options?: AccessReviewInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstance + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstance + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + requestBody: Parameters.properties2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts new file mode 100644 index 000000000000..dd65a2600972 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts @@ -0,0 +1,201 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewInstancesAssignedForMyApproval } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewInstance, + AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams, + AccessReviewInstancesAssignedForMyApprovalListOptionalParams, + AccessReviewInstancesAssignedForMyApprovalListResponse, + AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams, + AccessReviewInstancesAssignedForMyApprovalGetByIdResponse, + AccessReviewInstancesAssignedForMyApprovalListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewInstancesAssignedForMyApproval operations. */ +export class AccessReviewInstancesAssignedForMyApprovalImpl + implements AccessReviewInstancesAssignedForMyApproval { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewInstancesAssignedForMyApproval class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review instances assigned for my approval. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + public list( + scheduleDefinitionId: string, + options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scheduleDefinitionId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scheduleDefinitionId, options); + } + }; + } + + private async *listPagingPage( + scheduleDefinitionId: string, + options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scheduleDefinitionId, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + scheduleDefinitionId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scheduleDefinitionId: string, + options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + scheduleDefinitionId, + options + )) { + yield* page; + } + } + + /** + * Get access review instances assigned for my approval. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + private _list( + scheduleDefinitionId: string, + options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, options }, + listOperationSpec + ); + } + + /** + * Get single access review instance assigned for my approval. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + getByIdOperationSpec + ); + } + + /** + * ListNext + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scheduleDefinitionId: string, + nextLink: string, + options?: AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.scheduleDefinitionId], + headerParameters: [Parameters.accept], + serializer +}; +const getByIdOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstance + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts new file mode 100644 index 000000000000..455682d885e8 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts @@ -0,0 +1,295 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewScheduleDefinitions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewScheduleDefinition, + AccessReviewScheduleDefinitionsListNextOptionalParams, + AccessReviewScheduleDefinitionsListOptionalParams, + AccessReviewScheduleDefinitionsListResponse, + AccessReviewScheduleDefinitionsGetByIdOptionalParams, + AccessReviewScheduleDefinitionsGetByIdResponse, + AccessReviewScheduleDefinitionsDeleteByIdOptionalParams, + AccessReviewScheduleDefinitionProperties, + AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams, + AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse, + AccessReviewScheduleDefinitionsStopOptionalParams, + AccessReviewScheduleDefinitionsListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewScheduleDefinitions operations. */ +export class AccessReviewScheduleDefinitionsImpl + implements AccessReviewScheduleDefinitions { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewScheduleDefinitions class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review schedule definitions + * @param options The options parameters. + */ + public list( + options?: AccessReviewScheduleDefinitionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: AccessReviewScheduleDefinitionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: AccessReviewScheduleDefinitionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Get access review schedule definitions + * @param options The options parameters. + */ + private _list( + options?: AccessReviewScheduleDefinitionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Get single access review definition + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + options?: AccessReviewScheduleDefinitionsGetByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, options }, + getByIdOperationSpec + ); + } + + /** + * Delete access review schedule definition + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + deleteById( + scheduleDefinitionId: string, + options?: AccessReviewScheduleDefinitionsDeleteByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, options }, + deleteByIdOperationSpec + ); + } + + /** + * Create or Update access review schedule definition. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @param options The options parameters. + */ + createOrUpdateById( + scheduleDefinitionId: string, + properties: AccessReviewScheduleDefinitionProperties, + options?: AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, properties, options }, + createOrUpdateByIdOperationSpec + ); + } + + /** + * Stop access review definition + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + stop( + scheduleDefinitionId: string, + options?: AccessReviewScheduleDefinitionsStopOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, options }, + stopOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: AccessReviewScheduleDefinitionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getByIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewScheduleDefinition + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteByIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewScheduleDefinition + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + requestBody: Parameters.properties1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/stop", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.scheduleDefinitionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts new file mode 100644 index 000000000000..0f55d5eace36 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessReviewScheduleDefinitionsAssignedForMyApproval } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewScheduleDefinition, + AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams, + AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, + AccessReviewScheduleDefinitionsAssignedForMyApprovalListResponse, + AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse +} from "../models"; + +/// +/** Class containing AccessReviewScheduleDefinitionsAssignedForMyApproval operations. */ +export class AccessReviewScheduleDefinitionsAssignedForMyApprovalImpl + implements AccessReviewScheduleDefinitionsAssignedForMyApproval { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class AccessReviewScheduleDefinitionsAssignedForMyApproval class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review instances assigned for my approval. + * @param options The options parameters. + */ + public list( + options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Get access review instances assigned for my approval. + * @param options The options parameters. + */ + private _list( + options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams + ): Promise< + AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse + > { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts b/sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts deleted file mode 100644 index 1e98e4feaa3e..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { EligibleChildResources } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - EligibleChildResource, - EligibleChildResourcesGetNextOptionalParams, - EligibleChildResourcesGetOptionalParams, - EligibleChildResourcesGetResponse, - EligibleChildResourcesGetNextResponse -} from "../models"; - -/// -/** Class containing EligibleChildResources operations. */ -export class EligibleChildResourcesImpl implements EligibleChildResources { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class EligibleChildResources class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Get the child resources of a resource on which user has eligible access - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - public list( - scope: string, - options?: EligibleChildResourcesGetOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.getPagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.getPagingPage(scope, options); - } - }; - } - - private async *getPagingPage( - scope: string, - options?: EligibleChildResourcesGetOptionalParams - ): AsyncIterableIterator { - let result = await this._get(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._getNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *getPagingAll( - scope: string, - options?: EligibleChildResourcesGetOptionalParams - ): AsyncIterableIterator { - for await (const page of this.getPagingPage(scope, options)) { - yield* page; - } - } - - /** - * Get the child resources of a resource on which user has eligible access - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - private _get( - scope: string, - options?: EligibleChildResourcesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - getOperationSpec - ); - } - - /** - * GetNext - * @param scope The scope of the role management policy. - * @param nextLink The nextLink from the previous successful call to the Get method. - * @param options The options parameters. - */ - private _getNext( - scope: string, - nextLink: string, - options?: EligibleChildResourcesGetNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - getNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EligibleChildResourcesListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const getNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EligibleChildResourcesListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/index.ts b/sdk/authorization/arm-authorization/src/operations/index.ts index e547e894ea9f..7fa7646d62a8 100644 --- a/sdk/authorization/arm-authorization/src/operations/index.ts +++ b/sdk/authorization/arm-authorization/src/operations/index.ts @@ -6,13 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./roleAssignmentSchedules"; -export * from "./roleAssignmentScheduleInstances"; -export * from "./roleAssignmentScheduleRequests"; -export * from "./roleEligibilitySchedules"; -export * from "./roleEligibilityScheduleInstances"; -export * from "./roleEligibilityScheduleRequests"; -export * from "./roleManagementPolicies"; -export * from "./roleManagementPolicyAssignments"; -export * from "./eligibleChildResources"; -export * from "./roleAssignments"; +export * from "./operations"; +export * from "./accessReviewHistoryDefinitions"; +export * from "./accessReviewHistoryDefinitionOperations"; +export * from "./accessReviewHistoryDefinitionInstance"; +export * from "./accessReviewHistoryDefinitionInstances"; +export * from "./accessReviewScheduleDefinitions"; +export * from "./accessReviewInstances"; +export * from "./accessReviewInstanceOperations"; +export * from "./accessReviewInstanceDecisions"; +export * from "./accessReviewInstanceContactedReviewers"; +export * from "./accessReviewDefaultSettingsOperations"; +export * from "./accessReviewScheduleDefinitionsAssignedForMyApproval"; +export * from "./accessReviewInstancesAssignedForMyApproval"; +export * from "./accessReviewInstanceMyDecisions"; +export * from "./tenantLevelAccessReviewInstanceContactedReviewers"; diff --git a/sdk/authorization/arm-authorization/src/operations/operations.ts b/sdk/authorization/arm-authorization/src/operations/operations.ts new file mode 100644 index 000000000000..dc058f45933d --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Lists the operations available from this provider. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists the operations available from this provider. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Authorization/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts deleted file mode 100644 index 68ee23d55f0c..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleAssignmentScheduleInstances } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleAssignmentScheduleInstance, - RoleAssignmentScheduleInstancesListForScopeNextOptionalParams, - RoleAssignmentScheduleInstancesListForScopeOptionalParams, - RoleAssignmentScheduleInstancesListForScopeResponse, - RoleAssignmentScheduleInstancesGetOptionalParams, - RoleAssignmentScheduleInstancesGetResponse, - RoleAssignmentScheduleInstancesListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleAssignmentScheduleInstances operations. */ -export class RoleAssignmentScheduleInstancesImpl - implements RoleAssignmentScheduleInstances { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleAssignmentScheduleInstances class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role assignment schedule instances of a role assignment schedule. - * @param scope The scope of the role assignment schedule. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Gets role assignment schedule instances of a role assignment schedule. - * @param scope The scope of the role assignment schedule. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * Gets the specified role assignment schedule instance. - * @param scope The scope of the role assignments schedules. - * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role - * assignment schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentScheduleInstanceName: string, - options?: RoleAssignmentScheduleInstancesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentScheduleInstanceName, options }, - getOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role assignment schedule. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleAssignmentScheduleInstancesListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleInstanceListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleInstance - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentScheduleInstanceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleInstanceListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts deleted file mode 100644 index 6443fee67f96..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleAssignmentScheduleRequests } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleAssignmentScheduleRequest, - RoleAssignmentScheduleRequestsListForScopeNextOptionalParams, - RoleAssignmentScheduleRequestsListForScopeOptionalParams, - RoleAssignmentScheduleRequestsCreateOptionalParams, - RoleAssignmentScheduleRequestsCreateResponse, - RoleAssignmentScheduleRequestsGetOptionalParams, - RoleAssignmentScheduleRequestsGetResponse, - RoleAssignmentScheduleRequestsListForScopeResponse, - RoleAssignmentScheduleRequestsCancelOptionalParams, - RoleAssignmentScheduleRequestsListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleAssignmentScheduleRequests operations. */ -export class RoleAssignmentScheduleRequestsImpl - implements RoleAssignmentScheduleRequests { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleAssignmentScheduleRequests class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role assignment schedule requests for a scope. - * @param scope The scope of the role assignments schedule requests. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Creates a role assignment schedule request. - * @param scope The scope of the role assignment schedule request to create. The scope can be any REST - * resource instance. For example, use - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - * for a resource group, and - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentScheduleRequestName The name of the role assignment to create. It can be any - * valid GUID. - * @param parameters Parameters for the role assignment schedule request. - * @param options The options parameters. - */ - create( - scope: string, - roleAssignmentScheduleRequestName: string, - parameters: RoleAssignmentScheduleRequest, - options?: RoleAssignmentScheduleRequestsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentScheduleRequestName, parameters, options }, - createOperationSpec - ); - } - - /** - * Get the specified role assignment schedule request. - * @param scope The scope of the role assignment schedule request. - * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to - * get. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentScheduleRequestName: string, - options?: RoleAssignmentScheduleRequestsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentScheduleRequestName, options }, - getOperationSpec - ); - } - - /** - * Gets role assignment schedule requests for a scope. - * @param scope The scope of the role assignments schedule requests. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * Cancels a pending role assignment schedule request. - * @param scope The scope of the role assignment request to cancel. - * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. - * @param options The options parameters. - */ - cancel( - scope: string, - roleAssignmentScheduleRequestName: string, - options?: RoleAssignmentScheduleRequestsCancelOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentScheduleRequestName, options }, - cancelOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role assignments schedule requests. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleAssignmentScheduleRequestsListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", - httpMethod: "PUT", - responses: { - 201: { - bodyMapper: Mappers.RoleAssignmentScheduleRequest - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentScheduleRequestName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleRequest - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentScheduleRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleRequestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const cancelOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", - httpMethod: "POST", - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentScheduleRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleRequestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts deleted file mode 100644 index f625ac6f3ab2..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleAssignmentSchedules } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleAssignmentSchedule, - RoleAssignmentSchedulesListForScopeNextOptionalParams, - RoleAssignmentSchedulesListForScopeOptionalParams, - RoleAssignmentSchedulesGetOptionalParams, - RoleAssignmentSchedulesGetResponse, - RoleAssignmentSchedulesListForScopeResponse, - RoleAssignmentSchedulesListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleAssignmentSchedules operations. */ -export class RoleAssignmentSchedulesImpl implements RoleAssignmentSchedules { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleAssignmentSchedules class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role assignment schedules for a resource scope. - * @param scope The scope of the role assignments schedules. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleAssignmentSchedulesListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleAssignmentSchedulesListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleAssignmentSchedulesListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Get the specified role assignment schedule for a resource scope - * @param scope The scope of the role assignment schedule. - * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentScheduleName: string, - options?: RoleAssignmentSchedulesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentScheduleName, options }, - getOperationSpec - ); - } - - /** - * Gets role assignment schedules for a resource scope. - * @param scope The scope of the role assignments schedules. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleAssignmentSchedulesListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role assignments schedules. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleAssignmentSchedulesListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentSchedule - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentScheduleName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentScheduleListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts deleted file mode 100644 index 5fbb7b8825d2..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleAssignments.ts +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleAssignments } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleAssignment, - RoleAssignmentsListForSubscriptionNextOptionalParams, - RoleAssignmentsListForSubscriptionOptionalParams, - RoleAssignmentsListForResourceGroupNextOptionalParams, - RoleAssignmentsListForResourceGroupOptionalParams, - RoleAssignmentsListForResourceNextOptionalParams, - RoleAssignmentsListForResourceOptionalParams, - RoleAssignmentsListForScopeNextOptionalParams, - RoleAssignmentsListForScopeOptionalParams, - RoleAssignmentsListForSubscriptionResponse, - RoleAssignmentsListForResourceGroupResponse, - RoleAssignmentsListForResourceResponse, - RoleAssignmentsGetOptionalParams, - RoleAssignmentsGetResponse, - RoleAssignmentCreateParameters, - RoleAssignmentsCreateOptionalParams, - RoleAssignmentsCreateResponse, - RoleAssignmentsDeleteOptionalParams, - RoleAssignmentsDeleteResponse, - RoleAssignmentsValidateOptionalParams, - RoleAssignmentsValidateResponse, - RoleAssignmentsListForScopeResponse, - RoleAssignmentsGetByIdOptionalParams, - RoleAssignmentsGetByIdResponse, - RoleAssignmentsCreateByIdOptionalParams, - RoleAssignmentsCreateByIdResponse, - RoleAssignmentsDeleteByIdOptionalParams, - RoleAssignmentsDeleteByIdResponse, - RoleAssignmentsValidateByIdOptionalParams, - RoleAssignmentsValidateByIdResponse, - RoleAssignmentsListForSubscriptionNextResponse, - RoleAssignmentsListForResourceGroupNextResponse, - RoleAssignmentsListForResourceNextResponse, - RoleAssignmentsListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleAssignments operations. */ -export class RoleAssignmentsImpl implements RoleAssignments { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleAssignments class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * List all role assignments that apply to a subscription. - * @param options The options parameters. - */ - public listForSubscription( - options?: RoleAssignmentsListForSubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForSubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForSubscriptionPagingPage(options); - } - }; - } - - private async *listForSubscriptionPagingPage( - options?: RoleAssignmentsListForSubscriptionOptionalParams - ): AsyncIterableIterator { - let result = await this._listForSubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForSubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForSubscriptionPagingAll( - options?: RoleAssignmentsListForSubscriptionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForSubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List all role assignments that apply to a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listForResourceGroup( - resourceGroupName: string, - options?: RoleAssignmentsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForResourceGroupPagingPage(resourceGroupName, options); - } - }; - } - - private async *listForResourceGroupPagingPage( - resourceGroupName: string, - options?: RoleAssignmentsListForResourceGroupOptionalParams - ): AsyncIterableIterator { - let result = await this._listForResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForResourceGroupPagingAll( - resourceGroupName: string, - options?: RoleAssignmentsListForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * List all role assignments that apply to a resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The resource name. - * @param options The options parameters. - */ - public listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - resourceType: string, - resourceName: string, - options?: RoleAssignmentsListForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourcePagingAll( - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForResourcePagingPage( - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - options - ); - } - }; - } - - private async *listForResourcePagingPage( - resourceGroupName: string, - resourceProviderNamespace: string, - resourceType: string, - resourceName: string, - options?: RoleAssignmentsListForResourceOptionalParams - ): AsyncIterableIterator { - let result = await this._listForResource( - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForResourceNext( - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForResourcePagingAll( - resourceGroupName: string, - resourceProviderNamespace: string, - resourceType: string, - resourceName: string, - options?: RoleAssignmentsListForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourcePagingPage( - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - options - )) { - yield* page; - } - } - - /** - * List all role assignments that apply to a scope. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleAssignmentsListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleAssignmentsListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleAssignmentsListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * List all role assignments that apply to a subscription. - * @param options The options parameters. - */ - private _listForSubscription( - options?: RoleAssignmentsListForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { options }, - listForSubscriptionOperationSpec - ); - } - - /** - * List all role assignments that apply to a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listForResourceGroup( - resourceGroupName: string, - options?: RoleAssignmentsListForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listForResourceGroupOperationSpec - ); - } - - /** - * List all role assignments that apply to a resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The resource name. - * @param options The options parameters. - */ - private _listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - resourceType: string, - resourceName: string, - options?: RoleAssignmentsListForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - options - }, - listForResourceOperationSpec - ); - } - - /** - * Get a role assignment by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentName: string, - options?: RoleAssignmentsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentName, options }, - getOperationSpec - ); - } - - /** - * Create or update a role assignment by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - create( - scope: string, - roleAssignmentName: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentName, parameters, options }, - createOperationSpec - ); - } - - /** - * Delete a role assignment by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param options The options parameters. - */ - delete( - scope: string, - roleAssignmentName: string, - options?: RoleAssignmentsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentName, options }, - deleteOperationSpec - ); - } - - /** - * Validate a role assignment create or update operation by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - validate( - scope: string, - roleAssignmentName: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsValidateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleAssignmentName, parameters, options }, - validateOperationSpec - ); - } - - /** - * List all role assignments that apply to a scope. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleAssignmentsListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * Get a role assignment by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param options The options parameters. - */ - getById( - roleAssignmentId: string, - options?: RoleAssignmentsGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { roleAssignmentId, options }, - getByIdOperationSpec - ); - } - - /** - * Create or update a role assignment by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - createById( - roleAssignmentId: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsCreateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { roleAssignmentId, parameters, options }, - createByIdOperationSpec - ); - } - - /** - * Delete a role assignment by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param options The options parameters. - */ - deleteById( - roleAssignmentId: string, - options?: RoleAssignmentsDeleteByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { roleAssignmentId, options }, - deleteByIdOperationSpec - ); - } - - /** - * Validate a role assignment create or update operation by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - validateById( - roleAssignmentId: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsValidateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { roleAssignmentId, parameters, options }, - validateByIdOperationSpec - ); - } - - /** - * ListForSubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListForSubscription method. - * @param options The options parameters. - */ - private _listForSubscriptionNext( - nextLink: string, - options?: RoleAssignmentsListForSubscriptionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listForSubscriptionNextOperationSpec - ); - } - - /** - * ListForResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListForResourceGroup method. - * @param options The options parameters. - */ - private _listForResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: RoleAssignmentsListForResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec - ); - } - - /** - * ListForResourceNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The resource name. - * @param nextLink The nextLink from the previous successful call to the ListForResource method. - * @param options The options parameters. - */ - private _listForResourceNext( - resourceGroupName: string, - resourceProviderNamespace: string, - resourceType: string, - resourceName: string, - nextLink: string, - options?: RoleAssignmentsListForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceProviderNamespace, - resourceType, - resourceName, - nextLink, - options - }, - listForResourceNextOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleAssignmentsListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, - Parameters.resourceType, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignment - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion, Parameters.tenantId], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignment - }, - 201: { - bodyMapper: Mappers.RoleAssignment - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", - httpMethod: "DELETE", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignment - }, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion, Parameters.tenantId], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const validateOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ValidationResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleAssignmentName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Authorization/roleAssignments", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: "/{roleAssignmentId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignment - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion, Parameters.tenantId], - urlParameters: [Parameters.$host, Parameters.roleAssignmentId], - headerParameters: [Parameters.accept], - serializer -}; -const createByIdOperationSpec: coreClient.OperationSpec = { - path: "/{roleAssignmentId}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignment - }, - 201: { - bodyMapper: Mappers.RoleAssignment - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.roleAssignmentId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteByIdOperationSpec: coreClient.OperationSpec = { - path: "/{roleAssignmentId}", - httpMethod: "DELETE", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignment - }, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion, Parameters.tenantId], - urlParameters: [Parameters.$host, Parameters.roleAssignmentId], - headerParameters: [Parameters.accept], - serializer -}; -const validateByIdOperationSpec: coreClient.OperationSpec = { - path: "/{roleAssignmentId}/validate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ValidationResponse - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.roleAssignmentId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listForSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceProviderNamespace, - Parameters.resourceType, - Parameters.resourceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleAssignmentListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter1, - Parameters.tenantId - ], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts deleted file mode 100644 index 29ca5e2f75b4..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleEligibilityScheduleInstances } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleEligibilityScheduleInstance, - RoleEligibilityScheduleInstancesListForScopeNextOptionalParams, - RoleEligibilityScheduleInstancesListForScopeOptionalParams, - RoleEligibilityScheduleInstancesListForScopeResponse, - RoleEligibilityScheduleInstancesGetOptionalParams, - RoleEligibilityScheduleInstancesGetResponse, - RoleEligibilityScheduleInstancesListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleEligibilityScheduleInstances operations. */ -export class RoleEligibilityScheduleInstancesImpl - implements RoleEligibilityScheduleInstances { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleEligibilityScheduleInstances class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role eligibility schedule instances of a role eligibility schedule. - * @param scope The scope of the role eligibility schedule. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Gets role eligibility schedule instances of a role eligibility schedule. - * @param scope The scope of the role eligibility schedule. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * Gets the specified role eligibility schedule instance. - * @param scope The scope of the role eligibility schedules. - * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role - * eligibility schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleEligibilityScheduleInstanceName: string, - options?: RoleEligibilityScheduleInstancesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleEligibilityScheduleInstanceName, options }, - getOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role eligibility schedule. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleEligibilityScheduleInstancesListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleInstanceListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleInstance - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleEligibilityScheduleInstanceName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleInstanceListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts deleted file mode 100644 index 5c13e3ab412d..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleEligibilityScheduleRequests } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleEligibilityScheduleRequest, - RoleEligibilityScheduleRequestsListForScopeNextOptionalParams, - RoleEligibilityScheduleRequestsListForScopeOptionalParams, - RoleEligibilityScheduleRequestsCreateOptionalParams, - RoleEligibilityScheduleRequestsCreateResponse, - RoleEligibilityScheduleRequestsGetOptionalParams, - RoleEligibilityScheduleRequestsGetResponse, - RoleEligibilityScheduleRequestsListForScopeResponse, - RoleEligibilityScheduleRequestsCancelOptionalParams, - RoleEligibilityScheduleRequestsListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleEligibilityScheduleRequests operations. */ -export class RoleEligibilityScheduleRequestsImpl - implements RoleEligibilityScheduleRequests { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleEligibilityScheduleRequests class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role eligibility schedule requests for a scope. - * @param scope The scope of the role eligibility schedule requests. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Creates a role eligibility schedule request. - * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST - * resource instance. For example, use - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - * for a resource group, and - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any - * valid GUID. - * @param parameters Parameters for the role eligibility schedule request. - * @param options The options parameters. - */ - create( - scope: string, - roleEligibilityScheduleRequestName: string, - parameters: RoleEligibilityScheduleRequest, - options?: RoleEligibilityScheduleRequestsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleEligibilityScheduleRequestName, parameters, options }, - createOperationSpec - ); - } - - /** - * Get the specified role eligibility schedule request. - * @param scope The scope of the role eligibility schedule request. - * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request - * to get. - * @param options The options parameters. - */ - get( - scope: string, - roleEligibilityScheduleRequestName: string, - options?: RoleEligibilityScheduleRequestsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleEligibilityScheduleRequestName, options }, - getOperationSpec - ); - } - - /** - * Gets role eligibility schedule requests for a scope. - * @param scope The scope of the role eligibility schedule requests. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * Cancels a pending role eligibility schedule request. - * @param scope The scope of the role eligibility request to cancel. - * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. - * @param options The options parameters. - */ - cancel( - scope: string, - roleEligibilityScheduleRequestName: string, - options?: RoleEligibilityScheduleRequestsCancelOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleEligibilityScheduleRequestName, options }, - cancelOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role eligibility schedule requests. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleEligibilityScheduleRequestsListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", - httpMethod: "PUT", - responses: { - 201: { - bodyMapper: Mappers.RoleEligibilityScheduleRequest - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleEligibilityScheduleRequestName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleRequest - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleEligibilityScheduleRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleRequestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const cancelOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", - httpMethod: "POST", - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleEligibilityScheduleRequestName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleRequestListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts b/sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts deleted file mode 100644 index 3ab81c1dc5ba..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleEligibilitySchedules } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleEligibilitySchedule, - RoleEligibilitySchedulesListForScopeNextOptionalParams, - RoleEligibilitySchedulesListForScopeOptionalParams, - RoleEligibilitySchedulesGetOptionalParams, - RoleEligibilitySchedulesGetResponse, - RoleEligibilitySchedulesListForScopeResponse, - RoleEligibilitySchedulesListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleEligibilitySchedules operations. */ -export class RoleEligibilitySchedulesImpl implements RoleEligibilitySchedules { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleEligibilitySchedules class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role eligibility schedules for a resource scope. - * @param scope The scope of the role eligibility schedules. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleEligibilitySchedulesListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleEligibilitySchedulesListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleEligibilitySchedulesListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Get the specified role eligibility schedule for a resource scope - * @param scope The scope of the role eligibility schedule. - * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleEligibilityScheduleName: string, - options?: RoleEligibilitySchedulesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleEligibilityScheduleName, options }, - getOperationSpec - ); - } - - /** - * Gets role eligibility schedules for a resource scope. - * @param scope The scope of the role eligibility schedules. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleEligibilitySchedulesListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role eligibility schedules. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleEligibilitySchedulesListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilitySchedule - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleEligibilityScheduleName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleEligibilityScheduleListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts b/sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts deleted file mode 100644 index 69f6ca49cf7f..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleManagementPolicies } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleManagementPolicy, - RoleManagementPoliciesListForScopeNextOptionalParams, - RoleManagementPoliciesListForScopeOptionalParams, - RoleManagementPoliciesGetOptionalParams, - RoleManagementPoliciesGetResponse, - RoleManagementPoliciesUpdateOptionalParams, - RoleManagementPoliciesUpdateResponse, - RoleManagementPoliciesDeleteOptionalParams, - RoleManagementPoliciesListForScopeResponse, - RoleManagementPoliciesListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleManagementPolicies operations. */ -export class RoleManagementPoliciesImpl implements RoleManagementPolicies { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleManagementPolicies class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role management policies for a resource scope. - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleManagementPoliciesListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleManagementPoliciesListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleManagementPoliciesListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Get the specified role management policy for a resource scope - * @param scope The scope of the role management policy. - * @param roleManagementPolicyName The name (guid) of the role management policy to get. - * @param options The options parameters. - */ - get( - scope: string, - roleManagementPolicyName: string, - options?: RoleManagementPoliciesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleManagementPolicyName, options }, - getOperationSpec - ); - } - - /** - * Update a role management policy - * @param scope The scope of the role management policy to upsert. - * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. - * @param parameters Parameters for the role management policy. - * @param options The options parameters. - */ - update( - scope: string, - roleManagementPolicyName: string, - parameters: RoleManagementPolicy, - options?: RoleManagementPoliciesUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleManagementPolicyName, parameters, options }, - updateOperationSpec - ); - } - - /** - * Delete a role management policy - * @param scope The scope of the role management policy to upsert. - * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. - * @param options The options parameters. - */ - delete( - scope: string, - roleManagementPolicyName: string, - options?: RoleManagementPoliciesDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleManagementPolicyName, options }, - deleteOperationSpec - ); - } - - /** - * Gets role management policies for a resource scope. - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleManagementPoliciesListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role management policy. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleManagementPoliciesListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicy - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleManagementPolicyName - ], - headerParameters: [Parameters.accept], - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicy - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleManagementPolicyName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleManagementPolicyName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicyListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicyListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts b/sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts deleted file mode 100644 index e8a8efe0fa3e..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RoleManagementPolicyAssignments } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClientContext } from "../authorizationManagementClientContext"; -import { - RoleManagementPolicyAssignment, - RoleManagementPolicyAssignmentsListForScopeNextOptionalParams, - RoleManagementPolicyAssignmentsListForScopeOptionalParams, - RoleManagementPolicyAssignmentsGetOptionalParams, - RoleManagementPolicyAssignmentsGetResponse, - RoleManagementPolicyAssignmentsCreateOptionalParams, - RoleManagementPolicyAssignmentsCreateResponse, - RoleManagementPolicyAssignmentsDeleteOptionalParams, - RoleManagementPolicyAssignmentsListForScopeResponse, - RoleManagementPolicyAssignmentsListForScopeNextResponse -} from "../models"; - -/// -/** Class containing RoleManagementPolicyAssignments operations. */ -export class RoleManagementPolicyAssignmentsImpl - implements RoleManagementPolicyAssignments { - private readonly client: AuthorizationManagementClientContext; - - /** - * Initialize a new instance of the class RoleManagementPolicyAssignments class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClientContext) { - this.client = client; - } - - /** - * Gets role management assignment policies for a resource scope. - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - public listForScope( - scope: string, - options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForScopePagingAll(scope, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listForScopePagingPage(scope, options); - } - }; - } - - private async *listForScopePagingPage( - scope: string, - options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams - ): AsyncIterableIterator { - let result = await this._listForScope(scope, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listForScopeNext(scope, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listForScopePagingAll( - scope: string, - options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForScopePagingPage(scope, options)) { - yield* page; - } - } - - /** - * Get the specified role management policy assignment for a resource scope - * @param scope The scope of the role management policy. - * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy - * assignment to get. - * @param options The options parameters. - */ - get( - scope: string, - roleManagementPolicyAssignmentName: string, - options?: RoleManagementPolicyAssignmentsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleManagementPolicyAssignmentName, options }, - getOperationSpec - ); - } - - /** - * Create a role management policy assignment - * @param scope The scope of the role management policy assignment to upsert. - * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy - * assignment to upsert. - * @param parameters Parameters for the role management policy assignment. - * @param options The options parameters. - */ - create( - scope: string, - roleManagementPolicyAssignmentName: string, - parameters: RoleManagementPolicyAssignment, - options?: RoleManagementPolicyAssignmentsCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleManagementPolicyAssignmentName, parameters, options }, - createOperationSpec - ); - } - - /** - * Delete a role management policy assignment - * @param scope The scope of the role management policy assignment to delete. - * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy - * assignment to delete. - * @param options The options parameters. - */ - delete( - scope: string, - roleManagementPolicyAssignmentName: string, - options?: RoleManagementPolicyAssignmentsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, roleManagementPolicyAssignmentName, options }, - deleteOperationSpec - ); - } - - /** - * Gets role management assignment policies for a resource scope. - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - private _listForScope( - scope: string, - options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - listForScopeOperationSpec - ); - } - - /** - * ListForScopeNext - * @param scope The scope of the role management policy. - * @param nextLink The nextLink from the previous successful call to the ListForScope method. - * @param options The options parameters. - */ - private _listForScopeNext( - scope: string, - nextLink: string, - options?: RoleManagementPolicyAssignmentsListForScopeNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scope, nextLink, options }, - listForScopeNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicyAssignment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleManagementPolicyAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", - httpMethod: "PUT", - responses: { - 201: { - bodyMapper: Mappers.RoleManagementPolicyAssignment - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleManagementPolicyAssignmentName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.roleManagementPolicyAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeOperationSpec: coreClient.OperationSpec = { - path: - "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept], - serializer -}; -const listForScopeNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleManagementPolicyAssignmentListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts new file mode 100644 index 000000000000..f4319fa7350d --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TenantLevelAccessReviewInstanceContactedReviewers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + AccessReviewContactedReviewer, + TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams, + TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams, + TenantLevelAccessReviewInstanceContactedReviewersListResponse, + TenantLevelAccessReviewInstanceContactedReviewersListNextResponse +} from "../models"; + +/// +/** Class containing TenantLevelAccessReviewInstanceContactedReviewers operations. */ +export class TenantLevelAccessReviewInstanceContactedReviewersImpl + implements TenantLevelAccessReviewInstanceContactedReviewers { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class TenantLevelAccessReviewInstanceContactedReviewers class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get access review instance contacted reviewers + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + public list( + scheduleDefinitionId: string, + id: string, + options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(scheduleDefinitionId, id, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(scheduleDefinitionId, id, options); + } + }; + } + + private async *listPagingPage( + scheduleDefinitionId: string, + id: string, + options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(scheduleDefinitionId, id, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + scheduleDefinitionId, + id, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + scheduleDefinitionId: string, + id: string, + options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + scheduleDefinitionId, + id, + options + )) { + yield* page; + } + } + + /** + * Get access review instance contacted reviewers + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + private _list( + scheduleDefinitionId: string, + id: string, + options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + scheduleDefinitionId: string, + id: string, + nextLink: string, + options?: TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams + ): Promise< + TenantLevelAccessReviewInstanceContactedReviewersListNextResponse + > { + return this.client.sendOperationRequest( + { scheduleDefinitionId, id, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/contactedReviewers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewContactedReviewerListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessReviewContactedReviewerListResult + }, + default: { + bodyMapper: Mappers.ErrorDefinition + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.scheduleDefinitionId, + Parameters.id + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts new file mode 100644 index 000000000000..71fc31da58f5 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AccessReviewDefaultSettingsGetOptionalParams, + AccessReviewDefaultSettingsGetResponse, + AccessReviewScheduleSettings, + AccessReviewDefaultSettingsPutOptionalParams, + AccessReviewDefaultSettingsPutResponse +} from "../models"; + +/** Interface representing a AccessReviewDefaultSettingsOperations. */ +export interface AccessReviewDefaultSettingsOperations { + /** + * Get access review default settings for the subscription + * @param options The options parameters. + */ + get( + options?: AccessReviewDefaultSettingsGetOptionalParams + ): Promise; + /** + * Get access review default settings for the subscription + * @param properties Access review schedule settings. + * @param options The options parameters. + */ + put( + properties: AccessReviewScheduleSettings, + options?: AccessReviewDefaultSettingsPutOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts new file mode 100644 index 000000000000..4d77716ecc2f --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams, + AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse +} from "../models"; + +/** Interface representing a AccessReviewHistoryDefinitionInstance. */ +export interface AccessReviewHistoryDefinitionInstance { + /** + * Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and + * can be retrieved by fetching the accessReviewHistoryDefinition object. + * @param historyDefinitionId The id of the access review history definition. + * @param instanceId The id of the access review history definition instance to generate a URI for. + * @param options The options parameters. + */ + generateDownloadUri( + historyDefinitionId: string, + instanceId: string, + options?: AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts new file mode 100644 index 000000000000..1549ff379e98 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewHistoryInstance, + AccessReviewHistoryDefinitionInstancesListOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessReviewHistoryDefinitionInstances. */ +export interface AccessReviewHistoryDefinitionInstances { + /** + * Get access review history definition instances by definition Id + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + list( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionInstancesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts new file mode 100644 index 000000000000..dfda80c1b829 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AccessReviewHistoryDefinitionProperties, + AccessReviewHistoryDefinitionCreateOptionalParams, + AccessReviewHistoryDefinitionCreateResponse, + AccessReviewHistoryDefinitionDeleteByIdOptionalParams +} from "../models"; + +/** Interface representing a AccessReviewHistoryDefinitionOperations. */ +export interface AccessReviewHistoryDefinitionOperations { + /** + * Create a scheduled or one-time Access Review History Definition + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @param options The options parameters. + */ + create( + historyDefinitionId: string, + properties: AccessReviewHistoryDefinitionProperties, + options?: AccessReviewHistoryDefinitionCreateOptionalParams + ): Promise; + /** + * Delete an access review history definition + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + deleteById( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionDeleteByIdOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts new file mode 100644 index 000000000000..4c1896b8172d --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewHistoryDefinition, + AccessReviewHistoryDefinitionsListOptionalParams, + AccessReviewHistoryDefinitionsGetByIdOptionalParams, + AccessReviewHistoryDefinitionsGetByIdResponse +} from "../models"; + +/// +/** Interface representing a AccessReviewHistoryDefinitions. */ +export interface AccessReviewHistoryDefinitions { + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only + * available for 30 days after creation. + * @param options The options parameters. + */ + list( + options?: AccessReviewHistoryDefinitionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get access review history definition by definition Id + * @param historyDefinitionId The id of the access review history definition. + * @param options The options parameters. + */ + getById( + historyDefinitionId: string, + options?: AccessReviewHistoryDefinitionsGetByIdOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts new file mode 100644 index 000000000000..5d9cd938cae5 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewContactedReviewer, + AccessReviewInstanceContactedReviewersListOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessReviewInstanceContactedReviewers. */ +export interface AccessReviewInstanceContactedReviewers { + /** + * Get access review instance contacted reviewers + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceContactedReviewersListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts new file mode 100644 index 000000000000..df1e4cdfc6e6 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewDecision, + AccessReviewInstanceDecisionsListOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessReviewInstanceDecisions. */ +export interface AccessReviewInstanceDecisions { + /** + * Get access review instance decisions + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceDecisionsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts new file mode 100644 index 000000000000..7f2013cc6608 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewDecision, + AccessReviewInstanceMyDecisionsListOptionalParams, + AccessReviewInstanceMyDecisionsGetByIdOptionalParams, + AccessReviewInstanceMyDecisionsGetByIdResponse, + AccessReviewDecisionProperties, + AccessReviewInstanceMyDecisionsPatchOptionalParams, + AccessReviewInstanceMyDecisionsPatchResponse +} from "../models"; + +/// +/** Interface representing a AccessReviewInstanceMyDecisions. */ +export interface AccessReviewInstanceMyDecisions { + /** + * Get my access review instance decisions. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + list( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceMyDecisionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get my single access review instance decision. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param decisionId The id of the decision record. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + id: string, + decisionId: string, + options?: AccessReviewInstanceMyDecisionsGetByIdOptionalParams + ): Promise; + /** + * Record a decision. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param decisionId The id of the decision record. + * @param properties Access review decision properties to patch. + * @param options The options parameters. + */ + patch( + scheduleDefinitionId: string, + id: string, + decisionId: string, + properties: AccessReviewDecisionProperties, + options?: AccessReviewInstanceMyDecisionsPatchOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts new file mode 100644 index 000000000000..0faef402bebd --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AccessReviewInstanceStopOptionalParams, + AccessReviewInstanceResetDecisionsOptionalParams, + AccessReviewInstanceApplyDecisionsOptionalParams, + AccessReviewInstanceSendRemindersOptionalParams, + AccessReviewInstanceAcceptRecommendationsOptionalParams +} from "../models"; + +/** Interface representing a AccessReviewInstanceOperations. */ +export interface AccessReviewInstanceOperations { + /** + * An action to stop an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + stop( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceStopOptionalParams + ): Promise; + /** + * An action to reset all decisions for an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + resetDecisions( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceResetDecisionsOptionalParams + ): Promise; + /** + * An action to apply all decisions for an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + applyDecisions( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceApplyDecisionsOptionalParams + ): Promise; + /** + * An action to send reminders for an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + sendReminders( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceSendRemindersOptionalParams + ): Promise; + /** + * An action to accept recommendations for decision in an access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + acceptRecommendations( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstanceAcceptRecommendationsOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts new file mode 100644 index 000000000000..540b9fa5218c --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewInstance, + AccessReviewInstancesListOptionalParams, + AccessReviewInstancesGetByIdOptionalParams, + AccessReviewInstancesGetByIdResponse, + AccessReviewInstanceProperties, + AccessReviewInstancesCreateOptionalParams, + AccessReviewInstancesCreateResponse +} from "../models"; + +/// +/** Interface representing a AccessReviewInstances. */ +export interface AccessReviewInstances { + /** + * Get access review instances + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + list( + scheduleDefinitionId: string, + options?: AccessReviewInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get access review instances + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstancesGetByIdOptionalParams + ): Promise; + /** + * Update access review instance. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Access review instance properties. + * @param options The options parameters. + */ + create( + scheduleDefinitionId: string, + id: string, + properties: AccessReviewInstanceProperties, + options?: AccessReviewInstancesCreateOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts new file mode 100644 index 000000000000..86e51cc51c0e --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewInstance, + AccessReviewInstancesAssignedForMyApprovalListOptionalParams, + AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams, + AccessReviewInstancesAssignedForMyApprovalGetByIdResponse +} from "../models"; + +/// +/** Interface representing a AccessReviewInstancesAssignedForMyApproval. */ +export interface AccessReviewInstancesAssignedForMyApproval { + /** + * Get access review instances assigned for my approval. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + list( + scheduleDefinitionId: string, + options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get single access review instance assigned for my approval. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + id: string, + options?: AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts new file mode 100644 index 000000000000..972f1705680c --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewScheduleDefinition, + AccessReviewScheduleDefinitionsListOptionalParams, + AccessReviewScheduleDefinitionsGetByIdOptionalParams, + AccessReviewScheduleDefinitionsGetByIdResponse, + AccessReviewScheduleDefinitionsDeleteByIdOptionalParams, + AccessReviewScheduleDefinitionProperties, + AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams, + AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse, + AccessReviewScheduleDefinitionsStopOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessReviewScheduleDefinitions. */ +export interface AccessReviewScheduleDefinitions { + /** + * Get access review schedule definitions + * @param options The options parameters. + */ + list( + options?: AccessReviewScheduleDefinitionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get single access review definition + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + getById( + scheduleDefinitionId: string, + options?: AccessReviewScheduleDefinitionsGetByIdOptionalParams + ): Promise; + /** + * Delete access review schedule definition + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + deleteById( + scheduleDefinitionId: string, + options?: AccessReviewScheduleDefinitionsDeleteByIdOptionalParams + ): Promise; + /** + * Create or Update access review schedule definition. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @param options The options parameters. + */ + createOrUpdateById( + scheduleDefinitionId: string, + properties: AccessReviewScheduleDefinitionProperties, + options?: AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams + ): Promise; + /** + * Stop access review definition + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param options The options parameters. + */ + stop( + scheduleDefinitionId: string, + options?: AccessReviewScheduleDefinitionsStopOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts new file mode 100644 index 000000000000..6f00935f1250 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewScheduleDefinition, + AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams +} from "../models"; + +/// +/** Interface representing a AccessReviewScheduleDefinitionsAssignedForMyApproval. */ +export interface AccessReviewScheduleDefinitionsAssignedForMyApproval { + /** + * Get access review instances assigned for my approval. + * @param options The options parameters. + */ + list( + options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts deleted file mode 100644 index 0138496ee322..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - EligibleChildResource, - EligibleChildResourcesGetOptionalParams -} from "../models"; - -/// -/** Interface representing a EligibleChildResources. */ -export interface EligibleChildResources { - /** - * Get the child resources of a resource on which user has eligible access - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - list( - scope: string, - options?: EligibleChildResourcesGetOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts index e547e894ea9f..7fa7646d62a8 100644 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts @@ -6,13 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./roleAssignmentSchedules"; -export * from "./roleAssignmentScheduleInstances"; -export * from "./roleAssignmentScheduleRequests"; -export * from "./roleEligibilitySchedules"; -export * from "./roleEligibilityScheduleInstances"; -export * from "./roleEligibilityScheduleRequests"; -export * from "./roleManagementPolicies"; -export * from "./roleManagementPolicyAssignments"; -export * from "./eligibleChildResources"; -export * from "./roleAssignments"; +export * from "./operations"; +export * from "./accessReviewHistoryDefinitions"; +export * from "./accessReviewHistoryDefinitionOperations"; +export * from "./accessReviewHistoryDefinitionInstance"; +export * from "./accessReviewHistoryDefinitionInstances"; +export * from "./accessReviewScheduleDefinitions"; +export * from "./accessReviewInstances"; +export * from "./accessReviewInstanceOperations"; +export * from "./accessReviewInstanceDecisions"; +export * from "./accessReviewInstanceContactedReviewers"; +export * from "./accessReviewDefaultSettingsOperations"; +export * from "./accessReviewScheduleDefinitionsAssignedForMyApproval"; +export * from "./accessReviewInstancesAssignedForMyApproval"; +export * from "./accessReviewInstanceMyDecisions"; +export * from "./tenantLevelAccessReviewInstanceContactedReviewers"; diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..92a4da30855a --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists the operations available from this provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts deleted file mode 100644 index 7ee590cfbb23..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleAssignmentScheduleInstance, - RoleAssignmentScheduleInstancesListForScopeOptionalParams, - RoleAssignmentScheduleInstancesGetOptionalParams, - RoleAssignmentScheduleInstancesGetResponse -} from "../models"; - -/// -/** Interface representing a RoleAssignmentScheduleInstances. */ -export interface RoleAssignmentScheduleInstances { - /** - * Gets role assignment schedule instances of a role assignment schedule. - * @param scope The scope of the role assignment schedule. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets the specified role assignment schedule instance. - * @param scope The scope of the role assignments schedules. - * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role - * assignment schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentScheduleInstanceName: string, - options?: RoleAssignmentScheduleInstancesGetOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts deleted file mode 100644 index c46f3b993eb6..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleAssignmentScheduleRequest, - RoleAssignmentScheduleRequestsListForScopeOptionalParams, - RoleAssignmentScheduleRequestsCreateOptionalParams, - RoleAssignmentScheduleRequestsCreateResponse, - RoleAssignmentScheduleRequestsGetOptionalParams, - RoleAssignmentScheduleRequestsGetResponse, - RoleAssignmentScheduleRequestsCancelOptionalParams -} from "../models"; - -/// -/** Interface representing a RoleAssignmentScheduleRequests. */ -export interface RoleAssignmentScheduleRequests { - /** - * Gets role assignment schedule requests for a scope. - * @param scope The scope of the role assignments schedule requests. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Creates a role assignment schedule request. - * @param scope The scope of the role assignment schedule request to create. The scope can be any REST - * resource instance. For example, use - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - * for a resource group, and - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleAssignmentScheduleRequestName The name of the role assignment to create. It can be any - * valid GUID. - * @param parameters Parameters for the role assignment schedule request. - * @param options The options parameters. - */ - create( - scope: string, - roleAssignmentScheduleRequestName: string, - parameters: RoleAssignmentScheduleRequest, - options?: RoleAssignmentScheduleRequestsCreateOptionalParams - ): Promise; - /** - * Get the specified role assignment schedule request. - * @param scope The scope of the role assignment schedule request. - * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to - * get. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentScheduleRequestName: string, - options?: RoleAssignmentScheduleRequestsGetOptionalParams - ): Promise; - /** - * Cancels a pending role assignment schedule request. - * @param scope The scope of the role assignment request to cancel. - * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. - * @param options The options parameters. - */ - cancel( - scope: string, - roleAssignmentScheduleRequestName: string, - options?: RoleAssignmentScheduleRequestsCancelOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts deleted file mode 100644 index c0e5a062a1a6..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleAssignmentSchedule, - RoleAssignmentSchedulesListForScopeOptionalParams, - RoleAssignmentSchedulesGetOptionalParams, - RoleAssignmentSchedulesGetResponse -} from "../models"; - -/// -/** Interface representing a RoleAssignmentSchedules. */ -export interface RoleAssignmentSchedules { - /** - * Gets role assignment schedules for a resource scope. - * @param scope The scope of the role assignments schedules. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleAssignmentSchedulesListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get the specified role assignment schedule for a resource scope - * @param scope The scope of the role assignment schedule. - * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentScheduleName: string, - options?: RoleAssignmentSchedulesGetOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignments.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignments.ts deleted file mode 100644 index 718ee54a19bd..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignments.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleAssignment, - RoleAssignmentsListForSubscriptionOptionalParams, - RoleAssignmentsListForResourceGroupOptionalParams, - RoleAssignmentsListForResourceOptionalParams, - RoleAssignmentsListForScopeOptionalParams, - RoleAssignmentsGetOptionalParams, - RoleAssignmentsGetResponse, - RoleAssignmentCreateParameters, - RoleAssignmentsCreateOptionalParams, - RoleAssignmentsCreateResponse, - RoleAssignmentsDeleteOptionalParams, - RoleAssignmentsDeleteResponse, - RoleAssignmentsValidateOptionalParams, - RoleAssignmentsValidateResponse, - RoleAssignmentsGetByIdOptionalParams, - RoleAssignmentsGetByIdResponse, - RoleAssignmentsCreateByIdOptionalParams, - RoleAssignmentsCreateByIdResponse, - RoleAssignmentsDeleteByIdOptionalParams, - RoleAssignmentsDeleteByIdResponse, - RoleAssignmentsValidateByIdOptionalParams, - RoleAssignmentsValidateByIdResponse -} from "../models"; - -/// -/** Interface representing a RoleAssignments. */ -export interface RoleAssignments { - /** - * List all role assignments that apply to a subscription. - * @param options The options parameters. - */ - listForSubscription( - options?: RoleAssignmentsListForSubscriptionOptionalParams - ): PagedAsyncIterableIterator; - /** - * List all role assignments that apply to a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listForResourceGroup( - resourceGroupName: string, - options?: RoleAssignmentsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * List all role assignments that apply to a resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The resource name. - * @param options The options parameters. - */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - resourceType: string, - resourceName: string, - options?: RoleAssignmentsListForResourceOptionalParams - ): PagedAsyncIterableIterator; - /** - * List all role assignments that apply to a scope. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleAssignmentsListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get a role assignment by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param options The options parameters. - */ - get( - scope: string, - roleAssignmentName: string, - options?: RoleAssignmentsGetOptionalParams - ): Promise; - /** - * Create or update a role assignment by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - create( - scope: string, - roleAssignmentName: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsCreateOptionalParams - ): Promise; - /** - * Delete a role assignment by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param options The options parameters. - */ - delete( - scope: string, - roleAssignmentName: string, - options?: RoleAssignmentsDeleteOptionalParams - ): Promise; - /** - * Validate a role assignment create or update operation by scope and name. - * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - validate( - scope: string, - roleAssignmentName: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsValidateOptionalParams - ): Promise; - /** - * Get a role assignment by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param options The options parameters. - */ - getById( - roleAssignmentId: string, - options?: RoleAssignmentsGetByIdOptionalParams - ): Promise; - /** - * Create or update a role assignment by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - createById( - roleAssignmentId: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsCreateByIdOptionalParams - ): Promise; - /** - * Delete a role assignment by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param options The options parameters. - */ - deleteById( - roleAssignmentId: string, - options?: RoleAssignmentsDeleteByIdOptionalParams - ): Promise; - /** - * Validate a role assignment create or update operation by ID. - * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource - * name, and resource type. Format: - * /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: - * /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/ - * @param parameters Parameters for the role assignment. - * @param options The options parameters. - */ - validateById( - roleAssignmentId: string, - parameters: RoleAssignmentCreateParameters, - options?: RoleAssignmentsValidateByIdOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts deleted file mode 100644 index d59284393a78..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleEligibilityScheduleInstance, - RoleEligibilityScheduleInstancesListForScopeOptionalParams, - RoleEligibilityScheduleInstancesGetOptionalParams, - RoleEligibilityScheduleInstancesGetResponse -} from "../models"; - -/// -/** Interface representing a RoleEligibilityScheduleInstances. */ -export interface RoleEligibilityScheduleInstances { - /** - * Gets role eligibility schedule instances of a role eligibility schedule. - * @param scope The scope of the role eligibility schedule. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets the specified role eligibility schedule instance. - * @param scope The scope of the role eligibility schedules. - * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role - * eligibility schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleEligibilityScheduleInstanceName: string, - options?: RoleEligibilityScheduleInstancesGetOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts deleted file mode 100644 index 70c01dd4e630..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleEligibilityScheduleRequest, - RoleEligibilityScheduleRequestsListForScopeOptionalParams, - RoleEligibilityScheduleRequestsCreateOptionalParams, - RoleEligibilityScheduleRequestsCreateResponse, - RoleEligibilityScheduleRequestsGetOptionalParams, - RoleEligibilityScheduleRequestsGetResponse, - RoleEligibilityScheduleRequestsCancelOptionalParams -} from "../models"; - -/// -/** Interface representing a RoleEligibilityScheduleRequests. */ -export interface RoleEligibilityScheduleRequests { - /** - * Gets role eligibility schedule requests for a scope. - * @param scope The scope of the role eligibility schedule requests. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Creates a role eligibility schedule request. - * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST - * resource instance. For example, use - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - * for a resource group, and - * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. - * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any - * valid GUID. - * @param parameters Parameters for the role eligibility schedule request. - * @param options The options parameters. - */ - create( - scope: string, - roleEligibilityScheduleRequestName: string, - parameters: RoleEligibilityScheduleRequest, - options?: RoleEligibilityScheduleRequestsCreateOptionalParams - ): Promise; - /** - * Get the specified role eligibility schedule request. - * @param scope The scope of the role eligibility schedule request. - * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request - * to get. - * @param options The options parameters. - */ - get( - scope: string, - roleEligibilityScheduleRequestName: string, - options?: RoleEligibilityScheduleRequestsGetOptionalParams - ): Promise; - /** - * Cancels a pending role eligibility schedule request. - * @param scope The scope of the role eligibility request to cancel. - * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. - * @param options The options parameters. - */ - cancel( - scope: string, - roleEligibilityScheduleRequestName: string, - options?: RoleEligibilityScheduleRequestsCancelOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts deleted file mode 100644 index 8722a0e08226..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleEligibilitySchedule, - RoleEligibilitySchedulesListForScopeOptionalParams, - RoleEligibilitySchedulesGetOptionalParams, - RoleEligibilitySchedulesGetResponse -} from "../models"; - -/// -/** Interface representing a RoleEligibilitySchedules. */ -export interface RoleEligibilitySchedules { - /** - * Gets role eligibility schedules for a resource scope. - * @param scope The scope of the role eligibility schedules. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleEligibilitySchedulesListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get the specified role eligibility schedule for a resource scope - * @param scope The scope of the role eligibility schedule. - * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. - * @param options The options parameters. - */ - get( - scope: string, - roleEligibilityScheduleName: string, - options?: RoleEligibilitySchedulesGetOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts deleted file mode 100644 index 43edadbd4354..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleManagementPolicy, - RoleManagementPoliciesListForScopeOptionalParams, - RoleManagementPoliciesGetOptionalParams, - RoleManagementPoliciesGetResponse, - RoleManagementPoliciesUpdateOptionalParams, - RoleManagementPoliciesUpdateResponse, - RoleManagementPoliciesDeleteOptionalParams -} from "../models"; - -/// -/** Interface representing a RoleManagementPolicies. */ -export interface RoleManagementPolicies { - /** - * Gets role management policies for a resource scope. - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleManagementPoliciesListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get the specified role management policy for a resource scope - * @param scope The scope of the role management policy. - * @param roleManagementPolicyName The name (guid) of the role management policy to get. - * @param options The options parameters. - */ - get( - scope: string, - roleManagementPolicyName: string, - options?: RoleManagementPoliciesGetOptionalParams - ): Promise; - /** - * Update a role management policy - * @param scope The scope of the role management policy to upsert. - * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. - * @param parameters Parameters for the role management policy. - * @param options The options parameters. - */ - update( - scope: string, - roleManagementPolicyName: string, - parameters: RoleManagementPolicy, - options?: RoleManagementPoliciesUpdateOptionalParams - ): Promise; - /** - * Delete a role management policy - * @param scope The scope of the role management policy to upsert. - * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. - * @param options The options parameters. - */ - delete( - scope: string, - roleManagementPolicyName: string, - options?: RoleManagementPoliciesDeleteOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts deleted file mode 100644 index 4c06af309a19..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import "@azure/core-paging"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RoleManagementPolicyAssignment, - RoleManagementPolicyAssignmentsListForScopeOptionalParams, - RoleManagementPolicyAssignmentsGetOptionalParams, - RoleManagementPolicyAssignmentsGetResponse, - RoleManagementPolicyAssignmentsCreateOptionalParams, - RoleManagementPolicyAssignmentsCreateResponse, - RoleManagementPolicyAssignmentsDeleteOptionalParams -} from "../models"; - -/// -/** Interface representing a RoleManagementPolicyAssignments. */ -export interface RoleManagementPolicyAssignments { - /** - * Gets role management assignment policies for a resource scope. - * @param scope The scope of the role management policy. - * @param options The options parameters. - */ - listForScope( - scope: string, - options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get the specified role management policy assignment for a resource scope - * @param scope The scope of the role management policy. - * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy - * assignment to get. - * @param options The options parameters. - */ - get( - scope: string, - roleManagementPolicyAssignmentName: string, - options?: RoleManagementPolicyAssignmentsGetOptionalParams - ): Promise; - /** - * Create a role management policy assignment - * @param scope The scope of the role management policy assignment to upsert. - * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy - * assignment to upsert. - * @param parameters Parameters for the role management policy assignment. - * @param options The options parameters. - */ - create( - scope: string, - roleManagementPolicyAssignmentName: string, - parameters: RoleManagementPolicyAssignment, - options?: RoleManagementPolicyAssignmentsCreateOptionalParams - ): Promise; - /** - * Delete a role management policy assignment - * @param scope The scope of the role management policy assignment to delete. - * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy - * assignment to delete. - * @param options The options parameters. - */ - delete( - scope: string, - roleManagementPolicyAssignmentName: string, - options?: RoleManagementPolicyAssignmentsDeleteOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts new file mode 100644 index 000000000000..e7b93a374851 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccessReviewContactedReviewer, + TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams +} from "../models"; + +/// +/** Interface representing a TenantLevelAccessReviewInstanceContactedReviewers. */ +export interface TenantLevelAccessReviewInstanceContactedReviewers { + /** + * Get access review instance contacted reviewers + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param options The options parameters. + */ + list( + scheduleDefinitionId: string, + id: string, + options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/test/sampleTest.ts b/sdk/authorization/arm-authorization/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/authorization/arm-authorization/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/authorization/arm-authorization/tsconfig.json b/sdk/authorization/arm-authorization/tsconfig.json index 603440b3a359..bd142baf706d 100644 --- a/sdk/authorization/arm-authorization/tsconfig.json +++ b/sdk/authorization/arm-authorization/tsconfig.json @@ -9,11 +9,25 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true + "importHelpers": true, + "paths": { + "@azure/arm-authorization": [ + "./src/index" + ] + } }, - "include": ["./src/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/authorization/ci.mgmt.yml b/sdk/authorization/ci.mgmt.yml index a7561b803ee9..0aa8c51a57b6 100644 --- a/sdk/authorization/ci.mgmt.yml +++ b/sdk/authorization/ci.mgmt.yml @@ -9,8 +9,8 @@ trigger: paths: include: - sdk/authorization/ci.mgmt.yml - - sdk/authorization/arm-authorization/ - sdk/authorization/arm-authorization-profile-2020-09-01-hybrid + - sdk/authorization/arm-authorization pr: branches: include: @@ -23,8 +23,8 @@ pr: paths: include: - sdk/authorization/ci.mgmt.yml - - sdk/authorization/arm-authorization/ - sdk/authorization/arm-authorization-profile-2020-09-01-hybrid + - sdk/authorization/arm-authorization extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: From 81a3edd1b04e81715380721515c296b1bb833977 Mon Sep 17 00:00:00 2001 From: zsgwwj Date: Tue, 12 Apr 2022 08:07:48 +0800 Subject: [PATCH 2/3] update --- .../arm-authorization/CHANGELOG.md | 4 +- sdk/authorization/arm-authorization/README.md | 4 +- .../arm-authorization/_meta.json | 2 +- .../arm-authorization/package.json | 2 +- .../review/arm-authorization.api.md | 1319 +++++---- .../eligibleChildResourcesGetSample.ts | 37 + ...oleAssignmentScheduleInstancesGetSample.ts | 34 + ...mentScheduleInstancesListForScopeSample.ts | 42 + ...eAssignmentScheduleRequestsCancelSample.ts | 34 + ...eAssignmentScheduleRequestsCreateSample.ts | 56 + ...roleAssignmentScheduleRequestsGetSample.ts | 34 + ...nmentScheduleRequestsListForScopeSample.ts | 42 + ...ssignmentScheduleRequestsValidateSample.ts | 55 + .../roleAssignmentSchedulesGetSample.ts | 33 + ...leAssignmentSchedulesListForScopeSample.ts | 40 + ...leEligibilityScheduleInstancesGetSample.ts | 34 + ...lityScheduleInstancesListForScopeSample.ts | 42 + ...EligibilityScheduleRequestsCancelSample.ts | 34 + ...EligibilityScheduleRequestsCreateSample.ts | 55 + ...oleEligibilityScheduleRequestsGetSample.ts | 34 + ...ilityScheduleRequestsListForScopeSample.ts | 42 + ...igibilityScheduleRequestsValidateSample.ts | 54 + .../roleEligibilitySchedulesGetSample.ts | 33 + ...eEligibilitySchedulesListForScopeSample.ts | 42 + .../roleManagementPoliciesDeleteSample.ts | 33 + .../roleManagementPoliciesGetSample.ts | 33 + ...oleManagementPoliciesListForScopeSample.ts | 32 + .../roleManagementPoliciesUpdateSample.ts | 391 +++ ...ManagementPolicyAssignmentsCreateSample.ts | 45 + ...ManagementPolicyAssignmentsDeleteSample.ts | 34 + ...oleManagementPolicyAssignmentsGetSample.ts | 34 + ...mentPolicyAssignmentsListForScopeSample.ts | 34 + .../samples/v9/javascript/README.md | 162 ++ .../accessReviewDefaultSettingsGetSample.js | 28 + .../accessReviewDefaultSettingsPutSample.js | 29 + ...cessReviewHistoryDefinitionCreateSample.js | 33 + ...ReviewHistoryDefinitionDeleteByIdSample.js | 31 + ...nitionInstanceGenerateDownloadUriSample.js | 33 + ...iewHistoryDefinitionInstancesListSample.js | 32 + ...ssReviewHistoryDefinitionsGetByIdSample.js | 29 + ...ccessReviewHistoryDefinitionsListSample.js | 31 + ...viewInstanceAcceptRecommendationsSample.js | 33 + ...ccessReviewInstanceApplyDecisionsSample.js | 33 + ...iewInstanceContactedReviewersListSample.js | 36 + ...accessReviewInstanceDecisionsListSample.js | 33 + ...sReviewInstanceMyDecisionsGetByIdSample.js | 35 + ...cessReviewInstanceMyDecisionsListSample.js | 33 + ...essReviewInstanceMyDecisionsPatchSample.js | 37 + ...ccessReviewInstanceResetDecisionsSample.js | 33 + ...accessReviewInstanceSendRemindersSample.js | 33 + .../accessReviewInstanceStopSample.js | 30 + ...ancesAssignedForMyApprovalGetByIdSample.js | 33 + ...nstancesAssignedForMyApprovalListSample.js | 39 + .../accessReviewInstancesCreateSample.js | 31 + .../accessReviewInstancesGetByIdSample.js | 30 + .../accessReviewInstancesListSample.js | 32 + ...initionsAssignedForMyApprovalListSample.js | 37 + ...duleDefinitionsCreateOrUpdateByIdSample.js | 33 + ...viewScheduleDefinitionsDeleteByIdSample.js | 29 + ...sReviewScheduleDefinitionsGetByIdSample.js | 29 + ...cessReviewScheduleDefinitionsListSample.js | 31 + ...cessReviewScheduleDefinitionsStopSample.js | 29 + .../eligibleChildResourcesGetSample.js | 34 + .../samples/v9/javascript/package.json | 32 + ...oleAssignmentScheduleInstancesGetSample.js | 33 + ...mentScheduleInstancesListForScopeSample.js | 36 + ...eAssignmentScheduleRequestsCancelSample.js | 33 + ...eAssignmentScheduleRequestsCreateSample.js | 52 + ...roleAssignmentScheduleRequestsGetSample.js | 33 + ...nmentScheduleRequestsListForScopeSample.js | 36 + ...ssignmentScheduleRequestsValidateSample.js | 51 + .../roleAssignmentSchedulesGetSample.js | 30 + ...leAssignmentSchedulesListForScopeSample.js | 34 + ...leEligibilityScheduleInstancesGetSample.js | 33 + ...lityScheduleInstancesListForScopeSample.js | 36 + ...EligibilityScheduleRequestsCancelSample.js | 33 + ...EligibilityScheduleRequestsCreateSample.js | 51 + ...oleEligibilityScheduleRequestsGetSample.js | 33 + ...ilityScheduleRequestsListForScopeSample.js | 36 + ...igibilityScheduleRequestsValidateSample.js | 50 + .../roleEligibilitySchedulesGetSample.js | 30 + ...eEligibilitySchedulesListForScopeSample.js | 36 + .../roleManagementPoliciesDeleteSample.js | 30 + .../roleManagementPoliciesGetSample.js | 30 + ...oleManagementPoliciesListForScopeSample.js | 32 + .../roleManagementPoliciesUpdateSample.js | 384 +++ ...ManagementPolicyAssignmentsCreateSample.js | 42 + ...ManagementPolicyAssignmentsDeleteSample.js | 34 + ...oleManagementPolicyAssignmentsGetSample.js | 34 + ...mentPolicyAssignmentsListForScopeSample.js | 32 + .../samples/v9/javascript/sample.env | 4 + ...iewInstanceContactedReviewersListSample.js | 36 + .../samples/v9/typescript/README.md | 175 ++ .../samples/v9/typescript/package.json | 41 + .../samples/v9/typescript/sample.env | 4 + .../accessReviewDefaultSettingsGetSample.ts | 28 + .../accessReviewDefaultSettingsPutSample.ts | 34 + ...cessReviewHistoryDefinitionCreateSample.ts | 36 + ...ReviewHistoryDefinitionDeleteByIdSample.ts | 31 + ...nitionInstanceGenerateDownloadUriSample.ts | 33 + ...iewHistoryDefinitionInstancesListSample.ts | 34 + ...ssReviewHistoryDefinitionsGetByIdSample.ts | 31 + ...ccessReviewHistoryDefinitionsListSample.ts | 31 + ...viewInstanceAcceptRecommendationsSample.ts | 33 + ...ccessReviewInstanceApplyDecisionsSample.ts | 33 + ...iewInstanceContactedReviewersListSample.ts | 36 + ...accessReviewInstanceDecisionsListSample.ts | 36 + ...sReviewInstanceMyDecisionsGetByIdSample.ts | 35 + ...cessReviewInstanceMyDecisionsListSample.ts | 36 + ...essReviewInstanceMyDecisionsPatchSample.ts | 40 + ...ccessReviewInstanceResetDecisionsSample.ts | 33 + ...accessReviewInstanceSendRemindersSample.ts | 33 + .../src/accessReviewInstanceStopSample.ts | 33 + ...ancesAssignedForMyApprovalGetByIdSample.ts | 33 + ...nstancesAssignedForMyApprovalListSample.ts | 42 + .../src/accessReviewInstancesCreateSample.ts | 38 + .../src/accessReviewInstancesGetByIdSample.ts | 33 + .../src/accessReviewInstancesListSample.ts | 34 + ...initionsAssignedForMyApprovalListSample.ts | 40 + ...duleDefinitionsCreateOrUpdateByIdSample.ts | 36 + ...viewScheduleDefinitionsDeleteByIdSample.ts | 31 + ...sReviewScheduleDefinitionsGetByIdSample.ts | 31 + ...cessReviewScheduleDefinitionsListSample.ts | 31 + ...cessReviewScheduleDefinitionsStopSample.ts | 31 + .../src/eligibleChildResourcesGetSample.ts | 37 + ...oleAssignmentScheduleInstancesGetSample.ts | 34 + ...mentScheduleInstancesListForScopeSample.ts | 42 + ...eAssignmentScheduleRequestsCancelSample.ts | 34 + ...eAssignmentScheduleRequestsCreateSample.ts | 56 + ...roleAssignmentScheduleRequestsGetSample.ts | 34 + ...nmentScheduleRequestsListForScopeSample.ts | 42 + ...ssignmentScheduleRequestsValidateSample.ts | 55 + .../src/roleAssignmentSchedulesGetSample.ts | 33 + ...leAssignmentSchedulesListForScopeSample.ts | 40 + ...leEligibilityScheduleInstancesGetSample.ts | 34 + ...lityScheduleInstancesListForScopeSample.ts | 42 + ...EligibilityScheduleRequestsCancelSample.ts | 34 + ...EligibilityScheduleRequestsCreateSample.ts | 55 + ...oleEligibilityScheduleRequestsGetSample.ts | 34 + ...ilityScheduleRequestsListForScopeSample.ts | 42 + ...igibilityScheduleRequestsValidateSample.ts | 54 + .../src/roleEligibilitySchedulesGetSample.ts | 33 + ...eEligibilitySchedulesListForScopeSample.ts | 42 + .../src/roleManagementPoliciesDeleteSample.ts | 33 + .../src/roleManagementPoliciesGetSample.ts | 33 + ...oleManagementPoliciesListForScopeSample.ts | 32 + .../src/roleManagementPoliciesUpdateSample.ts | 391 +++ ...ManagementPolicyAssignmentsCreateSample.ts | 45 + ...ManagementPolicyAssignmentsDeleteSample.ts | 34 + ...oleManagementPolicyAssignmentsGetSample.ts | 34 + ...mentPolicyAssignmentsListForScopeSample.ts | 34 + ...iewInstanceContactedReviewersListSample.ts | 36 + .../samples/v9/typescript/tsconfig.json | 17 + .../src/authorizationManagementClient.ts | 124 +- .../arm-authorization/src/models/index.ts | 2199 +++++++-------- .../arm-authorization/src/models/mappers.ts | 2360 +++++++++-------- .../src/models/parameters.ts | 127 +- .../accessReviewDefaultSettingsOperations.ts | 98 - .../accessReviewHistoryDefinitionInstance.ts | 74 - .../accessReviewHistoryDefinitionInstances.ts | 166 -- ...accessReviewHistoryDefinitionOperations.ts | 111 - .../accessReviewHistoryDefinitions.ts | 183 -- .../accessReviewInstanceContactedReviewers.ts | 178 -- .../accessReviewInstanceDecisions.ts | 178 -- .../accessReviewInstanceMyDecisions.ts | 267 -- .../accessReviewInstanceOperations.ts | 221 -- .../src/operations/accessReviewInstances.ts | 252 -- ...essReviewInstancesAssignedForMyApproval.ts | 201 -- .../accessReviewScheduleDefinitions.ts | 295 --- ...cheduleDefinitionsAssignedForMyApproval.ts | 140 - .../src/operations/eligibleChildResources.ts | 148 ++ .../arm-authorization/src/operations/index.ts | 24 +- .../src/operations/operations.ts | 137 - .../roleAssignmentScheduleInstances.ts | 191 ++ .../roleAssignmentScheduleRequests.ts | 321 +++ .../src/operations/roleAssignmentSchedules.ts | 188 ++ .../roleEligibilityScheduleInstances.ts | 191 ++ .../roleEligibilityScheduleRequests.ts | 321 +++ .../operations/roleEligibilitySchedules.ts | 188 ++ .../src/operations/roleManagementPolicies.ts | 270 ++ .../roleManagementPolicyAssignments.ts | 275 ++ ...lAccessReviewInstanceContactedReviewers.ts | 178 -- .../accessReviewDefaultSettingsOperations.ts | 35 - .../accessReviewHistoryDefinitionInstance.ts | 28 - .../accessReviewHistoryDefinitionInstances.ts | 27 - ...accessReviewHistoryDefinitionOperations.ts | 38 - .../accessReviewHistoryDefinitions.ts | 37 - .../accessReviewInstanceContactedReviewers.ts | 29 - .../accessReviewInstanceDecisions.ts | 29 - .../accessReviewInstanceMyDecisions.ts | 62 - .../accessReviewInstanceOperations.ts | 74 - .../accessReviewInstances.ts | 56 - ...essReviewInstancesAssignedForMyApproval.ts | 40 - .../accessReviewScheduleDefinitions.ts | 70 - ...cheduleDefinitionsAssignedForMyApproval.ts | 25 - .../eligibleChildResources.ts | 27 + .../src/operationsInterfaces/index.ts | 24 +- .../src/operationsInterfaces/operations.ts | 22 - .../roleAssignmentScheduleInstances.ts | 41 + .../roleAssignmentScheduleRequests.ts | 88 + .../roleAssignmentSchedules.ts | 40 + .../roleEligibilityScheduleInstances.ts | 41 + .../roleEligibilityScheduleRequests.ts | 88 + .../roleEligibilitySchedules.ts | 40 + .../roleManagementPolicies.ts | 67 + .../roleManagementPolicyAssignments.ts | 70 + ...lAccessReviewInstanceContactedReviewers.ts | 29 - 207 files changed, 12251 insertions(+), 6395 deletions(-) create mode 100644 sdk/authorization/arm-authorization/samples-dev/eligibleChildResourcesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCancelSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsValidateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCancelSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsValidateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesDeleteSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesUpdateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsDeleteSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/README.md create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/eligibleChildResourcesGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/package.json create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCancelSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsValidateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCancelSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsValidateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesDeleteSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesUpdateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsCreateSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsDeleteSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsGetSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsListForScopeSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/sample.env create mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/README.md create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/package.json create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/sample.env create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/eligibleChildResourcesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCancelSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsValidateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCancelSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsValidateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesDeleteSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesUpdateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsCreateSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsDeleteSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsGetSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsListForScopeSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts create mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/tsconfig.json delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/operations.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts create mode 100644 sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts delete mode 100644 sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts create mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts delete mode 100644 sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts diff --git a/sdk/authorization/arm-authorization/CHANGELOG.md b/sdk/authorization/arm-authorization/CHANGELOG.md index 057d53534380..727c6560b437 100644 --- a/sdk/authorization/arm-authorization/CHANGELOG.md +++ b/sdk/authorization/arm-authorization/CHANGELOG.md @@ -1,8 +1,8 @@ # Release History -## 9.0.0-beta.2 (2022-04-06) +## 9.0.0 (2022-04-11) -The package of @azure/arm-authorization is using our next generation design principles since version 9.0.0-beta.2, which contains breaking changes. +The package of @azure/arm-authorization is using our next generation design principles since version 9.0.0, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/authorization/arm-authorization/README.md b/sdk/authorization/arm-authorization/README.md index 8083290d09af..392e81fe804e 100644 --- a/sdk/authorization/arm-authorization/README.md +++ b/sdk/authorization/arm-authorization/README.md @@ -2,11 +2,11 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure AuthorizationManagement client. -Access reviews service provides the workflow for running access reviews on different kind of resources. +Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role assignments. A role assignment grants access to Azure Active Directory users. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-authorization) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-authorization) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/authorization/arm-authorization/_meta.json b/sdk/authorization/arm-authorization/_meta.json index 6fff19fd6bef..9a72f7168f27 100644 --- a/sdk/authorization/arm-authorization/_meta.json +++ b/sdk/authorization/arm-authorization/_meta.json @@ -1,5 +1,5 @@ { - "commit": "e4b7e666673125aeb2b130f2a196e6aa7f8aca72", + "commit": "72e581bc9fc34855c6022bdb00e13482b9d79757", "readme": "specification/authorization/resource-manager/readme.md", "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\authorization\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", diff --git a/sdk/authorization/arm-authorization/package.json b/sdk/authorization/arm-authorization/package.json index 9b154e8b3a3b..4b319aa02540 100644 --- a/sdk/authorization/arm-authorization/package.json +++ b/sdk/authorization/arm-authorization/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AuthorizationManagementClient.", - "version": "9.0.0-beta.2", + "version": "9.0.0", "engines": { "node": ">=12.0.0" }, diff --git a/sdk/authorization/arm-authorization/review/arm-authorization.api.md b/sdk/authorization/arm-authorization/review/arm-authorization.api.md index aace0d9ea6fc..c157fed69ea6 100644 --- a/sdk/authorization/arm-authorization/review/arm-authorization.api.md +++ b/sdk/authorization/arm-authorization/review/arm-authorization.api.md @@ -9,1068 +9,1065 @@ import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public -export type AccessRecommendationType = string; +export type ApprovalMode = string; // @public -export type AccessReviewActorIdentityType = string; +export interface ApprovalSettings { + approvalMode?: ApprovalMode; + approvalStages?: ApprovalStage[]; + isApprovalRequired?: boolean; + isApprovalRequiredForExtension?: boolean; + isRequestorJustificationRequired?: boolean; +} // @public -export type AccessReviewApplyResult = string; +export interface ApprovalStage { + approvalStageTimeOutInDays?: number; + escalationApprovers?: UserSet[]; + escalationTimeInMinutes?: number; + isApproverJustificationRequired?: boolean; + isEscalationEnabled?: boolean; + primaryApprovers?: UserSet[]; +} // @public -export interface AccessReviewContactedReviewer { - readonly createdDateTime?: Date; - readonly id?: string; - readonly name?: string; - readonly type?: string; - readonly userDisplayName?: string; - readonly userPrincipalName?: string; +export type AssignmentType = string; + +// @public (undocumented) +export class AuthorizationManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, options?: AuthorizationManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + eligibleChildResources: EligibleChildResources; + // (undocumented) + roleAssignmentScheduleInstances: RoleAssignmentScheduleInstances; + // (undocumented) + roleAssignmentScheduleRequests: RoleAssignmentScheduleRequests; + // (undocumented) + roleAssignmentSchedules: RoleAssignmentSchedules; + // (undocumented) + roleEligibilityScheduleInstances: RoleEligibilityScheduleInstances; + // (undocumented) + roleEligibilityScheduleRequests: RoleEligibilityScheduleRequests; + // (undocumented) + roleEligibilitySchedules: RoleEligibilitySchedules; + // (undocumented) + roleManagementPolicies: RoleManagementPolicies; + // (undocumented) + roleManagementPolicyAssignments: RoleManagementPolicyAssignments; } // @public -export interface AccessReviewContactedReviewerListResult { - nextLink?: string; - value?: AccessReviewContactedReviewer[]; +export interface AuthorizationManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CloudError { + error?: CloudErrorBody; } // @public -export interface AccessReviewDecision { - readonly appliedDateTime?: Date; - readonly applyResult?: AccessReviewApplyResult; - decision?: AccessReviewResult; - readonly displayNamePropertiesPrincipalDisplayName?: string; - readonly displayNamePropertiesResourceDisplayName?: string; +export interface CloudErrorBody { + code?: string; + message?: string; +} + +// @public +export interface EligibleChildResource { readonly id?: string; - readonly idPropertiesPrincipalId?: string; - readonly idPropertiesResourceId?: string; - justification?: string; readonly name?: string; - readonly principalIdPropertiesAppliedByPrincipalId?: string; - readonly principalIdPropertiesReviewedByPrincipalId?: string; - readonly principalNamePropertiesAppliedByPrincipalName?: string; - readonly principalNamePropertiesReviewedByPrincipalName?: string; - readonly principalTypePropertiesAppliedByPrincipalType?: AccessReviewActorIdentityType; - readonly principalTypePropertiesReviewedByPrincipalType?: AccessReviewActorIdentityType; - readonly recommendation?: AccessRecommendationType; - readonly reviewedDateTime?: Date; readonly type?: string; - typePropertiesPrincipalType?: DecisionTargetType; - typePropertiesResourceType?: DecisionResourceType; - readonly userPrincipalNamePropertiesAppliedByUserPrincipalName?: string; - readonly userPrincipalNamePropertiesReviewedByUserPrincipalName?: string; } // @public -export interface AccessReviewDecisionIdentity { - readonly displayName?: string; - readonly id?: string; - type: "user" | "servicePrincipal"; +export interface EligibleChildResources { + list(scope: string, options?: EligibleChildResourcesGetOptionalParams): PagedAsyncIterableIterator; } -// @public (undocumented) -export type AccessReviewDecisionIdentityUnion = AccessReviewDecisionIdentity | AccessReviewDecisionUserIdentity | AccessReviewDecisionServicePrincipalIdentity; - // @public -export interface AccessReviewDecisionListResult { - nextLink?: string; - value?: AccessReviewDecision[]; +export interface EligibleChildResourcesGetNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface AccessReviewDecisionProperties { - readonly appliedDateTime?: Date; - readonly applyResult?: AccessReviewApplyResult; - decision?: AccessReviewResult; - readonly displayNamePrincipalDisplayName?: string; - readonly displayNameResourceDisplayName?: string; - readonly idPrincipalId?: string; - readonly idResourceId?: string; - justification?: string; - readonly principalIdAppliedByPrincipalId?: string; - readonly principalIdReviewedByPrincipalId?: string; - readonly principalNameAppliedByPrincipalName?: string; - readonly principalNameReviewedByPrincipalName?: string; - readonly principalTypeAppliedByPrincipalType?: AccessReviewActorIdentityType; - readonly principalTypeReviewedByPrincipalType?: AccessReviewActorIdentityType; - readonly recommendation?: AccessRecommendationType; - readonly reviewedDateTime?: Date; - typePrincipalType?: DecisionTargetType; - typeResourceType?: DecisionResourceType; - readonly userPrincipalNameAppliedByUserPrincipalName?: string; - readonly userPrincipalNameReviewedByUserPrincipalName?: string; -} - -// @public -export interface AccessReviewDecisionResource { - readonly displayName?: string; - readonly id?: string; - type: "azureRole"; -} +export type EligibleChildResourcesGetNextResponse = EligibleChildResourcesListResult; // @public -export type AccessReviewDecisionResourceAzureRole = AccessReviewDecisionResource & { - type: "azureRole"; -}; +export interface EligibleChildResourcesGetOptionalParams extends coreClient.OperationOptions { + filter?: string; +} -// @public (undocumented) -export type AccessReviewDecisionResourceUnion = AccessReviewDecisionResource | AccessReviewDecisionResourceAzureRole; +// @public +export type EligibleChildResourcesGetResponse = EligibleChildResourcesListResult; // @public -export type AccessReviewDecisionServicePrincipalIdentity = AccessReviewDecisionIdentity & { - type: "servicePrincipal"; - readonly appId?: string; -}; +export interface EligibleChildResourcesListResult { + nextLink?: string; + value?: EligibleChildResource[]; +} // @public -export type AccessReviewDecisionUserIdentity = AccessReviewDecisionIdentity & { - type: "user"; - readonly userPrincipalName?: string; -}; +export type EnablementRules = string; + +// @public (undocumented) +export interface ExpandedProperties { + principal?: ExpandedPropertiesPrincipal; + roleDefinition?: ExpandedPropertiesRoleDefinition; + scope?: ExpandedPropertiesScope; +} // @public -export interface AccessReviewDefaultSettings { - autoApplyDecisionsEnabled?: boolean; - defaultDecision?: DefaultDecisionType; - defaultDecisionEnabled?: boolean; - endDate?: Date; - readonly id?: string; - instanceDurationInDays?: number; - interval?: number; - justificationRequiredOnApproval?: boolean; - mailNotificationsEnabled?: boolean; - readonly name?: string; - numberOfOccurrences?: number; - recommendationLookBackDuration?: string; - recommendationsEnabled?: boolean; - reminderNotificationsEnabled?: boolean; - startDate?: Date; - readonly type?: string; - typePropertiesRecurrencePatternType?: AccessReviewRecurrencePatternType; - typePropertiesRecurrenceRangeType?: AccessReviewRecurrenceRangeType; +export interface ExpandedPropertiesPrincipal { + displayName?: string; + email?: string; + id?: string; + type?: string; } // @public -export interface AccessReviewDefaultSettingsGetOptionalParams extends coreClient.OperationOptions { +export interface ExpandedPropertiesRoleDefinition { + displayName?: string; + id?: string; + type?: string; } // @public -export type AccessReviewDefaultSettingsGetResponse = AccessReviewDefaultSettings; +export interface ExpandedPropertiesScope { + displayName?: string; + id?: string; + type?: string; +} // @public -export interface AccessReviewDefaultSettingsOperations { - get(options?: AccessReviewDefaultSettingsGetOptionalParams): Promise; - put(properties: AccessReviewScheduleSettings, options?: AccessReviewDefaultSettingsPutOptionalParams): Promise; +export enum KnownApprovalMode { + // (undocumented) + NoApproval = "NoApproval", + // (undocumented) + Parallel = "Parallel", + // (undocumented) + Serial = "Serial", + // (undocumented) + SingleStage = "SingleStage" } // @public -export interface AccessReviewDefaultSettingsPutOptionalParams extends coreClient.OperationOptions { +export enum KnownAssignmentType { + // (undocumented) + Activated = "Activated", + // (undocumented) + Assigned = "Assigned" } // @public -export type AccessReviewDefaultSettingsPutResponse = AccessReviewDefaultSettings; +export enum KnownEnablementRules { + // (undocumented) + Justification = "Justification", + // (undocumented) + MultiFactorAuthentication = "MultiFactorAuthentication", + // (undocumented) + Ticketing = "Ticketing" +} // @public -export interface AccessReviewHistoryDefinition { - readonly createdDateTime?: Date; - decisions?: AccessReviewResult[]; - displayName?: string; - endDate?: Date; - readonly id?: string; - instances?: AccessReviewHistoryInstance[]; - interval?: number; - readonly name?: string; - numberOfOccurrences?: number; - readonly principalId?: string; - readonly principalName?: string; - readonly principalType?: AccessReviewActorIdentityType; - readonly reviewHistoryPeriodEndDateTime?: Date; - readonly reviewHistoryPeriodStartDateTime?: Date; - scopes?: AccessReviewScope[]; - startDate?: Date; - readonly status?: AccessReviewHistoryDefinitionStatus; - readonly type?: string; - typePropertiesSettingsPatternType?: AccessReviewRecurrencePatternType; - typePropertiesSettingsRangeType?: AccessReviewRecurrenceRangeType; - readonly userPrincipalName?: string; +export enum KnownMemberType { + // (undocumented) + Direct = "Direct", + // (undocumented) + Group = "Group", + // (undocumented) + Inherited = "Inherited" } // @public -export interface AccessReviewHistoryDefinitionCreateOptionalParams extends coreClient.OperationOptions { +export enum KnownNotificationDeliveryMechanism { + // (undocumented) + Email = "Email" } // @public -export type AccessReviewHistoryDefinitionCreateResponse = AccessReviewHistoryDefinition; +export enum KnownNotificationLevel { + // (undocumented) + All = "All", + // (undocumented) + Critical = "Critical", + // (undocumented) + None = "None" +} // @public -export interface AccessReviewHistoryDefinitionDeleteByIdOptionalParams extends coreClient.OperationOptions { +export enum KnownPrincipalType { + // (undocumented) + Device = "Device", + // (undocumented) + ForeignGroup = "ForeignGroup", + // (undocumented) + Group = "Group", + // (undocumented) + ServicePrincipal = "ServicePrincipal", + // (undocumented) + User = "User" } // @public -export interface AccessReviewHistoryDefinitionInstance { - generateDownloadUri(historyDefinitionId: string, instanceId: string, options?: AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams): Promise; +export enum KnownRecipientType { + // (undocumented) + Admin = "Admin", + // (undocumented) + Approver = "Approver", + // (undocumented) + Requestor = "Requestor" } // @public -export interface AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams extends coreClient.OperationOptions { +export enum KnownRequestType { + // (undocumented) + AdminAssign = "AdminAssign", + // (undocumented) + AdminExtend = "AdminExtend", + // (undocumented) + AdminRemove = "AdminRemove", + // (undocumented) + AdminRenew = "AdminRenew", + // (undocumented) + AdminUpdate = "AdminUpdate", + // (undocumented) + SelfActivate = "SelfActivate", + // (undocumented) + SelfDeactivate = "SelfDeactivate", + // (undocumented) + SelfExtend = "SelfExtend", + // (undocumented) + SelfRenew = "SelfRenew" } // @public -export type AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse = AccessReviewHistoryInstance; +export enum KnownRoleManagementPolicyRuleType { + // (undocumented) + RoleManagementPolicyApprovalRule = "RoleManagementPolicyApprovalRule", + // (undocumented) + RoleManagementPolicyAuthenticationContextRule = "RoleManagementPolicyAuthenticationContextRule", + // (undocumented) + RoleManagementPolicyEnablementRule = "RoleManagementPolicyEnablementRule", + // (undocumented) + RoleManagementPolicyExpirationRule = "RoleManagementPolicyExpirationRule", + // (undocumented) + RoleManagementPolicyNotificationRule = "RoleManagementPolicyNotificationRule" +} // @public -export interface AccessReviewHistoryDefinitionInstanceListResult { - nextLink?: string; - value?: AccessReviewHistoryInstance[]; +export enum KnownStatus { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + AdminApproved = "AdminApproved", + // (undocumented) + AdminDenied = "AdminDenied", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Denied = "Denied", + // (undocumented) + Failed = "Failed", + // (undocumented) + FailedAsResourceIsLocked = "FailedAsResourceIsLocked", + // (undocumented) + Granted = "Granted", + // (undocumented) + Invalid = "Invalid", + // (undocumented) + PendingAdminDecision = "PendingAdminDecision", + // (undocumented) + PendingApproval = "PendingApproval", + // (undocumented) + PendingApprovalProvisioning = "PendingApprovalProvisioning", + // (undocumented) + PendingEvaluation = "PendingEvaluation", + // (undocumented) + PendingExternalProvisioning = "PendingExternalProvisioning", + // (undocumented) + PendingProvisioning = "PendingProvisioning", + // (undocumented) + PendingRevocation = "PendingRevocation", + // (undocumented) + PendingScheduleCreation = "PendingScheduleCreation", + // (undocumented) + Provisioned = "Provisioned", + // (undocumented) + ProvisioningStarted = "ProvisioningStarted", + // (undocumented) + Revoked = "Revoked", + // (undocumented) + ScheduleCreated = "ScheduleCreated", + // (undocumented) + TimedOut = "TimedOut" } // @public -export interface AccessReviewHistoryDefinitionInstances { - list(historyDefinitionId: string, options?: AccessReviewHistoryDefinitionInstancesListOptionalParams): PagedAsyncIterableIterator; +export enum KnownType { + // (undocumented) + AfterDateTime = "AfterDateTime", + // (undocumented) + AfterDuration = "AfterDuration", + // (undocumented) + NoExpiration = "NoExpiration" } // @public -export interface AccessReviewHistoryDefinitionInstancesListNextOptionalParams extends coreClient.OperationOptions { +export enum KnownUserType { + // (undocumented) + Group = "Group", + // (undocumented) + User = "User" } // @public -export type AccessReviewHistoryDefinitionInstancesListNextResponse = AccessReviewHistoryDefinitionInstanceListResult; +export type MemberType = string; // @public -export interface AccessReviewHistoryDefinitionInstancesListOptionalParams extends coreClient.OperationOptions { -} +export type NotificationDeliveryMechanism = string; // @public -export type AccessReviewHistoryDefinitionInstancesListResponse = AccessReviewHistoryDefinitionInstanceListResult; +export type NotificationLevel = string; // @public -export interface AccessReviewHistoryDefinitionListResult { - nextLink?: string; - value?: AccessReviewHistoryDefinition[]; +export interface Permission { + actions?: string[]; + dataActions?: string[]; + notActions?: string[]; + notDataActions?: string[]; } // @public -export interface AccessReviewHistoryDefinitionOperations { - create(historyDefinitionId: string, properties: AccessReviewHistoryDefinitionProperties, options?: AccessReviewHistoryDefinitionCreateOptionalParams): Promise; - deleteById(historyDefinitionId: string, options?: AccessReviewHistoryDefinitionDeleteByIdOptionalParams): Promise; +export interface PolicyAssignmentProperties { + policy?: PolicyAssignmentPropertiesPolicy; + roleDefinition?: PolicyAssignmentPropertiesRoleDefinition; + scope?: PolicyAssignmentPropertiesScope; } // @public -export interface AccessReviewHistoryDefinitionProperties { - readonly createdDateTime?: Date; - decisions?: AccessReviewResult[]; - displayName?: string; - endDate?: Date; - instances?: AccessReviewHistoryInstance[]; - interval?: number; - numberOfOccurrences?: number; - readonly principalId?: string; - readonly principalName?: string; - readonly principalType?: AccessReviewActorIdentityType; - readonly reviewHistoryPeriodEndDateTime?: Date; - readonly reviewHistoryPeriodStartDateTime?: Date; - scopes?: AccessReviewScope[]; - startDate?: Date; - readonly status?: AccessReviewHistoryDefinitionStatus; - typeSettingsPatternType?: AccessReviewRecurrencePatternType; - typeSettingsRangeType?: AccessReviewRecurrenceRangeType; - readonly userPrincipalName?: string; +export interface PolicyAssignmentPropertiesPolicy { + id?: string; + readonly lastModifiedBy?: Principal; + lastModifiedDateTime?: Date; } // @public -export interface AccessReviewHistoryDefinitions { - getById(historyDefinitionId: string, options?: AccessReviewHistoryDefinitionsGetByIdOptionalParams): Promise; - list(options?: AccessReviewHistoryDefinitionsListOptionalParams): PagedAsyncIterableIterator; +export interface PolicyAssignmentPropertiesRoleDefinition { + displayName?: string; + id?: string; + type?: string; } // @public -export interface AccessReviewHistoryDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions { +export interface PolicyAssignmentPropertiesScope { + displayName?: string; + id?: string; + type?: string; } // @public -export type AccessReviewHistoryDefinitionsGetByIdResponse = AccessReviewHistoryDefinition; +export interface PolicyProperties { + readonly scope?: PolicyPropertiesScope; +} // @public -export interface AccessReviewHistoryDefinitionsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface PolicyPropertiesScope { + displayName?: string; + id?: string; + type?: string; } // @public -export type AccessReviewHistoryDefinitionsListNextResponse = AccessReviewHistoryDefinitionListResult; +export interface Principal { + displayName?: string; + email?: string; + id?: string; + type?: string; +} // @public -export interface AccessReviewHistoryDefinitionsListOptionalParams extends coreClient.OperationOptions { - filter?: string; -} +export type PrincipalType = string; // @public -export type AccessReviewHistoryDefinitionsListResponse = AccessReviewHistoryDefinitionListResult; +export type RecipientType = string; // @public -export type AccessReviewHistoryDefinitionStatus = string; +export type RequestType = string; // @public -export interface AccessReviewHistoryInstance { - displayName?: string; - readonly downloadUri?: string; - expiration?: Date; - fulfilledDateTime?: Date; +export interface RoleAssignmentSchedule { + assignmentType?: AssignmentType; + condition?: string; + conditionVersion?: string; + createdOn?: Date; + endDateTime?: Date; + expandedProperties?: ExpandedProperties; readonly id?: string; + linkedRoleEligibilityScheduleId?: string; + memberType?: MemberType; readonly name?: string; - reviewHistoryPeriodEndDateTime?: Date; - reviewHistoryPeriodStartDateTime?: Date; - runDateTime?: Date; - readonly status?: AccessReviewHistoryDefinitionStatus; + principalId?: string; + principalType?: PrincipalType; + roleAssignmentScheduleRequestId?: string; + roleDefinitionId?: string; + scope?: string; + startDateTime?: Date; + status?: Status; readonly type?: string; + updatedOn?: Date; } // @public -export interface AccessReviewInstance { - backupReviewers?: AccessReviewReviewer[]; +export interface RoleAssignmentScheduleFilter { + principalId?: string; + roleDefinitionId?: string; + status?: string; +} + +// @public +export interface RoleAssignmentScheduleInstance { + assignmentType?: AssignmentType; + condition?: string; + conditionVersion?: string; + createdOn?: Date; endDateTime?: Date; + expandedProperties?: ExpandedProperties; readonly id?: string; + linkedRoleEligibilityScheduleId?: string; + linkedRoleEligibilityScheduleInstanceId?: string; + memberType?: MemberType; readonly name?: string; - reviewers?: AccessReviewReviewer[]; - readonly reviewersType?: AccessReviewInstanceReviewersType; + originRoleAssignmentId?: string; + principalId?: string; + principalType?: PrincipalType; + roleAssignmentScheduleId?: string; + roleDefinitionId?: string; + scope?: string; startDateTime?: Date; - readonly status?: AccessReviewInstanceStatus; + status?: Status; readonly type?: string; } // @public -export interface AccessReviewInstanceAcceptRecommendationsOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleInstanceFilter { + principalId?: string; + roleAssignmentScheduleId?: string; + roleDefinitionId?: string; + status?: string; } // @public -export interface AccessReviewInstanceApplyDecisionsOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleInstanceListResult { + nextLink?: string; + value?: RoleAssignmentScheduleInstance[]; } // @public -export interface AccessReviewInstanceContactedReviewers { - list(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceContactedReviewersListOptionalParams): PagedAsyncIterableIterator; +export interface RoleAssignmentScheduleInstances { + get(scope: string, roleAssignmentScheduleInstanceName: string, options?: RoleAssignmentScheduleInstancesGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams): PagedAsyncIterableIterator; } // @public -export interface AccessReviewInstanceContactedReviewersListNextOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleInstancesGetOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; +export type RoleAssignmentScheduleInstancesGetResponse = RoleAssignmentScheduleInstance; // @public -export interface AccessReviewInstanceContactedReviewersListOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleInstancesListForScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export type AccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; +export type RoleAssignmentScheduleInstancesListForScopeNextResponse = RoleAssignmentScheduleInstanceListResult; // @public -export interface AccessReviewInstanceDecisions { - list(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceDecisionsListOptionalParams): PagedAsyncIterableIterator; +export interface RoleAssignmentScheduleInstancesListForScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface AccessReviewInstanceDecisionsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; -} +export type RoleAssignmentScheduleInstancesListForScopeResponse = RoleAssignmentScheduleInstanceListResult; // @public -export type AccessReviewInstanceDecisionsListNextResponse = AccessReviewDecisionListResult; +export interface RoleAssignmentScheduleListResult { + nextLink?: string; + value?: RoleAssignmentSchedule[]; +} // @public -export interface AccessReviewInstanceDecisionsListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleAssignmentScheduleRequest { + readonly approvalId?: string; + condition?: string; + conditionVersion?: string; + readonly createdOn?: Date; + readonly expandedProperties?: ExpandedProperties; + readonly id?: string; + justification?: string; + linkedRoleEligibilityScheduleId?: string; + readonly name?: string; + principalId?: string; + readonly principalType?: PrincipalType; + readonly requestorId?: string; + requestType?: RequestType; + roleDefinitionId?: string; + scheduleInfo?: RoleAssignmentScheduleRequestPropertiesScheduleInfo; + readonly scope?: string; + readonly status?: Status; + targetRoleAssignmentScheduleId?: string; + targetRoleAssignmentScheduleInstanceId?: string; + ticketInfo?: RoleAssignmentScheduleRequestPropertiesTicketInfo; + readonly type?: string; } // @public -export type AccessReviewInstanceDecisionsListResponse = AccessReviewDecisionListResult; +export interface RoleAssignmentScheduleRequestFilter { + principalId?: string; + requestorId?: string; + roleDefinitionId?: string; + status?: string; +} // @public -export interface AccessReviewInstanceListResult { +export interface RoleAssignmentScheduleRequestListResult { nextLink?: string; - value?: AccessReviewInstance[]; + value?: RoleAssignmentScheduleRequest[]; } // @public -export interface AccessReviewInstanceMyDecisions { - getById(scheduleDefinitionId: string, id: string, decisionId: string, options?: AccessReviewInstanceMyDecisionsGetByIdOptionalParams): Promise; - list(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceMyDecisionsListOptionalParams): PagedAsyncIterableIterator; - patch(scheduleDefinitionId: string, id: string, decisionId: string, properties: AccessReviewDecisionProperties, options?: AccessReviewInstanceMyDecisionsPatchOptionalParams): Promise; +export interface RoleAssignmentScheduleRequestPropertiesScheduleInfo { + expiration?: RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; + startDateTime?: Date; } // @public -export interface AccessReviewInstanceMyDecisionsGetByIdOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration { + duration?: string; + endDateTime?: Date; + type?: Type; } // @public -export type AccessReviewInstanceMyDecisionsGetByIdResponse = AccessReviewDecision; +export interface RoleAssignmentScheduleRequestPropertiesTicketInfo { + ticketNumber?: string; + ticketSystem?: string; +} // @public -export interface AccessReviewInstanceMyDecisionsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleAssignmentScheduleRequests { + cancel(scope: string, roleAssignmentScheduleRequestName: string, options?: RoleAssignmentScheduleRequestsCancelOptionalParams): Promise; + create(scope: string, roleAssignmentScheduleRequestName: string, parameters: RoleAssignmentScheduleRequest, options?: RoleAssignmentScheduleRequestsCreateOptionalParams): Promise; + get(scope: string, roleAssignmentScheduleRequestName: string, options?: RoleAssignmentScheduleRequestsGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams): PagedAsyncIterableIterator; + validate(scope: string, roleAssignmentScheduleRequestName: string, parameters: RoleAssignmentScheduleRequest, options?: RoleAssignmentScheduleRequestsValidateOptionalParams): Promise; } // @public -export type AccessReviewInstanceMyDecisionsListNextResponse = AccessReviewDecisionListResult; +export interface RoleAssignmentScheduleRequestsCancelOptionalParams extends coreClient.OperationOptions { +} // @public -export interface AccessReviewInstanceMyDecisionsListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleAssignmentScheduleRequestsCreateOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewInstanceMyDecisionsListResponse = AccessReviewDecisionListResult; +export type RoleAssignmentScheduleRequestsCreateResponse = RoleAssignmentScheduleRequest; // @public -export interface AccessReviewInstanceMyDecisionsPatchOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleRequestsGetOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewInstanceMyDecisionsPatchResponse = AccessReviewDecision; +export type RoleAssignmentScheduleRequestsGetResponse = RoleAssignmentScheduleRequest; // @public -export interface AccessReviewInstanceOperations { - acceptRecommendations(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceAcceptRecommendationsOptionalParams): Promise; - applyDecisions(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceApplyDecisionsOptionalParams): Promise; - resetDecisions(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceResetDecisionsOptionalParams): Promise; - sendReminders(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceSendRemindersOptionalParams): Promise; - stop(scheduleDefinitionId: string, id: string, options?: AccessReviewInstanceStopOptionalParams): Promise; +export interface RoleAssignmentScheduleRequestsListForScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface AccessReviewInstanceProperties { - backupReviewers?: AccessReviewReviewer[]; - endDateTime?: Date; - reviewers?: AccessReviewReviewer[]; - readonly reviewersType?: AccessReviewInstanceReviewersType; - startDateTime?: Date; - readonly status?: AccessReviewInstanceStatus; -} +export type RoleAssignmentScheduleRequestsListForScopeNextResponse = RoleAssignmentScheduleRequestListResult; // @public -export interface AccessReviewInstanceResetDecisionsOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentScheduleRequestsListForScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export type AccessReviewInstanceReviewersType = string; +export type RoleAssignmentScheduleRequestsListForScopeResponse = RoleAssignmentScheduleRequestListResult; // @public -export interface AccessReviewInstances { - create(scheduleDefinitionId: string, id: string, properties: AccessReviewInstanceProperties, options?: AccessReviewInstancesCreateOptionalParams): Promise; - getById(scheduleDefinitionId: string, id: string, options?: AccessReviewInstancesGetByIdOptionalParams): Promise; - list(scheduleDefinitionId: string, options?: AccessReviewInstancesListOptionalParams): PagedAsyncIterableIterator; +export interface RoleAssignmentScheduleRequestsValidateOptionalParams extends coreClient.OperationOptions { } // @public -export interface AccessReviewInstancesAssignedForMyApproval { - getById(scheduleDefinitionId: string, id: string, options?: AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams): Promise; - list(scheduleDefinitionId: string, options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams): PagedAsyncIterableIterator; -} +export type RoleAssignmentScheduleRequestsValidateResponse = RoleAssignmentScheduleRequest; // @public -export interface AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentSchedules { + get(scope: string, roleAssignmentScheduleName: string, options?: RoleAssignmentSchedulesGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleAssignmentSchedulesListForScopeOptionalParams): PagedAsyncIterableIterator; } // @public -export type AccessReviewInstancesAssignedForMyApprovalGetByIdResponse = AccessReviewInstance; - -// @public -export interface AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleAssignmentSchedulesGetOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewInstancesAssignedForMyApprovalListNextResponse = AccessReviewInstanceListResult; +export type RoleAssignmentSchedulesGetResponse = RoleAssignmentSchedule; // @public -export interface AccessReviewInstancesAssignedForMyApprovalListOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentSchedulesListForScopeNextOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type AccessReviewInstancesAssignedForMyApprovalListResponse = AccessReviewInstanceListResult; +export type RoleAssignmentSchedulesListForScopeNextResponse = RoleAssignmentScheduleListResult; // @public -export interface AccessReviewInstancesCreateOptionalParams extends coreClient.OperationOptions { +export interface RoleAssignmentSchedulesListForScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export type AccessReviewInstancesCreateResponse = AccessReviewInstance; +export type RoleAssignmentSchedulesListForScopeResponse = RoleAssignmentScheduleListResult; // @public -export interface AccessReviewInstanceSendRemindersOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilitySchedule { + condition?: string; + conditionVersion?: string; + createdOn?: Date; + endDateTime?: Date; + expandedProperties?: ExpandedProperties; + readonly id?: string; + memberType?: MemberType; + readonly name?: string; + principalId?: string; + principalType?: PrincipalType; + roleDefinitionId?: string; + roleEligibilityScheduleRequestId?: string; + scope?: string; + startDateTime?: Date; + status?: Status; + readonly type?: string; + updatedOn?: Date; } // @public -export interface AccessReviewInstancesGetByIdOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleFilter { + principalId?: string; + roleDefinitionId?: string; + status?: string; } // @public -export type AccessReviewInstancesGetByIdResponse = AccessReviewInstance; +export interface RoleEligibilityScheduleInstance { + condition?: string; + conditionVersion?: string; + createdOn?: Date; + endDateTime?: Date; + expandedProperties?: ExpandedProperties; + readonly id?: string; + memberType?: MemberType; + readonly name?: string; + principalId?: string; + principalType?: PrincipalType; + roleDefinitionId?: string; + roleEligibilityScheduleId?: string; + scope?: string; + startDateTime?: Date; + status?: Status; + readonly type?: string; +} // @public -export interface AccessReviewInstancesListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleEligibilityScheduleInstanceFilter { + principalId?: string; + roleDefinitionId?: string; + roleEligibilityScheduleId?: string; + status?: string; } // @public -export type AccessReviewInstancesListNextResponse = AccessReviewInstanceListResult; +export interface RoleEligibilityScheduleInstanceListResult { + nextLink?: string; + value?: RoleEligibilityScheduleInstance[]; +} // @public -export interface AccessReviewInstancesListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleEligibilityScheduleInstances { + get(scope: string, roleEligibilityScheduleInstanceName: string, options?: RoleEligibilityScheduleInstancesGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams): PagedAsyncIterableIterator; } // @public -export type AccessReviewInstancesListResponse = AccessReviewInstanceListResult; +export interface RoleEligibilityScheduleInstancesGetOptionalParams extends coreClient.OperationOptions { +} // @public -export type AccessReviewInstanceStatus = string; +export type RoleEligibilityScheduleInstancesGetResponse = RoleEligibilityScheduleInstance; // @public -export interface AccessReviewInstanceStopOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleInstancesListForScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export type AccessReviewRecurrencePatternType = string; +export type RoleEligibilityScheduleInstancesListForScopeNextResponse = RoleEligibilityScheduleInstanceListResult; // @public -export type AccessReviewRecurrenceRangeType = string; +export interface RoleEligibilityScheduleInstancesListForScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; +} // @public -export type AccessReviewResult = string; +export type RoleEligibilityScheduleInstancesListForScopeResponse = RoleEligibilityScheduleInstanceListResult; // @public -export interface AccessReviewReviewer { - principalId?: string; - readonly principalType?: AccessReviewReviewerType; +export interface RoleEligibilityScheduleListResult { + nextLink?: string; + value?: RoleEligibilitySchedule[]; } // @public -export type AccessReviewReviewerType = string; - -// @public -export interface AccessReviewScheduleDefinition { - readonly assignmentState?: AccessReviewScopeAssignmentState; - autoApplyDecisionsEnabled?: boolean; - backupReviewers?: AccessReviewReviewer[]; - defaultDecision?: DefaultDecisionType; - defaultDecisionEnabled?: boolean; - descriptionForAdmins?: string; - descriptionForReviewers?: string; - displayName?: string; - endDate?: Date; - expandNestedMemberships?: boolean; +export interface RoleEligibilityScheduleRequest { + readonly approvalId?: string; + condition?: string; + conditionVersion?: string; + readonly createdOn?: Date; + readonly expandedProperties?: ExpandedProperties; readonly id?: string; - inactiveDuration?: string; - instanceDurationInDays?: number; - instances?: AccessReviewInstance[]; - interval?: number; - justificationRequiredOnApproval?: boolean; - mailNotificationsEnabled?: boolean; + justification?: string; readonly name?: string; - numberOfOccurrences?: number; - readonly principalId?: string; - readonly principalName?: string; - readonly principalTypePropertiesCreatedByPrincipalType?: AccessReviewActorIdentityType; - readonly principalTypePropertiesScopePrincipalType?: AccessReviewScopePrincipalType; - recommendationLookBackDuration?: string; - recommendationsEnabled?: boolean; - reminderNotificationsEnabled?: boolean; - readonly resourceId?: string; - reviewers?: AccessReviewReviewer[]; - readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; - readonly roleDefinitionId?: string; - startDate?: Date; - readonly status?: AccessReviewScheduleDefinitionStatus; + principalId?: string; + readonly principalType?: PrincipalType; + readonly requestorId?: string; + requestType?: RequestType; + roleDefinitionId?: string; + scheduleInfo?: RoleEligibilityScheduleRequestPropertiesScheduleInfo; + readonly scope?: string; + readonly status?: Status; + targetRoleEligibilityScheduleId?: string; + targetRoleEligibilityScheduleInstanceId?: string; + ticketInfo?: RoleEligibilityScheduleRequestPropertiesTicketInfo; readonly type?: string; - typePropertiesSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; - typePropertiesSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; - readonly userPrincipalName?: string; } // @public -export interface AccessReviewScheduleDefinitionListResult { - nextLink?: string; - value?: AccessReviewScheduleDefinition[]; +export interface RoleEligibilityScheduleRequestFilter { + principalId?: string; + requestorId?: string; + roleDefinitionId?: string; + status?: string; } // @public -export interface AccessReviewScheduleDefinitionProperties { - readonly assignmentState?: AccessReviewScopeAssignmentState; - autoApplyDecisionsEnabled?: boolean; - backupReviewers?: AccessReviewReviewer[]; - defaultDecision?: DefaultDecisionType; - defaultDecisionEnabled?: boolean; - descriptionForAdmins?: string; - descriptionForReviewers?: string; - displayName?: string; - endDate?: Date; - expandNestedMemberships?: boolean; - inactiveDuration?: string; - instanceDurationInDays?: number; - instances?: AccessReviewInstance[]; - interval?: number; - justificationRequiredOnApproval?: boolean; - mailNotificationsEnabled?: boolean; - numberOfOccurrences?: number; - readonly principalId?: string; - readonly principalName?: string; - readonly principalTypeCreatedByPrincipalType?: AccessReviewActorIdentityType; - readonly principalTypeScopePrincipalType?: AccessReviewScopePrincipalType; - recommendationLookBackDuration?: string; - recommendationsEnabled?: boolean; - reminderNotificationsEnabled?: boolean; - readonly resourceId?: string; - reviewers?: AccessReviewReviewer[]; - readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; - readonly roleDefinitionId?: string; - startDate?: Date; - readonly status?: AccessReviewScheduleDefinitionStatus; - typeSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; - typeSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; - readonly userPrincipalName?: string; +export interface RoleEligibilityScheduleRequestListResult { + nextLink?: string; + value?: RoleEligibilityScheduleRequest[]; } // @public -export type AccessReviewScheduleDefinitionReviewersType = string; - -// @public -export interface AccessReviewScheduleDefinitions { - createOrUpdateById(scheduleDefinitionId: string, properties: AccessReviewScheduleDefinitionProperties, options?: AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams): Promise; - deleteById(scheduleDefinitionId: string, options?: AccessReviewScheduleDefinitionsDeleteByIdOptionalParams): Promise; - getById(scheduleDefinitionId: string, options?: AccessReviewScheduleDefinitionsGetByIdOptionalParams): Promise; - list(options?: AccessReviewScheduleDefinitionsListOptionalParams): PagedAsyncIterableIterator; - stop(scheduleDefinitionId: string, options?: AccessReviewScheduleDefinitionsStopOptionalParams): Promise; +export interface RoleEligibilityScheduleRequestPropertiesScheduleInfo { + expiration?: RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; + startDateTime?: Date; } // @public -export interface AccessReviewScheduleDefinitionsAssignedForMyApproval { - list(options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams): PagedAsyncIterableIterator; +export interface RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration { + duration?: string; + endDateTime?: Date; + type?: Type; } // @public -export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleEligibilityScheduleRequestPropertiesTicketInfo { + ticketNumber?: string; + ticketSystem?: string; } // @public -export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse = AccessReviewScheduleDefinitionListResult; - -// @public -export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface RoleEligibilityScheduleRequests { + cancel(scope: string, roleEligibilityScheduleRequestName: string, options?: RoleEligibilityScheduleRequestsCancelOptionalParams): Promise; + create(scope: string, roleEligibilityScheduleRequestName: string, parameters: RoleEligibilityScheduleRequest, options?: RoleEligibilityScheduleRequestsCreateOptionalParams): Promise; + get(scope: string, roleEligibilityScheduleRequestName: string, options?: RoleEligibilityScheduleRequestsGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams): PagedAsyncIterableIterator; + validate(scope: string, roleEligibilityScheduleRequestName: string, parameters: RoleEligibilityScheduleRequest, options?: RoleEligibilityScheduleRequestsValidateOptionalParams): Promise; } // @public -export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListResponse = AccessReviewScheduleDefinitionListResult; - -// @public -export interface AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleRequestsCancelOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse = AccessReviewScheduleDefinition; +export interface RoleEligibilityScheduleRequestsCreateOptionalParams extends coreClient.OperationOptions { +} // @public -export interface AccessReviewScheduleDefinitionsDeleteByIdOptionalParams extends coreClient.OperationOptions { -} +export type RoleEligibilityScheduleRequestsCreateResponse = RoleEligibilityScheduleRequest; // @public -export interface AccessReviewScheduleDefinitionsGetByIdOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleRequestsGetOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewScheduleDefinitionsGetByIdResponse = AccessReviewScheduleDefinition; +export type RoleEligibilityScheduleRequestsGetResponse = RoleEligibilityScheduleRequest; // @public -export interface AccessReviewScheduleDefinitionsListNextOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleRequestsListForScopeNextOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type AccessReviewScheduleDefinitionsListNextResponse = AccessReviewScheduleDefinitionListResult; +export type RoleEligibilityScheduleRequestsListForScopeNextResponse = RoleEligibilityScheduleRequestListResult; // @public -export interface AccessReviewScheduleDefinitionsListOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleRequestsListForScopeOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type AccessReviewScheduleDefinitionsListResponse = AccessReviewScheduleDefinitionListResult; +export type RoleEligibilityScheduleRequestsListForScopeResponse = RoleEligibilityScheduleRequestListResult; // @public -export interface AccessReviewScheduleDefinitionsStopOptionalParams extends coreClient.OperationOptions { +export interface RoleEligibilityScheduleRequestsValidateOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewScheduleDefinitionStatus = string; +export type RoleEligibilityScheduleRequestsValidateResponse = RoleEligibilityScheduleRequest; // @public -export interface AccessReviewScheduleSettings { - autoApplyDecisionsEnabled?: boolean; - defaultDecision?: DefaultDecisionType; - defaultDecisionEnabled?: boolean; - endDate?: Date; - instanceDurationInDays?: number; - interval?: number; - justificationRequiredOnApproval?: boolean; - mailNotificationsEnabled?: boolean; - numberOfOccurrences?: number; - recommendationLookBackDuration?: string; - recommendationsEnabled?: boolean; - reminderNotificationsEnabled?: boolean; - startDate?: Date; - typeRecurrencePatternType?: AccessReviewRecurrencePatternType; - typeRecurrenceRangeType?: AccessReviewRecurrenceRangeType; +export interface RoleEligibilitySchedules { + get(scope: string, roleEligibilityScheduleName: string, options?: RoleEligibilitySchedulesGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleEligibilitySchedulesListForScopeOptionalParams): PagedAsyncIterableIterator; } // @public -export interface AccessReviewScope { - readonly assignmentState?: AccessReviewScopeAssignmentState; - expandNestedMemberships?: boolean; - inactiveDuration?: string; - readonly principalType?: AccessReviewScopePrincipalType; - readonly resourceId?: string; - readonly roleDefinitionId?: string; +export interface RoleEligibilitySchedulesGetOptionalParams extends coreClient.OperationOptions { } // @public -export type AccessReviewScopeAssignmentState = string; +export type RoleEligibilitySchedulesGetResponse = RoleEligibilitySchedule; // @public -export type AccessReviewScopePrincipalType = string; - -// @public (undocumented) -export class AuthorizationManagementClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AuthorizationManagementClientOptionalParams); - // (undocumented) - accessReviewDefaultSettingsOperations: AccessReviewDefaultSettingsOperations; - // (undocumented) - accessReviewHistoryDefinitionInstance: AccessReviewHistoryDefinitionInstance; - // (undocumented) - accessReviewHistoryDefinitionInstances: AccessReviewHistoryDefinitionInstances; - // (undocumented) - accessReviewHistoryDefinitionOperations: AccessReviewHistoryDefinitionOperations; - // (undocumented) - accessReviewHistoryDefinitions: AccessReviewHistoryDefinitions; - // (undocumented) - accessReviewInstanceContactedReviewers: AccessReviewInstanceContactedReviewers; - // (undocumented) - accessReviewInstanceDecisions: AccessReviewInstanceDecisions; - // (undocumented) - accessReviewInstanceMyDecisions: AccessReviewInstanceMyDecisions; - // (undocumented) - accessReviewInstanceOperations: AccessReviewInstanceOperations; - // (undocumented) - accessReviewInstances: AccessReviewInstances; - // (undocumented) - accessReviewInstancesAssignedForMyApproval: AccessReviewInstancesAssignedForMyApproval; - // (undocumented) - accessReviewScheduleDefinitions: AccessReviewScheduleDefinitions; - // (undocumented) - accessReviewScheduleDefinitionsAssignedForMyApproval: AccessReviewScheduleDefinitionsAssignedForMyApproval; - // (undocumented) - apiVersion: string; - // (undocumented) - operations: Operations; - // (undocumented) - subscriptionId: string; - // (undocumented) - tenantLevelAccessReviewInstanceContactedReviewers: TenantLevelAccessReviewInstanceContactedReviewers; +export interface RoleEligibilitySchedulesListForScopeNextOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface AuthorizationManagementClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; -} +export type RoleEligibilitySchedulesListForScopeNextResponse = RoleEligibilityScheduleListResult; // @public -export type DecisionResourceType = string; +export interface RoleEligibilitySchedulesListForScopeOptionalParams extends coreClient.OperationOptions { + filter?: string; +} // @public -export type DecisionTargetType = string; +export type RoleEligibilitySchedulesListForScopeResponse = RoleEligibilityScheduleListResult; // @public -export type DefaultDecisionType = string; +export interface RoleManagementPolicies { + delete(scope: string, roleManagementPolicyName: string, options?: RoleManagementPoliciesDeleteOptionalParams): Promise; + get(scope: string, roleManagementPolicyName: string, options?: RoleManagementPoliciesGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleManagementPoliciesListForScopeOptionalParams): PagedAsyncIterableIterator; + update(scope: string, roleManagementPolicyName: string, parameters: RoleManagementPolicy, options?: RoleManagementPoliciesUpdateOptionalParams): Promise; +} // @public -export interface ErrorDefinition { - error?: ErrorDefinitionProperties; +export interface RoleManagementPoliciesDeleteOptionalParams extends coreClient.OperationOptions { } // @public -export interface ErrorDefinitionProperties { - code?: string; - readonly message?: string; +export interface RoleManagementPoliciesGetOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAccessRecommendationType { - // (undocumented) - Approve = "Approve", - // (undocumented) - Deny = "Deny", - // (undocumented) - NoInfoAvailable = "NoInfoAvailable" -} +export type RoleManagementPoliciesGetResponse = RoleManagementPolicy; // @public -export enum KnownAccessReviewActorIdentityType { - // (undocumented) - ServicePrincipal = "servicePrincipal", - // (undocumented) - User = "user" +export interface RoleManagementPoliciesListForScopeNextOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAccessReviewApplyResult { - // (undocumented) - AppliedSuccessfully = "AppliedSuccessfully", - // (undocumented) - AppliedSuccessfullyButObjectNotFound = "AppliedSuccessfullyButObjectNotFound", - // (undocumented) - AppliedWithUnknownFailure = "AppliedWithUnknownFailure", - // (undocumented) - Applying = "Applying", - // (undocumented) - ApplyNotSupported = "ApplyNotSupported", - // (undocumented) - New = "New" -} +export type RoleManagementPoliciesListForScopeNextResponse = RoleManagementPolicyListResult; // @public -export enum KnownAccessReviewHistoryDefinitionStatus { - // (undocumented) - Done = "Done", - // (undocumented) - Error = "Error", - // (undocumented) - InProgress = "InProgress", - // (undocumented) - Requested = "Requested" +export interface RoleManagementPoliciesListForScopeOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAccessReviewInstanceReviewersType { - // (undocumented) - Assigned = "Assigned", - // (undocumented) - Managers = "Managers", - // (undocumented) - Self = "Self" -} +export type RoleManagementPoliciesListForScopeResponse = RoleManagementPolicyListResult; // @public -export enum KnownAccessReviewInstanceStatus { - // (undocumented) - Applied = "Applied", - // (undocumented) - Applying = "Applying", - // (undocumented) - AutoReviewed = "AutoReviewed", - // (undocumented) - AutoReviewing = "AutoReviewing", - // (undocumented) - Completed = "Completed", - // (undocumented) - Completing = "Completing", - // (undocumented) - Initializing = "Initializing", - // (undocumented) - InProgress = "InProgress", - // (undocumented) - NotStarted = "NotStarted", - // (undocumented) - Scheduled = "Scheduled", - // (undocumented) - Starting = "Starting" +export interface RoleManagementPoliciesUpdateOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAccessReviewRecurrencePatternType { - // (undocumented) - AbsoluteMonthly = "absoluteMonthly", - // (undocumented) - Weekly = "weekly" -} +export type RoleManagementPoliciesUpdateResponse = RoleManagementPolicy; // @public -export enum KnownAccessReviewRecurrenceRangeType { - // (undocumented) - EndDate = "endDate", - // (undocumented) - NoEnd = "noEnd", - // (undocumented) - Numbered = "numbered" +export interface RoleManagementPolicy { + description?: string; + displayName?: string; + readonly effectiveRules?: RoleManagementPolicyRuleUnion[]; + readonly id?: string; + isOrganizationDefault?: boolean; + readonly lastModifiedBy?: Principal; + readonly lastModifiedDateTime?: Date; + readonly name?: string; + readonly policyProperties?: PolicyProperties; + rules?: RoleManagementPolicyRuleUnion[]; + scope?: string; + readonly type?: string; } // @public -export enum KnownAccessReviewResult { - // (undocumented) - Approve = "Approve", - // (undocumented) - Deny = "Deny", - // (undocumented) - DontKnow = "DontKnow", - // (undocumented) - NotNotified = "NotNotified", - // (undocumented) - NotReviewed = "NotReviewed" -} +export type RoleManagementPolicyApprovalRule = RoleManagementPolicyRule & { + ruleType: "RoleManagementPolicyApprovalRule"; + setting?: ApprovalSettings; +}; // @public -export enum KnownAccessReviewReviewerType { - // (undocumented) - ServicePrincipal = "servicePrincipal", - // (undocumented) - User = "user" +export interface RoleManagementPolicyAssignment { + readonly effectiveRules?: RoleManagementPolicyRuleUnion[]; + readonly id?: string; + readonly name?: string; + readonly policyAssignmentProperties?: PolicyAssignmentProperties; + policyId?: string; + roleDefinitionId?: string; + scope?: string; + readonly type?: string; } // @public -export enum KnownAccessReviewScheduleDefinitionReviewersType { - // (undocumented) - Assigned = "Assigned", - // (undocumented) - Managers = "Managers", - // (undocumented) - Self = "Self" +export interface RoleManagementPolicyAssignmentListResult { + nextLink?: string; + value?: RoleManagementPolicyAssignment[]; } // @public -export enum KnownAccessReviewScheduleDefinitionStatus { - // (undocumented) - Applied = "Applied", - // (undocumented) - Applying = "Applying", - // (undocumented) - AutoReviewed = "AutoReviewed", - // (undocumented) - AutoReviewing = "AutoReviewing", - // (undocumented) - Completed = "Completed", - // (undocumented) - Completing = "Completing", - // (undocumented) - Initializing = "Initializing", - // (undocumented) - InProgress = "InProgress", - // (undocumented) - NotStarted = "NotStarted", - // (undocumented) - Scheduled = "Scheduled", - // (undocumented) - Starting = "Starting" +export interface RoleManagementPolicyAssignments { + create(scope: string, roleManagementPolicyAssignmentName: string, parameters: RoleManagementPolicyAssignment, options?: RoleManagementPolicyAssignmentsCreateOptionalParams): Promise; + delete(scope: string, roleManagementPolicyAssignmentName: string, options?: RoleManagementPolicyAssignmentsDeleteOptionalParams): Promise; + get(scope: string, roleManagementPolicyAssignmentName: string, options?: RoleManagementPolicyAssignmentsGetOptionalParams): Promise; + listForScope(scope: string, options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams): PagedAsyncIterableIterator; } // @public -export enum KnownAccessReviewScopeAssignmentState { - // (undocumented) - Active = "active", - // (undocumented) - Eligible = "eligible" +export interface RoleManagementPolicyAssignmentsCreateOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAccessReviewScopePrincipalType { - // (undocumented) - GuestUser = "guestUser", - // (undocumented) - RedeemedGuestUser = "redeemedGuestUser", - // (undocumented) - ServicePrincipal = "servicePrincipal", - // (undocumented) - User = "user", - // (undocumented) - UserGroup = "user,group" -} +export type RoleManagementPolicyAssignmentsCreateResponse = RoleManagementPolicyAssignment; // @public -export enum KnownDecisionResourceType { - // (undocumented) - AzureRole = "azureRole" +export interface RoleManagementPolicyAssignmentsDeleteOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownDecisionTargetType { - // (undocumented) - ServicePrincipal = "servicePrincipal", - // (undocumented) - User = "user" +export interface RoleManagementPolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownDefaultDecisionType { - // (undocumented) - Approve = "Approve", - // (undocumented) - Deny = "Deny", - // (undocumented) - Recommendation = "Recommendation" -} +export type RoleManagementPolicyAssignmentsGetResponse = RoleManagementPolicyAssignment; // @public -export interface Operation { - display?: OperationDisplay; - isDataAction?: boolean; - name?: string; - origin?: string; +export interface RoleManagementPolicyAssignmentsListForScopeNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; -} +export type RoleManagementPolicyAssignmentsListForScopeNextResponse = RoleManagementPolicyAssignmentListResult; // @public -export interface OperationListResult { - nextLink?: string; - value?: Operation[]; +export interface RoleManagementPolicyAssignmentsListForScopeOptionalParams extends coreClient.OperationOptions { } // @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} +export type RoleManagementPolicyAssignmentsListForScopeResponse = RoleManagementPolicyAssignmentListResult; // @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { -} +export type RoleManagementPolicyAuthenticationContextRule = RoleManagementPolicyRule & { + ruleType: "RoleManagementPolicyAuthenticationContextRule"; + isEnabled?: boolean; + claimValue?: string; +}; + +// @public +export type RoleManagementPolicyEnablementRule = RoleManagementPolicyRule & { + ruleType: "RoleManagementPolicyEnablementRule"; + enabledRules?: EnablementRules[]; +}; // @public -export type OperationsListNextResponse = OperationListResult; +export type RoleManagementPolicyExpirationRule = RoleManagementPolicyRule & { + ruleType: "RoleManagementPolicyExpirationRule"; + isExpirationRequired?: boolean; + maximumDuration?: string; +}; // @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface RoleManagementPolicyListResult { + nextLink?: string; + value?: RoleManagementPolicy[]; } // @public -export type OperationsListResponse = OperationListResult; +export type RoleManagementPolicyNotificationRule = RoleManagementPolicyRule & { + ruleType: "RoleManagementPolicyNotificationRule"; + notificationType?: NotificationDeliveryMechanism; + notificationLevel?: NotificationLevel; + recipientType?: RecipientType; + notificationRecipients?: string[]; + isDefaultRecipientsEnabled?: boolean; +}; // @public -export interface TenantLevelAccessReviewInstanceContactedReviewers { - list(scheduleDefinitionId: string, id: string, options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams): PagedAsyncIterableIterator; +export interface RoleManagementPolicyRule { + id?: string; + ruleType: "RoleManagementPolicyApprovalRule" | "RoleManagementPolicyAuthenticationContextRule" | "RoleManagementPolicyEnablementRule" | "RoleManagementPolicyExpirationRule" | "RoleManagementPolicyNotificationRule"; + target?: RoleManagementPolicyRuleTarget; } // @public -export interface TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams extends coreClient.OperationOptions { +export interface RoleManagementPolicyRuleTarget { + caller?: string; + enforcedSettings?: string[]; + inheritableSettings?: string[]; + level?: string; + operations?: string[]; + targetObjects?: string[]; } // @public -export type TenantLevelAccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; +export type RoleManagementPolicyRuleType = string; + +// @public (undocumented) +export type RoleManagementPolicyRuleUnion = RoleManagementPolicyRule | RoleManagementPolicyApprovalRule | RoleManagementPolicyAuthenticationContextRule | RoleManagementPolicyEnablementRule | RoleManagementPolicyExpirationRule | RoleManagementPolicyNotificationRule; + +// @public +export type Status = string; + +// @public +export type Type = string; // @public -export interface TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams extends coreClient.OperationOptions { +export interface UserSet { + description?: string; + id?: string; + isBackup?: boolean; + userType?: UserType; } // @public -export type TenantLevelAccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; +export type UserType = string; // (No @packageDocumentation comment for this package) diff --git a/sdk/authorization/arm-authorization/samples-dev/eligibleChildResourcesGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/eligibleChildResourcesGetSample.ts new file mode 100644 index 000000000000..9417fc31fcce --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/eligibleChildResourcesGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + EligibleChildResourcesGetOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the child resources of a resource on which user has eligible access + * + * @summary Get the child resources of a resource on which user has eligible access + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json + */ +async function getEligibleChildResourcesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "resourceType eq 'resourcegroup'"; + const options: EligibleChildResourcesGetOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.eligibleChildResources.list(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getEligibleChildResourcesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesGetSample.ts new file mode 100644 index 000000000000..99dd6277951d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified role assignment schedule instance. + * + * @summary Gets the specified role assignment schedule instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json + */ +async function getRoleAssignmentScheduleInstanceByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleInstanceName = + "ed9b8180-cef7-4c77-a63c-b8566ecfc412"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleInstances.get( + scope, + roleAssignmentScheduleInstanceName + ); + console.log(result); +} + +getRoleAssignmentScheduleInstanceByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesListForScopeSample.ts new file mode 100644 index 000000000000..a50294bc1457 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleInstancesListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleInstancesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role assignment schedule instances of a role assignment schedule. + * + * @summary Gets role assignment schedule instances of a role assignment schedule. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json + */ +async function getRoleAssignmentScheduleInstancesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleAssignmentScheduleInstancesListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentScheduleInstances.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentScheduleInstancesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCancelSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCancelSample.ts new file mode 100644 index 000000000000..c9b10438e7b5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCancelSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Cancels a pending role assignment schedule request. + * + * @summary Cancels a pending role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json + */ +async function cancelRoleAssignmentScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.cancel( + scope, + roleAssignmentScheduleRequestName + ); + console.log(result); +} + +cancelRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCreateSample.ts new file mode 100644 index 000000000000..c350682177a4 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsCreateSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a role assignment schedule request. + * + * @summary Creates a role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json + */ +async function putRoleAssignmentScheduleRequest() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const parameters: RoleAssignmentScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + linkedRoleEligibilityScheduleId: "b1477448-2cc6-4ceb-93b4-54a202a89413", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "SelfActivate", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "PT8H", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:35:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.create( + scope, + roleAssignmentScheduleRequestName, + parameters + ); + console.log(result); +} + +putRoleAssignmentScheduleRequest().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsGetSample.ts new file mode 100644 index 000000000000..550dbccfc622 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role assignment schedule request. + * + * @summary Get the specified role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json + */ +async function getRoleAssignmentScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.get( + scope, + roleAssignmentScheduleRequestName + ); + console.log(result); +} + +getRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsListForScopeSample.ts new file mode 100644 index 000000000000..98ba5f87ce8a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleRequestsListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role assignment schedule requests for a scope. + * + * @summary Gets role assignment schedule requests for a scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json + */ +async function getRoleAssignmentScheduleRequestByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')"; + const options: RoleAssignmentScheduleRequestsListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentScheduleRequests.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentScheduleRequestByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsValidateSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsValidateSample.ts new file mode 100644 index 000000000000..4f9e836b372c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentScheduleRequestsValidateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates a new role assignment schedule request. + * + * @summary Validates a new role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json + */ +async function validateRoleAssignmentScheduleRequestByName() { + const scope = "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const parameters: RoleAssignmentScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + linkedRoleEligibilityScheduleId: "b1477448-2cc6-4ceb-93b4-54a202a89413", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "SelfActivate", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "PT8H", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:35:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.validate( + scope, + roleAssignmentScheduleRequestName, + parameters + ); + console.log(result); +} + +validateRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesGetSample.ts new file mode 100644 index 000000000000..bf11f97c5138 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role assignment schedule for a resource scope + * + * @summary Get the specified role assignment schedule for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json + */ +async function getRoleAssignmentScheduleByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleName = "c9e264ff-3133-4776-a81a-ebc7c33c8ec6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentSchedules.get( + scope, + roleAssignmentScheduleName + ); + console.log(result); +} + +getRoleAssignmentScheduleByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesListForScopeSample.ts new file mode 100644 index 000000000000..8304680e7542 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleAssignmentSchedulesListForScopeSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentSchedulesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role assignment schedules for a resource scope. + * + * @summary Gets role assignment schedules for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json + */ +async function getRoleAssignmentSchedulesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleAssignmentSchedulesListForScopeOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentSchedules.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentSchedulesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesGetSample.ts new file mode 100644 index 000000000000..1f53f2dad995 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified role eligibility schedule instance. + * + * @summary Gets the specified role eligibility schedule instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json + */ +async function getRoleEligibilityScheduleInstanceByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleInstanceName = + "21e4b59a-0499-4fe0-a3c3-43a3055b773a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleInstances.get( + scope, + roleEligibilityScheduleInstanceName + ); + console.log(result); +} + +getRoleEligibilityScheduleInstanceByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesListForScopeSample.ts new file mode 100644 index 000000000000..6db59a4e6d99 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleInstancesListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleInstancesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role eligibility schedule instances of a role eligibility schedule. + * + * @summary Gets role eligibility schedule instances of a role eligibility schedule. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json + */ +async function getRoleEligibilityScheduleInstancesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleEligibilityScheduleInstancesListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilityScheduleInstances.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilityScheduleInstancesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCancelSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCancelSample.ts new file mode 100644 index 000000000000..9370eb83416c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCancelSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Cancels a pending role eligibility schedule request. + * + * @summary Cancels a pending role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json + */ +async function cancelRoleEligibilityScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.cancel( + scope, + roleEligibilityScheduleRequestName + ); + console.log(result); +} + +cancelRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCreateSample.ts new file mode 100644 index 000000000000..a46fb4f128de --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsCreateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a role eligibility schedule request. + * + * @summary Creates a role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json + */ +async function putRoleEligibilityScheduleRequest() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const parameters: RoleEligibilityScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "AdminAssign", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "P365D", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:31:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.create( + scope, + roleEligibilityScheduleRequestName, + parameters + ); + console.log(result); +} + +putRoleEligibilityScheduleRequest().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsGetSample.ts new file mode 100644 index 000000000000..e8c52e4f3116 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role eligibility schedule request. + * + * @summary Get the specified role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json + */ +async function getRoleEligibilityScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.get( + scope, + roleEligibilityScheduleRequestName + ); + console.log(result); +} + +getRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsListForScopeSample.ts new file mode 100644 index 000000000000..e3057d1809cb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleRequestsListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role eligibility schedule requests for a scope. + * + * @summary Gets role eligibility schedule requests for a scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json + */ +async function getRoleEligibilityScheduleRequestByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')"; + const options: RoleEligibilityScheduleRequestsListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilityScheduleRequests.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilityScheduleRequestByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsValidateSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsValidateSample.ts new file mode 100644 index 000000000000..6eaed28729d8 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilityScheduleRequestsValidateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates a new role eligibility schedule request. + * + * @summary Validates a new role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json + */ +async function validateRoleEligibilityScheduleRequestByName() { + const scope = "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const parameters: RoleEligibilityScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "AdminAssign", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "P365D", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:31:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.validate( + scope, + roleEligibilityScheduleRequestName, + parameters + ); + console.log(result); +} + +validateRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesGetSample.ts new file mode 100644 index 000000000000..a846731cc7ed --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role eligibility schedule for a resource scope + * + * @summary Get the specified role eligibility schedule for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json + */ +async function getRoleEligibilityScheduleByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleName = "b1477448-2cc6-4ceb-93b4-54a202a89413"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilitySchedules.get( + scope, + roleEligibilityScheduleName + ); + console.log(result); +} + +getRoleEligibilityScheduleByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesListForScopeSample.ts new file mode 100644 index 000000000000..6959c6101893 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleEligibilitySchedulesListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilitySchedulesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role eligibility schedules for a resource scope. + * + * @summary Gets role eligibility schedules for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json + */ +async function getRoleEligibilitySchedulesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleEligibilitySchedulesListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilitySchedules.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilitySchedulesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesDeleteSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesDeleteSample.ts new file mode 100644 index 000000000000..00937797ae58 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a role management policy + * + * @summary Delete a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json + */ +async function deleteRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.delete( + scope, + roleManagementPolicyName + ); + console.log(result); +} + +deleteRoleManagementPolicy().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesGetSample.ts new file mode 100644 index 000000000000..61b7e7b3d9c8 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role management policy for a resource scope + * + * @summary Get the specified role management policy for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json + */ +async function getRoleManagementPolicyByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.get( + scope, + roleManagementPolicyName + ); + console.log(result); +} + +getRoleManagementPolicyByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesListForScopeSample.ts new file mode 100644 index 000000000000..713c8296ef9b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesListForScopeSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role management policies for a resource scope. + * + * @summary Gets role management policies for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json + */ +async function getRoleManagementPolicyByRoleDefinitionFilter() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleManagementPolicies.listForScope(scope)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleManagementPolicyByRoleDefinitionFilter().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesUpdateSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesUpdateSample.ts new file mode 100644 index 000000000000..560bab193712 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPoliciesUpdateSample.ts @@ -0,0 +1,391 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleManagementPolicy, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a role management policy + * + * @summary Update a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json + */ +async function patchPartialRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const parameters: RoleManagementPolicy = { + rules: [ + { + id: "Expiration_Admin_Eligibility", + isExpirationRequired: false, + maximumDuration: "P180D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.update( + scope, + roleManagementPolicyName, + parameters + ); + console.log(result); +} + +patchPartialRoleManagementPolicy().catch(console.error); + +/** + * This sample demonstrates how to Update a role management policy + * + * @summary Update a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchRoleManagementPolicy.json + */ +async function patchRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const parameters: RoleManagementPolicy = { + rules: [ + { + id: "Expiration_Admin_Eligibility", + isExpirationRequired: false, + maximumDuration: "P180D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Requestor_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Approver_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["approver_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + enabledRules: [], + id: "Enablement_Admin_Eligibility", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Expiration_Admin_Assignment", + isExpirationRequired: false, + maximumDuration: "P90D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + enabledRules: ["Justification", "MultiFactorAuthentication"], + id: "Enablement_Admin_Assignment", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_member@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Requestor_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_admin_member@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Approver_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["approver_admin_member@test.com"], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Expiration_EndUser_Assignment", + isExpirationRequired: true, + maximumDuration: "PT7H", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + enabledRules: [ + "Justification", + "MultiFactorAuthentication", + "Ticketing" + ], + id: "Enablement_EndUser_Assignment", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Approval_EndUser_Assignment", + ruleType: "RoleManagementPolicyApprovalRule", + setting: { + approvalMode: "SingleStage", + approvalStages: [ + { + approvalStageTimeOutInDays: 1, + escalationApprovers: [], + escalationTimeInMinutes: 0, + isApproverJustificationRequired: true, + isEscalationEnabled: false, + primaryApprovers: [ + { + description: "amansw_new_group", + id: "2385b0f3-5fa9-43cf-8ca4-b01dc97298cd", + isBackup: false, + userType: "Group" + }, + { + description: "amansw_group", + id: "2f4913c9-d15b-406a-9946-1d66a28f2690", + isBackup: false, + userType: "Group" + } + ] + } + ], + isApprovalRequired: true, + isApprovalRequiredForExtension: false, + isRequestorJustificationRequired: true + }, + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + claimValue: "", + id: "AuthenticationContext_EndUser_Assignment", + isEnabled: false, + ruleType: "RoleManagementPolicyAuthenticationContextRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_EndUser_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_enduser_member@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Requestor_EndUser_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_enduser_member@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Approver_EndUser_Assignment", + isDefaultRecipientsEnabled: true, + notificationLevel: "Critical", + notificationRecipients: [], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.update( + scope, + roleManagementPolicyName, + parameters + ); + console.log(result); +} + +patchRoleManagementPolicy().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsCreateSample.ts new file mode 100644 index 000000000000..0f46b3432fa9 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsCreateSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleManagementPolicyAssignment, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a role management policy assignment + * + * @summary Create a role management policy assignment + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json + */ +async function putRoleManagementPolicyAssignment() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const parameters: RoleManagementPolicyAssignment = { + policyId: + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicies/b959d571-f0b5-4042-88a7-01be6cb22db9", + roleDefinitionId: + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleDefinitions/a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + scope: "/subscriptions/129ff972-28f8-46b8-a726-e497be039368" + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.create( + scope, + roleManagementPolicyAssignmentName, + parameters + ); + console.log(result); +} + +putRoleManagementPolicyAssignment().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsDeleteSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsDeleteSample.ts new file mode 100644 index 000000000000..a09ef112cce5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsDeleteSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a role management policy assignment + * + * @summary Delete a role management policy assignment + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json + */ +async function deleteRoleManagementPolicyAssignment() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.delete( + scope, + roleManagementPolicyAssignmentName + ); + console.log(result); +} + +deleteRoleManagementPolicyAssignment().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsGetSample.ts new file mode 100644 index 000000000000..25d9bc663dd0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role management policy assignment for a resource scope + * + * @summary Get the specified role management policy assignment for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json + */ +async function getConfigurations() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.get( + scope, + roleManagementPolicyAssignmentName + ); + console.log(result); +} + +getConfigurations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsListForScopeSample.ts b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsListForScopeSample.ts new file mode 100644 index 000000000000..15cea6984ac1 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples-dev/roleManagementPolicyAssignmentsListForScopeSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role management assignment policies for a resource scope. + * + * @summary Gets role management assignment policies for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json + */ +async function getRoleManagementPolicyAssignmentByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleManagementPolicyAssignments.listForScope( + scope + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleManagementPolicyAssignmentByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/README.md b/sdk/authorization/arm-authorization/samples/v9/javascript/README.md new file mode 100644 index 000000000000..533ce11644f6 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/README.md @@ -0,0 +1,162 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessReviewDefaultSettingsGetSample.js][accessreviewdefaultsettingsgetsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json | +| [accessReviewDefaultSettingsPutSample.js][accessreviewdefaultsettingsputsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json | +| [accessReviewHistoryDefinitionCreateSample.js][accessreviewhistorydefinitioncreatesample] | Create a scheduled or one-time Access Review History Definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionDeleteByIdSample.js][accessreviewhistorydefinitiondeletebyidsample] | Delete an access review history definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js][accessreviewhistorydefinitioninstancegeneratedownloadurisample] | Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json | +| [accessReviewHistoryDefinitionInstancesListSample.js][accessreviewhistorydefinitioninstanceslistsample] | Get access review history definition instances by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json | +| [accessReviewHistoryDefinitionsGetByIdSample.js][accessreviewhistorydefinitionsgetbyidsample] | Get access review history definition by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionsListSample.js][accessreviewhistorydefinitionslistsample] | Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json | +| [accessReviewInstanceAcceptRecommendationsSample.js][accessreviewinstanceacceptrecommendationssample] | An action to accept recommendations for decision in an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json | +| [accessReviewInstanceApplyDecisionsSample.js][accessreviewinstanceapplydecisionssample] | An action to apply all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json | +| [accessReviewInstanceContactedReviewersListSample.js][accessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json | +| [accessReviewInstanceDecisionsListSample.js][accessreviewinstancedecisionslistsample] | Get access review instance decisions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json | +| [accessReviewInstanceMyDecisionsGetByIdSample.js][accessreviewinstancemydecisionsgetbyidsample] | Get my single access review instance decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceMyDecisionsListSample.js][accessreviewinstancemydecisionslistsample] | Get my access review instance decisions. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json | +| [accessReviewInstanceMyDecisionsPatchSample.js][accessreviewinstancemydecisionspatchsample] | Record a decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceResetDecisionsSample.js][accessreviewinstanceresetdecisionssample] | An action to reset all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json | +| [accessReviewInstanceSendRemindersSample.js][accessreviewinstancesendreminderssample] | An action to send reminders for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json | +| [accessReviewInstanceStopSample.js][accessreviewinstancestopsample] | An action to stop an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json | +| [accessReviewInstancesAssignedForMyApprovalGetByIdSample.js][accessreviewinstancesassignedformyapprovalgetbyidsample] | Get single access review instance assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json | +| [accessReviewInstancesAssignedForMyApprovalListSample.js][accessreviewinstancesassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json | +| [accessReviewInstancesCreateSample.js][accessreviewinstancescreatesample] | Update access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json | +| [accessReviewInstancesGetByIdSample.js][accessreviewinstancesgetbyidsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json | +| [accessReviewInstancesListSample.js][accessreviewinstanceslistsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json | +| [accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js][accessreviewscheduledefinitionsassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json | +| [accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js][accessreviewscheduledefinitionscreateorupdatebyidsample] | Create or Update access review schedule definition. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsDeleteByIdSample.js][accessreviewscheduledefinitionsdeletebyidsample] | Delete access review schedule definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsGetByIdSample.js][accessreviewscheduledefinitionsgetbyidsample] | Get single access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsListSample.js][accessreviewscheduledefinitionslistsample] | Get access review schedule definitions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json | +| [accessReviewScheduleDefinitionsStopSample.js][accessreviewscheduledefinitionsstopsample] | Stop access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json | +| [eligibleChildResourcesGetSample.js][eligiblechildresourcesgetsample] | Get the child resources of a resource on which user has eligible access x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json | +| [roleAssignmentScheduleInstancesGetSample.js][roleassignmentscheduleinstancesgetsample] | Gets the specified role assignment schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json | +| [roleAssignmentScheduleInstancesListForScopeSample.js][roleassignmentscheduleinstanceslistforscopesample] | Gets role assignment schedule instances of a role assignment schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json | +| [roleAssignmentScheduleRequestsCancelSample.js][roleassignmentschedulerequestscancelsample] | Cancels a pending role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsCreateSample.js][roleassignmentschedulerequestscreatesample] | Creates a role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json | +| [roleAssignmentScheduleRequestsGetSample.js][roleassignmentschedulerequestsgetsample] | Get the specified role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsListForScopeSample.js][roleassignmentschedulerequestslistforscopesample] | Gets role assignment schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json | +| [roleAssignmentScheduleRequestsValidateSample.js][roleassignmentschedulerequestsvalidatesample] | Validates a new role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentSchedulesGetSample.js][roleassignmentschedulesgetsample] | Get the specified role assignment schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json | +| [roleAssignmentSchedulesListForScopeSample.js][roleassignmentscheduleslistforscopesample] | Gets role assignment schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json | +| [roleEligibilityScheduleInstancesGetSample.js][roleeligibilityscheduleinstancesgetsample] | Gets the specified role eligibility schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json | +| [roleEligibilityScheduleInstancesListForScopeSample.js][roleeligibilityscheduleinstanceslistforscopesample] | Gets role eligibility schedule instances of a role eligibility schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json | +| [roleEligibilityScheduleRequestsCancelSample.js][roleeligibilityschedulerequestscancelsample] | Cancels a pending role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsCreateSample.js][roleeligibilityschedulerequestscreatesample] | Creates a role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json | +| [roleEligibilityScheduleRequestsGetSample.js][roleeligibilityschedulerequestsgetsample] | Get the specified role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsListForScopeSample.js][roleeligibilityschedulerequestslistforscopesample] | Gets role eligibility schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json | +| [roleEligibilityScheduleRequestsValidateSample.js][roleeligibilityschedulerequestsvalidatesample] | Validates a new role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json | +| [roleEligibilitySchedulesGetSample.js][roleeligibilityschedulesgetsample] | Get the specified role eligibility schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json | +| [roleEligibilitySchedulesListForScopeSample.js][roleeligibilityscheduleslistforscopesample] | Gets role eligibility schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json | +| [roleManagementPoliciesDeleteSample.js][rolemanagementpoliciesdeletesample] | Delete a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json | +| [roleManagementPoliciesGetSample.js][rolemanagementpoliciesgetsample] | Get the specified role management policy for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json | +| [roleManagementPoliciesListForScopeSample.js][rolemanagementpolicieslistforscopesample] | Gets role management policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json | +| [roleManagementPoliciesUpdateSample.js][rolemanagementpoliciesupdatesample] | Update a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json | +| [roleManagementPolicyAssignmentsCreateSample.js][rolemanagementpolicyassignmentscreatesample] | Create a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsDeleteSample.js][rolemanagementpolicyassignmentsdeletesample] | Delete a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsGetSample.js][rolemanagementpolicyassignmentsgetsample] | Get the specified role management policy assignment for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json | +| [roleManagementPolicyAssignmentsListForScopeSample.js][rolemanagementpolicyassignmentslistforscopesample] | Gets role management assignment policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json | +| [tenantLevelAccessReviewInstanceContactedReviewersListSample.js][tenantlevelaccessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node accessReviewDefaultSettingsGetSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node accessReviewDefaultSettingsGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accessreviewdefaultsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js +[accessreviewdefaultsettingsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js +[accessreviewhistorydefinitioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js +[accessreviewhistorydefinitiondeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js +[accessreviewhistorydefinitioninstancegeneratedownloadurisample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js +[accessreviewhistorydefinitioninstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js +[accessreviewhistorydefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js +[accessreviewhistorydefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js +[accessreviewinstanceacceptrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js +[accessreviewinstanceapplydecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js +[accessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js +[accessreviewinstancedecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js +[accessreviewinstancemydecisionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js +[accessreviewinstancemydecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js +[accessreviewinstancemydecisionspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js +[accessreviewinstanceresetdecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js +[accessreviewinstancesendreminderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js +[accessreviewinstancestopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js +[accessreviewinstancesassignedformyapprovalgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js +[accessreviewinstancesassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js +[accessreviewinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js +[accessreviewinstancesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js +[accessreviewinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js +[accessreviewscheduledefinitionsassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js +[accessreviewscheduledefinitionscreateorupdatebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js +[accessreviewscheduledefinitionsdeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js +[accessreviewscheduledefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js +[accessreviewscheduledefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js +[accessreviewscheduledefinitionsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js +[eligiblechildresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/eligibleChildResourcesGetSample.js +[roleassignmentscheduleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesGetSample.js +[roleassignmentscheduleinstanceslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesListForScopeSample.js +[roleassignmentschedulerequestscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCancelSample.js +[roleassignmentschedulerequestscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCreateSample.js +[roleassignmentschedulerequestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsGetSample.js +[roleassignmentschedulerequestslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsListForScopeSample.js +[roleassignmentschedulerequestsvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsValidateSample.js +[roleassignmentschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesGetSample.js +[roleassignmentscheduleslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesListForScopeSample.js +[roleeligibilityscheduleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesGetSample.js +[roleeligibilityscheduleinstanceslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesListForScopeSample.js +[roleeligibilityschedulerequestscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCancelSample.js +[roleeligibilityschedulerequestscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCreateSample.js +[roleeligibilityschedulerequestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsGetSample.js +[roleeligibilityschedulerequestslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsListForScopeSample.js +[roleeligibilityschedulerequestsvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsValidateSample.js +[roleeligibilityschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesGetSample.js +[roleeligibilityscheduleslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesListForScopeSample.js +[rolemanagementpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesDeleteSample.js +[rolemanagementpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesGetSample.js +[rolemanagementpolicieslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesListForScopeSample.js +[rolemanagementpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesUpdateSample.js +[rolemanagementpolicyassignmentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsCreateSample.js +[rolemanagementpolicyassignmentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsDeleteSample.js +[rolemanagementpolicyassignmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsGetSample.js +[rolemanagementpolicyassignmentslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsListForScopeSample.js +[tenantlevelaccessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization/README.md diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js new file mode 100644 index 000000000000..437e973b5245 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json + */ +async function getAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.get(); + console.log(result); +} + +getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js new file mode 100644 index 000000000000..328137663068 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json + */ +async function putAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.put(properties); + console.log(result); +} + +putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js new file mode 100644 index 000000000000..47d0945a787a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition + * + * @summary Create a scheduled or one-time Access Review History Definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json + */ +async function putAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.create( + historyDefinitionId, + properties + ); + console.log(result); +} + +putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js new file mode 100644 index 000000000000..31d7f1d9def4 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete an access review history definition + * + * @summary Delete an access review history definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.deleteById( + historyDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js new file mode 100644 index 000000000000..99428ccf9484 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * + * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ +async function postAccessReviewHistoryDefinitionInstance() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( + historyDefinitionId, + instanceId + ); + console.log(result); +} + +postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js new file mode 100644 index 000000000000..afa7f63bc40d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review history definition instances by definition Id + * + * @summary Get access review history definition instances by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ +async function getAccessReviewHistoryDefinitionInstances() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitionInstances.list(historyDefinitionId)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js new file mode 100644 index 000000000000..24c05ee9365a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review history definition by definition Id + * + * @summary Get access review history definition by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json + */ +async function getAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitions.getById(historyDefinitionId); + console.log(result); +} + +getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js new file mode 100644 index 000000000000..cfd1cff632f0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * + * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json + */ +async function getAccessReviewHistoryDefinitions() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js new file mode 100644 index 000000000000..40fe2002873d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. + * + * @summary An action to accept recommendations for decision in an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ +async function accessReviewInstanceAcceptRecommmendations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.acceptRecommendations( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js new file mode 100644 index 000000000000..a65e5f50a74c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to apply all decisions for an access review instance. + * + * @summary An action to apply all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json + */ +async function accessReviewInstanceApplyDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.applyDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js new file mode 100644 index 000000000000..cb4bac464e66 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ +async function getAccessReviewInstanceContactedReviewers() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js new file mode 100644 index 000000000000..b06023f255eb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instance decisions + * + * @summary Get access review instance decisions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json + */ +async function getAccessReviewInstanceDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceDecisions.list(scheduleDefinitionId, id)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js new file mode 100644 index 000000000000..9ff10fba3052 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get my single access review instance decision. + * + * @summary Get my single access review instance decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ +async function getAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.getById( + scheduleDefinitionId, + id, + decisionId + ); + console.log(result); +} + +getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js new file mode 100644 index 000000000000..0fa6e02855cc --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get my access review instance decisions. + * + * @summary Get my access review instance decisions. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ +async function getAccessReviewMyInstanceDecisions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceMyDecisions.list(scheduleDefinitionId, id)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js new file mode 100644 index 000000000000..892803d312f3 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Record a decision. + * + * @summary Record a decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ +async function patchAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.patch( + scheduleDefinitionId, + id, + decisionId, + properties + ); + console.log(result); +} + +patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js new file mode 100644 index 000000000000..bb479705e39d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to reset all decisions for an access review instance. + * + * @summary An action to reset all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json + */ +async function accessReviewInstanceResetDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.resetDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js new file mode 100644 index 000000000000..9322ea16133e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to send reminders for an access review instance. + * + * @summary An action to send reminders for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json + */ +async function accessReviewInstanceSendReminders() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.sendReminders( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js new file mode 100644 index 000000000000..d4f7e2f2de99 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to An action to stop an access review instance. + * + * @summary An action to stop an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json + */ +async function accessReviewInstanceStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.stop(scheduleDefinitionId, id); + console.log(result); +} + +accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js new file mode 100644 index 000000000000..a457f3dc96d9 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get single access review instance assigned for my approval. + * + * @summary Get single access review instance assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ +async function getAccessReviewInstanceAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstancesAssignedForMyApproval.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js new file mode 100644 index 000000000000..be77084d4eac --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ +async function getAccessReviewInstancesAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const filter = "assignedToMeToReview()"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( + scheduleDefinitionId, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js new file mode 100644 index 000000000000..a9fc9ab35c72 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update access review instance. + * + * @summary Update access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json + */ +async function putAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.create(scheduleDefinitionId, id, properties); + console.log(result); +} + +putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js new file mode 100644 index 000000000000..a724efdfb14d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json + */ +async function getAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.getById(scheduleDefinitionId, id); + console.log(result); +} + +getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js new file mode 100644 index 000000000000..9e7e3ce95e9e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json + */ +async function getAccessReviewInstances() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstances.list(scheduleDefinitionId)) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js new file mode 100644 index 000000000000..1cf350db0a64 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ +async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const filter = "assignedToMeToReview()"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js new file mode 100644 index 000000000000..67a7c7e0f161 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or Update access review schedule definition. + * + * @summary Create or Update access review schedule definition. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json + */ +async function putAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( + scheduleDefinitionId, + properties + ); + console.log(result); +} + +putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js new file mode 100644 index 000000000000..53302485e016 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete access review schedule definition + * + * @summary Delete access review schedule definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.deleteById(scheduleDefinitionId); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js new file mode 100644 index 000000000000..3676eb7ecddf --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get single access review definition + * + * @summary Get single access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json + */ +async function getAccessReviewScheduleDefinition() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.getById(scheduleDefinitionId); + console.log(result); +} + +getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js new file mode 100644 index 000000000000..b0d05478528b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review schedule definitions + * + * @summary Get access review schedule definitions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json + */ +async function getAccessReviewScheduleDefinitions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js new file mode 100644 index 000000000000..90425be030c9 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop access review definition + * + * @summary Stop access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json + */ +async function accessReviewScheduleDefinitionStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.stop(scheduleDefinitionId); + console.log(result); +} + +accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/eligibleChildResourcesGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/eligibleChildResourcesGetSample.js new file mode 100644 index 000000000000..1b93fadedb1d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/eligibleChildResourcesGetSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the child resources of a resource on which user has eligible access + * + * @summary Get the child resources of a resource on which user has eligible access + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json + */ +async function getEligibleChildResourcesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "resourceType eq 'resourcegroup'"; + const options = { filter }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.eligibleChildResources.list(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getEligibleChildResourcesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/package.json b/sdk/authorization/arm-authorization/samples/v9/javascript/package.json new file mode 100644 index 000000000000..454d3d56916f --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-authorization-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/authorization/arm-authorization" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization", + "dependencies": { + "@azure/arm-authorization": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesGetSample.js new file mode 100644 index 000000000000..2e25629c5ff4 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified role assignment schedule instance. + * + * @summary Gets the specified role assignment schedule instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json + */ +async function getRoleAssignmentScheduleInstanceByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleInstanceName = "ed9b8180-cef7-4c77-a63c-b8566ecfc412"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleInstances.get( + scope, + roleAssignmentScheduleInstanceName + ); + console.log(result); +} + +getRoleAssignmentScheduleInstanceByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesListForScopeSample.js new file mode 100644 index 000000000000..170934b21a55 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesListForScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role assignment schedule instances of a role assignment schedule. + * + * @summary Gets role assignment schedule instances of a role assignment schedule. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json + */ +async function getRoleAssignmentScheduleInstancesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentScheduleInstances.listForScope(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentScheduleInstancesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCancelSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCancelSample.js new file mode 100644 index 000000000000..42cd5bc7c896 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCancelSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Cancels a pending role assignment schedule request. + * + * @summary Cancels a pending role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json + */ +async function cancelRoleAssignmentScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = "fea7a502-9a96-4806-a26f-eee560e52045"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.cancel( + scope, + roleAssignmentScheduleRequestName + ); + console.log(result); +} + +cancelRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCreateSample.js new file mode 100644 index 000000000000..ee1591ae73c5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsCreateSample.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates a role assignment schedule request. + * + * @summary Creates a role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json + */ +async function putRoleAssignmentScheduleRequest() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = "fea7a502-9a96-4806-a26f-eee560e52045"; + const parameters = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + linkedRoleEligibilityScheduleId: "b1477448-2cc6-4ceb-93b4-54a202a89413", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "SelfActivate", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "PT8H", + endDateTime: undefined, + }, + startDateTime: new Date("2020-09-09T21:35:27.91Z"), + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.create( + scope, + roleAssignmentScheduleRequestName, + parameters + ); + console.log(result); +} + +putRoleAssignmentScheduleRequest().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsGetSample.js new file mode 100644 index 000000000000..5b53f8d0a5eb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified role assignment schedule request. + * + * @summary Get the specified role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json + */ +async function getRoleAssignmentScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = "fea7a502-9a96-4806-a26f-eee560e52045"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.get( + scope, + roleAssignmentScheduleRequestName + ); + console.log(result); +} + +getRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsListForScopeSample.js new file mode 100644 index 000000000000..6bcb711b74fd --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsListForScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role assignment schedule requests for a scope. + * + * @summary Gets role assignment schedule requests for a scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json + */ +async function getRoleAssignmentScheduleRequestByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentScheduleRequests.listForScope(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentScheduleRequestByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsValidateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsValidateSample.js new file mode 100644 index 000000000000..bfb67cc6fb29 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleRequestsValidateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Validates a new role assignment schedule request. + * + * @summary Validates a new role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json + */ +async function validateRoleAssignmentScheduleRequestByName() { + const scope = "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = "fea7a502-9a96-4806-a26f-eee560e52045"; + const parameters = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + linkedRoleEligibilityScheduleId: "b1477448-2cc6-4ceb-93b4-54a202a89413", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "SelfActivate", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "PT8H", + endDateTime: undefined, + }, + startDateTime: new Date("2020-09-09T21:35:27.91Z"), + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.validate( + scope, + roleAssignmentScheduleRequestName, + parameters + ); + console.log(result); +} + +validateRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesGetSample.js new file mode 100644 index 000000000000..fddaca2411ef --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified role assignment schedule for a resource scope + * + * @summary Get the specified role assignment schedule for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json + */ +async function getRoleAssignmentScheduleByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleName = "c9e264ff-3133-4776-a81a-ebc7c33c8ec6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentSchedules.get(scope, roleAssignmentScheduleName); + console.log(result); +} + +getRoleAssignmentScheduleByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesListForScopeSample.js new file mode 100644 index 000000000000..03a4ddbbdc99 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentSchedulesListForScopeSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role assignment schedules for a resource scope. + * + * @summary Gets role assignment schedules for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json + */ +async function getRoleAssignmentSchedulesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options = { filter }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentSchedules.listForScope(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentSchedulesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesGetSample.js new file mode 100644 index 000000000000..fe5e2c825262 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified role eligibility schedule instance. + * + * @summary Gets the specified role eligibility schedule instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json + */ +async function getRoleEligibilityScheduleInstanceByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleInstanceName = "21e4b59a-0499-4fe0-a3c3-43a3055b773a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleInstances.get( + scope, + roleEligibilityScheduleInstanceName + ); + console.log(result); +} + +getRoleEligibilityScheduleInstanceByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesListForScopeSample.js new file mode 100644 index 000000000000..5962fb444d3d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleInstancesListForScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role eligibility schedule instances of a role eligibility schedule. + * + * @summary Gets role eligibility schedule instances of a role eligibility schedule. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json + */ +async function getRoleEligibilityScheduleInstancesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilityScheduleInstances.listForScope(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilityScheduleInstancesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCancelSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCancelSample.js new file mode 100644 index 000000000000..90b4b96f5617 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCancelSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Cancels a pending role eligibility schedule request. + * + * @summary Cancels a pending role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json + */ +async function cancelRoleEligibilityScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.cancel( + scope, + roleEligibilityScheduleRequestName + ); + console.log(result); +} + +cancelRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCreateSample.js new file mode 100644 index 000000000000..2b3af34400e2 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsCreateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates a role eligibility schedule request. + * + * @summary Creates a role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json + */ +async function putRoleEligibilityScheduleRequest() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const parameters = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "AdminAssign", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "P365D", + endDateTime: undefined, + }, + startDateTime: new Date("2020-09-09T21:31:27.91Z"), + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.create( + scope, + roleEligibilityScheduleRequestName, + parameters + ); + console.log(result); +} + +putRoleEligibilityScheduleRequest().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsGetSample.js new file mode 100644 index 000000000000..a8cdde4ab7e5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified role eligibility schedule request. + * + * @summary Get the specified role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json + */ +async function getRoleEligibilityScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.get( + scope, + roleEligibilityScheduleRequestName + ); + console.log(result); +} + +getRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsListForScopeSample.js new file mode 100644 index 000000000000..3dc3b88c29d2 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsListForScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role eligibility schedule requests for a scope. + * + * @summary Gets role eligibility schedule requests for a scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json + */ +async function getRoleEligibilityScheduleRequestByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilityScheduleRequests.listForScope(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilityScheduleRequestByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsValidateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsValidateSample.js new file mode 100644 index 000000000000..b18a0064feb0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilityScheduleRequestsValidateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Validates a new role eligibility schedule request. + * + * @summary Validates a new role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json + */ +async function validateRoleEligibilityScheduleRequestByName() { + const scope = "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const parameters = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "AdminAssign", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "P365D", + endDateTime: undefined, + }, + startDateTime: new Date("2020-09-09T21:31:27.91Z"), + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.validate( + scope, + roleEligibilityScheduleRequestName, + parameters + ); + console.log(result); +} + +validateRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesGetSample.js new file mode 100644 index 000000000000..a3e335e8ded7 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified role eligibility schedule for a resource scope + * + * @summary Get the specified role eligibility schedule for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json + */ +async function getRoleEligibilityScheduleByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleName = "b1477448-2cc6-4ceb-93b4-54a202a89413"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilitySchedules.get(scope, roleEligibilityScheduleName); + console.log(result); +} + +getRoleEligibilityScheduleByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesListForScopeSample.js new file mode 100644 index 000000000000..7185a855e72a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleEligibilitySchedulesListForScopeSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role eligibility schedules for a resource scope. + * + * @summary Gets role eligibility schedules for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json + */ +async function getRoleEligibilitySchedulesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options = { + filter, + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilitySchedules.listForScope(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilitySchedulesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesDeleteSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesDeleteSample.js new file mode 100644 index 000000000000..27e44329de58 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a role management policy + * + * @summary Delete a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json + */ +async function deleteRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.delete(scope, roleManagementPolicyName); + console.log(result); +} + +deleteRoleManagementPolicy().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesGetSample.js new file mode 100644 index 000000000000..3e7c231cae86 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified role management policy for a resource scope + * + * @summary Get the specified role management policy for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json + */ +async function getRoleManagementPolicyByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.get(scope, roleManagementPolicyName); + console.log(result); +} + +getRoleManagementPolicyByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesListForScopeSample.js new file mode 100644 index 000000000000..20e9cb86afbe --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesListForScopeSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role management policies for a resource scope. + * + * @summary Gets role management policies for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json + */ +async function getRoleManagementPolicyByRoleDefinitionFilter() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleManagementPolicies.listForScope(scope)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleManagementPolicyByRoleDefinitionFilter().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesUpdateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesUpdateSample.js new file mode 100644 index 000000000000..73f3c029e5ff --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPoliciesUpdateSample.js @@ -0,0 +1,384 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update a role management policy + * + * @summary Update a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json + */ +async function patchPartialRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const parameters = { + rules: [ + { + id: "Expiration_Admin_Eligibility", + isExpirationRequired: false, + maximumDuration: "P180D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Admin_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.update( + scope, + roleManagementPolicyName, + parameters + ); + console.log(result); +} + +patchPartialRoleManagementPolicy().catch(console.error); + +/** + * This sample demonstrates how to Update a role management policy + * + * @summary Update a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchRoleManagementPolicy.json + */ +async function patchRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const parameters = { + rules: [ + { + id: "Expiration_Admin_Eligibility", + isExpirationRequired: false, + maximumDuration: "P180D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Admin_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Requestor_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Approver_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["approver_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + { + enabledRules: [], + id: "Enablement_Admin_Eligibility", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Expiration_Admin_Assignment", + isExpirationRequired: false, + maximumDuration: "P90D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + enabledRules: ["Justification", "MultiFactorAuthentication"], + id: "Enablement_Admin_Assignment", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Admin_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_member@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Requestor_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_admin_member@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Approver_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["approver_admin_member@test.com"], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Expiration_EndUser_Assignment", + isExpirationRequired: true, + maximumDuration: "PT7H", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + enabledRules: ["Justification", "MultiFactorAuthentication", "Ticketing"], + id: "Enablement_EndUser_Assignment", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Approval_EndUser_Assignment", + ruleType: "RoleManagementPolicyApprovalRule", + setting: { + approvalMode: "SingleStage", + approvalStages: [ + { + approvalStageTimeOutInDays: 1, + escalationApprovers: [], + escalationTimeInMinutes: 0, + isApproverJustificationRequired: true, + isEscalationEnabled: false, + primaryApprovers: [ + { + description: "amansw_new_group", + id: "2385b0f3-5fa9-43cf-8ca4-b01dc97298cd", + isBackup: false, + userType: "Group", + }, + { + description: "amansw_group", + id: "2f4913c9-d15b-406a-9946-1d66a28f2690", + isBackup: false, + userType: "Group", + }, + ], + }, + ], + isApprovalRequired: true, + isApprovalRequiredForExtension: false, + isRequestorJustificationRequired: true, + }, + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + claimValue: "", + id: "AuthenticationContext_EndUser_Assignment", + isEnabled: false, + ruleType: "RoleManagementPolicyAuthenticationContextRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Admin_EndUser_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_enduser_member@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Requestor_EndUser_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_enduser_member@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + { + id: "Notification_Approver_EndUser_Assignment", + isDefaultRecipientsEnabled: true, + notificationLevel: "Critical", + notificationRecipients: [], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"], + }, + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.update( + scope, + roleManagementPolicyName, + parameters + ); + console.log(result); +} + +patchRoleManagementPolicy().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsCreateSample.js new file mode 100644 index 000000000000..cf661b682eb5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsCreateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a role management policy assignment + * + * @summary Create a role management policy assignment + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json + */ +async function putRoleManagementPolicyAssignment() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const parameters = { + policyId: + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicies/b959d571-f0b5-4042-88a7-01be6cb22db9", + roleDefinitionId: + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleDefinitions/a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + scope: "/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.create( + scope, + roleManagementPolicyAssignmentName, + parameters + ); + console.log(result); +} + +putRoleManagementPolicyAssignment().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsDeleteSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsDeleteSample.js new file mode 100644 index 000000000000..3545cc8fa9a5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsDeleteSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a role management policy assignment + * + * @summary Delete a role management policy assignment + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json + */ +async function deleteRoleManagementPolicyAssignment() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.delete( + scope, + roleManagementPolicyAssignmentName + ); + console.log(result); +} + +deleteRoleManagementPolicyAssignment().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsGetSample.js new file mode 100644 index 000000000000..8b9e764df054 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsGetSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the specified role management policy assignment for a resource scope + * + * @summary Get the specified role management policy assignment for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json + */ +async function getConfigurations() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.get( + scope, + roleManagementPolicyAssignmentName + ); + console.log(result); +} + +getConfigurations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsListForScopeSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsListForScopeSample.js new file mode 100644 index 000000000000..4e706e529569 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsListForScopeSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets role management assignment policies for a resource scope. + * + * @summary Gets role management assignment policies for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json + */ +async function getRoleManagementPolicyAssignmentByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleManagementPolicyAssignments.listForScope(scope)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleManagementPolicyAssignmentByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/sample.env b/sdk/authorization/arm-authorization/samples/v9/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js new file mode 100644 index 000000000000..3048638696df --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AuthorizationManagementClient } = require("@azure/arm-authorization"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ +async function tenantLevelGetAccessReviewInstanceContactedReviewers() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/README.md b/sdk/authorization/arm-authorization/samples/v9/typescript/README.md new file mode 100644 index 000000000000..4f3924d07576 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/README.md @@ -0,0 +1,175 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessReviewDefaultSettingsGetSample.ts][accessreviewdefaultsettingsgetsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json | +| [accessReviewDefaultSettingsPutSample.ts][accessreviewdefaultsettingsputsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json | +| [accessReviewHistoryDefinitionCreateSample.ts][accessreviewhistorydefinitioncreatesample] | Create a scheduled or one-time Access Review History Definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionDeleteByIdSample.ts][accessreviewhistorydefinitiondeletebyidsample] | Delete an access review history definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts][accessreviewhistorydefinitioninstancegeneratedownloadurisample] | Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json | +| [accessReviewHistoryDefinitionInstancesListSample.ts][accessreviewhistorydefinitioninstanceslistsample] | Get access review history definition instances by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json | +| [accessReviewHistoryDefinitionsGetByIdSample.ts][accessreviewhistorydefinitionsgetbyidsample] | Get access review history definition by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json | +| [accessReviewHistoryDefinitionsListSample.ts][accessreviewhistorydefinitionslistsample] | Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json | +| [accessReviewInstanceAcceptRecommendationsSample.ts][accessreviewinstanceacceptrecommendationssample] | An action to accept recommendations for decision in an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json | +| [accessReviewInstanceApplyDecisionsSample.ts][accessreviewinstanceapplydecisionssample] | An action to apply all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json | +| [accessReviewInstanceContactedReviewersListSample.ts][accessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json | +| [accessReviewInstanceDecisionsListSample.ts][accessreviewinstancedecisionslistsample] | Get access review instance decisions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json | +| [accessReviewInstanceMyDecisionsGetByIdSample.ts][accessreviewinstancemydecisionsgetbyidsample] | Get my single access review instance decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceMyDecisionsListSample.ts][accessreviewinstancemydecisionslistsample] | Get my access review instance decisions. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json | +| [accessReviewInstanceMyDecisionsPatchSample.ts][accessreviewinstancemydecisionspatchsample] | Record a decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json | +| [accessReviewInstanceResetDecisionsSample.ts][accessreviewinstanceresetdecisionssample] | An action to reset all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json | +| [accessReviewInstanceSendRemindersSample.ts][accessreviewinstancesendreminderssample] | An action to send reminders for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json | +| [accessReviewInstanceStopSample.ts][accessreviewinstancestopsample] | An action to stop an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json | +| [accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts][accessreviewinstancesassignedformyapprovalgetbyidsample] | Get single access review instance assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json | +| [accessReviewInstancesAssignedForMyApprovalListSample.ts][accessreviewinstancesassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json | +| [accessReviewInstancesCreateSample.ts][accessreviewinstancescreatesample] | Update access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json | +| [accessReviewInstancesGetByIdSample.ts][accessreviewinstancesgetbyidsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json | +| [accessReviewInstancesListSample.ts][accessreviewinstanceslistsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json | +| [accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts][accessreviewscheduledefinitionsassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json | +| [accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts][accessreviewscheduledefinitionscreateorupdatebyidsample] | Create or Update access review schedule definition. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsDeleteByIdSample.ts][accessreviewscheduledefinitionsdeletebyidsample] | Delete access review schedule definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsGetByIdSample.ts][accessreviewscheduledefinitionsgetbyidsample] | Get single access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json | +| [accessReviewScheduleDefinitionsListSample.ts][accessreviewscheduledefinitionslistsample] | Get access review schedule definitions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json | +| [accessReviewScheduleDefinitionsStopSample.ts][accessreviewscheduledefinitionsstopsample] | Stop access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json | +| [eligibleChildResourcesGetSample.ts][eligiblechildresourcesgetsample] | Get the child resources of a resource on which user has eligible access x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json | +| [roleAssignmentScheduleInstancesGetSample.ts][roleassignmentscheduleinstancesgetsample] | Gets the specified role assignment schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json | +| [roleAssignmentScheduleInstancesListForScopeSample.ts][roleassignmentscheduleinstanceslistforscopesample] | Gets role assignment schedule instances of a role assignment schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json | +| [roleAssignmentScheduleRequestsCancelSample.ts][roleassignmentschedulerequestscancelsample] | Cancels a pending role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsCreateSample.ts][roleassignmentschedulerequestscreatesample] | Creates a role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json | +| [roleAssignmentScheduleRequestsGetSample.ts][roleassignmentschedulerequestsgetsample] | Get the specified role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsListForScopeSample.ts][roleassignmentschedulerequestslistforscopesample] | Gets role assignment schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json | +| [roleAssignmentScheduleRequestsValidateSample.ts][roleassignmentschedulerequestsvalidatesample] | Validates a new role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentSchedulesGetSample.ts][roleassignmentschedulesgetsample] | Get the specified role assignment schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json | +| [roleAssignmentSchedulesListForScopeSample.ts][roleassignmentscheduleslistforscopesample] | Gets role assignment schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json | +| [roleEligibilityScheduleInstancesGetSample.ts][roleeligibilityscheduleinstancesgetsample] | Gets the specified role eligibility schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json | +| [roleEligibilityScheduleInstancesListForScopeSample.ts][roleeligibilityscheduleinstanceslistforscopesample] | Gets role eligibility schedule instances of a role eligibility schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json | +| [roleEligibilityScheduleRequestsCancelSample.ts][roleeligibilityschedulerequestscancelsample] | Cancels a pending role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsCreateSample.ts][roleeligibilityschedulerequestscreatesample] | Creates a role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json | +| [roleEligibilityScheduleRequestsGetSample.ts][roleeligibilityschedulerequestsgetsample] | Get the specified role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsListForScopeSample.ts][roleeligibilityschedulerequestslistforscopesample] | Gets role eligibility schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json | +| [roleEligibilityScheduleRequestsValidateSample.ts][roleeligibilityschedulerequestsvalidatesample] | Validates a new role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json | +| [roleEligibilitySchedulesGetSample.ts][roleeligibilityschedulesgetsample] | Get the specified role eligibility schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json | +| [roleEligibilitySchedulesListForScopeSample.ts][roleeligibilityscheduleslistforscopesample] | Gets role eligibility schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json | +| [roleManagementPoliciesDeleteSample.ts][rolemanagementpoliciesdeletesample] | Delete a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json | +| [roleManagementPoliciesGetSample.ts][rolemanagementpoliciesgetsample] | Get the specified role management policy for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json | +| [roleManagementPoliciesListForScopeSample.ts][rolemanagementpolicieslistforscopesample] | Gets role management policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json | +| [roleManagementPoliciesUpdateSample.ts][rolemanagementpoliciesupdatesample] | Update a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json | +| [roleManagementPolicyAssignmentsCreateSample.ts][rolemanagementpolicyassignmentscreatesample] | Create a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsDeleteSample.ts][rolemanagementpolicyassignmentsdeletesample] | Delete a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsGetSample.ts][rolemanagementpolicyassignmentsgetsample] | Get the specified role management policy assignment for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json | +| [roleManagementPolicyAssignmentsListForScopeSample.ts][rolemanagementpolicyassignmentslistforscopesample] | Gets role management assignment policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json | +| [tenantLevelAccessReviewInstanceContactedReviewersListSample.ts][tenantlevelaccessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/accessReviewDefaultSettingsGetSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/accessReviewDefaultSettingsGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accessreviewdefaultsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts +[accessreviewdefaultsettingsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts +[accessreviewhistorydefinitioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts +[accessreviewhistorydefinitiondeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts +[accessreviewhistorydefinitioninstancegeneratedownloadurisample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts +[accessreviewhistorydefinitioninstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts +[accessreviewhistorydefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts +[accessreviewhistorydefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts +[accessreviewinstanceacceptrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts +[accessreviewinstanceapplydecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts +[accessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts +[accessreviewinstancedecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts +[accessreviewinstancemydecisionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts +[accessreviewinstancemydecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts +[accessreviewinstancemydecisionspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts +[accessreviewinstanceresetdecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts +[accessreviewinstancesendreminderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts +[accessreviewinstancestopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts +[accessreviewinstancesassignedformyapprovalgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts +[accessreviewinstancesassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts +[accessreviewinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts +[accessreviewinstancesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts +[accessreviewinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts +[accessreviewscheduledefinitionsassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts +[accessreviewscheduledefinitionscreateorupdatebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts +[accessreviewscheduledefinitionsdeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts +[accessreviewscheduledefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts +[accessreviewscheduledefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts +[accessreviewscheduledefinitionsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts +[eligiblechildresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/eligibleChildResourcesGetSample.ts +[roleassignmentscheduleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesGetSample.ts +[roleassignmentscheduleinstanceslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesListForScopeSample.ts +[roleassignmentschedulerequestscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCancelSample.ts +[roleassignmentschedulerequestscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCreateSample.ts +[roleassignmentschedulerequestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsGetSample.ts +[roleassignmentschedulerequestslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsListForScopeSample.ts +[roleassignmentschedulerequestsvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsValidateSample.ts +[roleassignmentschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesGetSample.ts +[roleassignmentscheduleslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesListForScopeSample.ts +[roleeligibilityscheduleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesGetSample.ts +[roleeligibilityscheduleinstanceslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesListForScopeSample.ts +[roleeligibilityschedulerequestscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCancelSample.ts +[roleeligibilityschedulerequestscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCreateSample.ts +[roleeligibilityschedulerequestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsGetSample.ts +[roleeligibilityschedulerequestslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsListForScopeSample.ts +[roleeligibilityschedulerequestsvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsValidateSample.ts +[roleeligibilityschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesGetSample.ts +[roleeligibilityscheduleslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesListForScopeSample.ts +[rolemanagementpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesDeleteSample.ts +[rolemanagementpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesGetSample.ts +[rolemanagementpolicieslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesListForScopeSample.ts +[rolemanagementpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesUpdateSample.ts +[rolemanagementpolicyassignmentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsCreateSample.ts +[rolemanagementpolicyassignmentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsDeleteSample.ts +[rolemanagementpolicyassignmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsGetSample.ts +[rolemanagementpolicyassignmentslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsListForScopeSample.ts +[tenantlevelaccessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/package.json b/sdk/authorization/arm-authorization/samples/v9/typescript/package.json new file mode 100644 index 000000000000..986f85487a5d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-authorization-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/authorization/arm-authorization" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization", + "dependencies": { + "@azure/arm-authorization": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/sample.env b/sdk/authorization/arm-authorization/samples/v9/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts new file mode 100644 index 000000000000..a0b0a43a56de --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json + */ +async function getAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.get(); + console.log(result); +} + +getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts new file mode 100644 index 000000000000..50cedccdcf86 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleSettings, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review default settings for the subscription + * + * @summary Get access review default settings for the subscription + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json + */ +async function putAccessReviewDefaultSettings() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewScheduleSettings = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewDefaultSettingsOperations.put( + properties + ); + console.log(result); +} + +putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts new file mode 100644 index 000000000000..e39c7cb0970e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewHistoryDefinitionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition + * + * @summary Create a scheduled or one-time Access Review History Definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json + */ +async function putAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const properties: AccessReviewHistoryDefinitionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.create( + historyDefinitionId, + properties + ); + console.log(result); +} + +putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts new file mode 100644 index 000000000000..69fa585d77b7 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete an access review history definition + * + * @summary Delete an access review history definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionOperations.deleteById( + historyDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts new file mode 100644 index 000000000000..cc30aaaef9c2 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * + * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ +async function postAccessReviewHistoryDefinitionInstance() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( + historyDefinitionId, + instanceId + ); + console.log(result); +} + +postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts new file mode 100644 index 000000000000..f58b44160d78 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review history definition instances by definition Id + * + * @summary Get access review history definition instances by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ +async function getAccessReviewHistoryDefinitionInstances() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitionInstances.list( + historyDefinitionId + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts new file mode 100644 index 000000000000..b3ac5f469101 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review history definition by definition Id + * + * @summary Get access review history definition by definition Id + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json + */ +async function getAccessReviewHistoryDefinition() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewHistoryDefinitions.getById( + historyDefinitionId + ); + console.log(result); +} + +getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts new file mode 100644 index 000000000000..de8ee5a79dbe --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * + * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json + */ +async function getAccessReviewHistoryDefinitions() { + const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewHistoryDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts new file mode 100644 index 000000000000..e881a9757421 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. + * + * @summary An action to accept recommendations for decision in an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ +async function accessReviewInstanceAcceptRecommmendations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.acceptRecommendations( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts new file mode 100644 index 000000000000..8ee8addf9757 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to apply all decisions for an access review instance. + * + * @summary An action to apply all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json + */ +async function accessReviewInstanceApplyDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.applyDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts new file mode 100644 index 000000000000..f5545dce25cb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ +async function getAccessReviewInstanceContactedReviewers() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts new file mode 100644 index 000000000000..d308e1577a91 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance decisions + * + * @summary Get access review instance decisions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json + */ +async function getAccessReviewInstanceDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceDecisions.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts new file mode 100644 index 000000000000..098083ac906b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get my single access review instance decision. + * + * @summary Get my single access review instance decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ +async function getAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.getById( + scheduleDefinitionId, + id, + decisionId + ); + console.log(result); +} + +getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts new file mode 100644 index 000000000000..b1e50fddef13 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get my access review instance decisions. + * + * @summary Get my access review instance decisions. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ +async function getAccessReviewMyInstanceDecisions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstanceMyDecisions.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts new file mode 100644 index 000000000000..de192912a02f --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewDecisionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Record a decision. + * + * @summary Record a decision. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ +async function patchAccessReviewMyInstanceDecision() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewDecisionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceMyDecisions.patch( + scheduleDefinitionId, + id, + decisionId, + properties + ); + console.log(result); +} + +patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts new file mode 100644 index 000000000000..4e3d76961b8d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to reset all decisions for an access review instance. + * + * @summary An action to reset all decisions for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json + */ +async function accessReviewInstanceResetDecisions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.resetDecisions( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts new file mode 100644 index 000000000000..11ddd932ee2d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to send reminders for an access review instance. + * + * @summary An action to send reminders for an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json + */ +async function accessReviewInstanceSendReminders() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.sendReminders( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts new file mode 100644 index 000000000000..815e5afc5b27 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to An action to stop an access review instance. + * + * @summary An action to stop an access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json + */ +async function accessReviewInstanceStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "d9b9e056-7004-470b-bf21-1635e98487da"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstanceOperations.stop( + scheduleDefinitionId, + id + ); + console.log(result); +} + +accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts new file mode 100644 index 000000000000..471034e44cfd --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get single access review instance assigned for my approval. + * + * @summary Get single access review instance assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ +async function getAccessReviewInstanceAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstancesAssignedForMyApproval.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts new file mode 100644 index 000000000000..c4e9d9a65597 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewInstancesAssignedForMyApprovalListOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ +async function getAccessReviewInstancesAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; + const filter = "assignedToMeToReview()"; + const options: AccessReviewInstancesAssignedForMyApprovalListOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( + scheduleDefinitionId, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts new file mode 100644 index 000000000000..87d00acf9361 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewInstanceProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update access review instance. + * + * @summary Update access review instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json + */ +async function putAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const properties: AccessReviewInstanceProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.create( + scheduleDefinitionId, + id, + properties + ); + console.log(result); +} + +putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts new file mode 100644 index 000000000000..6ccfa758845e --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json + */ +async function getAccessReviewInstance() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const id = "4135f961-be78-4005-8101-c72a5af307a2"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewInstances.getById( + scheduleDefinitionId, + id + ); + console.log(result); +} + +getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts new file mode 100644 index 000000000000..5b8b8fb65158 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances + * + * @summary Get access review instances + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json + */ +async function getAccessReviewInstances() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewInstances.list( + scheduleDefinitionId + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts new file mode 100644 index 000000000000..30af9e3d7312 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instances assigned for my approval. + * + * @summary Get access review instances assigned for my approval. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ +async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const filter = "assignedToMeToReview()"; + const options: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts new file mode 100644 index 000000000000..d6be116ded62 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AccessReviewScheduleDefinitionProperties, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or Update access review schedule definition. + * + * @summary Create or Update access review schedule definition. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json + */ +async function putAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const properties: AccessReviewScheduleDefinitionProperties = {}; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( + scheduleDefinitionId, + properties + ); + console.log(result); +} + +putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts new file mode 100644 index 000000000000..3b8be5f31b06 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete access review schedule definition + * + * @summary Delete access review schedule definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ +async function deleteAccessReview() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.deleteById( + scheduleDefinitionId + ); + console.log(result); +} + +deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts new file mode 100644 index 000000000000..d6fd1ca463af --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get single access review definition + * + * @summary Get single access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json + */ +async function getAccessReviewScheduleDefinition() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.getById( + scheduleDefinitionId + ); + console.log(result); +} + +getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts new file mode 100644 index 000000000000..c65d11e35ed1 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review schedule definitions + * + * @summary Get access review schedule definitions + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json + */ +async function getAccessReviewScheduleDefinitions() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.accessReviewScheduleDefinitions.list()) { + resArray.push(item); + } + console.log(resArray); +} + +getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts new file mode 100644 index 000000000000..a0c6c4c55e32 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop access review definition + * + * @summary Stop access review definition + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json + */ +async function accessReviewScheduleDefinitionStop() { + const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const result = await client.accessReviewScheduleDefinitions.stop( + scheduleDefinitionId + ); + console.log(result); +} + +accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/eligibleChildResourcesGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/eligibleChildResourcesGetSample.ts new file mode 100644 index 000000000000..9417fc31fcce --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/eligibleChildResourcesGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + EligibleChildResourcesGetOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the child resources of a resource on which user has eligible access + * + * @summary Get the child resources of a resource on which user has eligible access + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json + */ +async function getEligibleChildResourcesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "resourceType eq 'resourcegroup'"; + const options: EligibleChildResourcesGetOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.eligibleChildResources.list(scope, options)) { + resArray.push(item); + } + console.log(resArray); +} + +getEligibleChildResourcesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesGetSample.ts new file mode 100644 index 000000000000..99dd6277951d --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified role assignment schedule instance. + * + * @summary Gets the specified role assignment schedule instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json + */ +async function getRoleAssignmentScheduleInstanceByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleInstanceName = + "ed9b8180-cef7-4c77-a63c-b8566ecfc412"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleInstances.get( + scope, + roleAssignmentScheduleInstanceName + ); + console.log(result); +} + +getRoleAssignmentScheduleInstanceByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesListForScopeSample.ts new file mode 100644 index 000000000000..a50294bc1457 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleInstancesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role assignment schedule instances of a role assignment schedule. + * + * @summary Gets role assignment schedule instances of a role assignment schedule. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json + */ +async function getRoleAssignmentScheduleInstancesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleAssignmentScheduleInstancesListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentScheduleInstances.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentScheduleInstancesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCancelSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCancelSample.ts new file mode 100644 index 000000000000..c9b10438e7b5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCancelSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Cancels a pending role assignment schedule request. + * + * @summary Cancels a pending role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json + */ +async function cancelRoleAssignmentScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.cancel( + scope, + roleAssignmentScheduleRequestName + ); + console.log(result); +} + +cancelRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCreateSample.ts new file mode 100644 index 000000000000..c350682177a4 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsCreateSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a role assignment schedule request. + * + * @summary Creates a role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json + */ +async function putRoleAssignmentScheduleRequest() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const parameters: RoleAssignmentScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + linkedRoleEligibilityScheduleId: "b1477448-2cc6-4ceb-93b4-54a202a89413", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "SelfActivate", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "PT8H", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:35:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.create( + scope, + roleAssignmentScheduleRequestName, + parameters + ); + console.log(result); +} + +putRoleAssignmentScheduleRequest().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsGetSample.ts new file mode 100644 index 000000000000..550dbccfc622 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role assignment schedule request. + * + * @summary Get the specified role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json + */ +async function getRoleAssignmentScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.get( + scope, + roleAssignmentScheduleRequestName + ); + console.log(result); +} + +getRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsListForScopeSample.ts new file mode 100644 index 000000000000..98ba5f87ce8a --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleRequestsListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role assignment schedule requests for a scope. + * + * @summary Gets role assignment schedule requests for a scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json + */ +async function getRoleAssignmentScheduleRequestByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')"; + const options: RoleAssignmentScheduleRequestsListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentScheduleRequests.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentScheduleRequestByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsValidateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsValidateSample.ts new file mode 100644 index 000000000000..4f9e836b372c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleRequestsValidateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates a new role assignment schedule request. + * + * @summary Validates a new role assignment schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json + */ +async function validateRoleAssignmentScheduleRequestByName() { + const scope = "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleRequestName = + "fea7a502-9a96-4806-a26f-eee560e52045"; + const parameters: RoleAssignmentScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + linkedRoleEligibilityScheduleId: "b1477448-2cc6-4ceb-93b4-54a202a89413", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "SelfActivate", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "PT8H", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:35:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentScheduleRequests.validate( + scope, + roleAssignmentScheduleRequestName, + parameters + ); + console.log(result); +} + +validateRoleAssignmentScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesGetSample.ts new file mode 100644 index 000000000000..bf11f97c5138 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role assignment schedule for a resource scope + * + * @summary Get the specified role assignment schedule for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json + */ +async function getRoleAssignmentScheduleByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleAssignmentScheduleName = "c9e264ff-3133-4776-a81a-ebc7c33c8ec6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleAssignmentSchedules.get( + scope, + roleAssignmentScheduleName + ); + console.log(result); +} + +getRoleAssignmentScheduleByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesListForScopeSample.ts new file mode 100644 index 000000000000..8304680e7542 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentSchedulesListForScopeSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleAssignmentSchedulesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role assignment schedules for a resource scope. + * + * @summary Gets role assignment schedules for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json + */ +async function getRoleAssignmentSchedulesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleAssignmentSchedulesListForScopeOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleAssignmentSchedules.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleAssignmentSchedulesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesGetSample.ts new file mode 100644 index 000000000000..1f53f2dad995 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified role eligibility schedule instance. + * + * @summary Gets the specified role eligibility schedule instance. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json + */ +async function getRoleEligibilityScheduleInstanceByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleInstanceName = + "21e4b59a-0499-4fe0-a3c3-43a3055b773a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleInstances.get( + scope, + roleEligibilityScheduleInstanceName + ); + console.log(result); +} + +getRoleEligibilityScheduleInstanceByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesListForScopeSample.ts new file mode 100644 index 000000000000..6db59a4e6d99 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleInstancesListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleInstancesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role eligibility schedule instances of a role eligibility schedule. + * + * @summary Gets role eligibility schedule instances of a role eligibility schedule. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json + */ +async function getRoleEligibilityScheduleInstancesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleEligibilityScheduleInstancesListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilityScheduleInstances.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilityScheduleInstancesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCancelSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCancelSample.ts new file mode 100644 index 000000000000..9370eb83416c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCancelSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Cancels a pending role eligibility schedule request. + * + * @summary Cancels a pending role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json + */ +async function cancelRoleEligibilityScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.cancel( + scope, + roleEligibilityScheduleRequestName + ); + console.log(result); +} + +cancelRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCreateSample.ts new file mode 100644 index 000000000000..a46fb4f128de --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsCreateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates a role eligibility schedule request. + * + * @summary Creates a role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json + */ +async function putRoleEligibilityScheduleRequest() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const parameters: RoleEligibilityScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "AdminAssign", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "P365D", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:31:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.create( + scope, + roleEligibilityScheduleRequestName, + parameters + ); + console.log(result); +} + +putRoleEligibilityScheduleRequest().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsGetSample.ts new file mode 100644 index 000000000000..e8c52e4f3116 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role eligibility schedule request. + * + * @summary Get the specified role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json + */ +async function getRoleEligibilityScheduleRequestByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.get( + scope, + roleEligibilityScheduleRequestName + ); + console.log(result); +} + +getRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsListForScopeSample.ts new file mode 100644 index 000000000000..e3057d1809cb --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleRequestsListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role eligibility schedule requests for a scope. + * + * @summary Gets role eligibility schedule requests for a scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json + */ +async function getRoleEligibilityScheduleRequestByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')"; + const options: RoleEligibilityScheduleRequestsListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilityScheduleRequests.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilityScheduleRequestByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsValidateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsValidateSample.ts new file mode 100644 index 000000000000..6eaed28729d8 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilityScheduleRequestsValidateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilityScheduleRequest, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates a new role eligibility schedule request. + * + * @summary Validates a new role eligibility schedule request. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json + */ +async function validateRoleEligibilityScheduleRequestByName() { + const scope = "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleRequestName = + "64caffb6-55c0-4deb-a585-68e948ea1ad6"; + const parameters: RoleEligibilityScheduleRequest = { + condition: + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + conditionVersion: "1.0", + principalId: "a3bb8764-cb92-4276-9d2a-ca1e895e55ea", + requestType: "AdminAssign", + roleDefinitionId: + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608", + scheduleInfo: { + expiration: { + type: "AfterDuration", + duration: "P365D", + endDateTime: undefined + }, + startDateTime: new Date("2020-09-09T21:31:27.91Z") + } + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilityScheduleRequests.validate( + scope, + roleEligibilityScheduleRequestName, + parameters + ); + console.log(result); +} + +validateRoleEligibilityScheduleRequestByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesGetSample.ts new file mode 100644 index 000000000000..a846731cc7ed --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role eligibility schedule for a resource scope + * + * @summary Get the specified role eligibility schedule for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json + */ +async function getRoleEligibilityScheduleByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const roleEligibilityScheduleName = "b1477448-2cc6-4ceb-93b4-54a202a89413"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleEligibilitySchedules.get( + scope, + roleEligibilityScheduleName + ); + console.log(result); +} + +getRoleEligibilityScheduleByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesListForScopeSample.ts new file mode 100644 index 000000000000..6959c6101893 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleEligibilitySchedulesListForScopeSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleEligibilitySchedulesListForScopeOptionalParams, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role eligibility schedules for a resource scope. + * + * @summary Gets role eligibility schedules for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json + */ +async function getRoleEligibilitySchedulesByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; + const filter = "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')"; + const options: RoleEligibilitySchedulesListForScopeOptionalParams = { + filter + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleEligibilitySchedules.listForScope( + scope, + options + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleEligibilitySchedulesByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesDeleteSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesDeleteSample.ts new file mode 100644 index 000000000000..00937797ae58 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a role management policy + * + * @summary Delete a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json + */ +async function deleteRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.delete( + scope, + roleManagementPolicyName + ); + console.log(result); +} + +deleteRoleManagementPolicy().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesGetSample.ts new file mode 100644 index 000000000000..61b7e7b3d9c8 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role management policy for a resource scope + * + * @summary Get the specified role management policy for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json + */ +async function getRoleManagementPolicyByName() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.get( + scope, + roleManagementPolicyName + ); + console.log(result); +} + +getRoleManagementPolicyByName().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesListForScopeSample.ts new file mode 100644 index 000000000000..713c8296ef9b --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesListForScopeSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role management policies for a resource scope. + * + * @summary Gets role management policies for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json + */ +async function getRoleManagementPolicyByRoleDefinitionFilter() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleManagementPolicies.listForScope(scope)) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleManagementPolicyByRoleDefinitionFilter().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesUpdateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesUpdateSample.ts new file mode 100644 index 000000000000..560bab193712 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPoliciesUpdateSample.ts @@ -0,0 +1,391 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleManagementPolicy, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update a role management policy + * + * @summary Update a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json + */ +async function patchPartialRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const parameters: RoleManagementPolicy = { + rules: [ + { + id: "Expiration_Admin_Eligibility", + isExpirationRequired: false, + maximumDuration: "P180D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.update( + scope, + roleManagementPolicyName, + parameters + ); + console.log(result); +} + +patchPartialRoleManagementPolicy().catch(console.error); + +/** + * This sample demonstrates how to Update a role management policy + * + * @summary Update a role management policy + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchRoleManagementPolicy.json + */ +async function patchRoleManagementPolicy() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyName = "570c3619-7688-4b34-b290-2b8bb3ccab2a"; + const parameters: RoleManagementPolicy = { + rules: [ + { + id: "Expiration_Admin_Eligibility", + isExpirationRequired: false, + maximumDuration: "P180D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Requestor_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Approver_Admin_Eligibility", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["approver_admin_eligible@test.com"], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + enabledRules: [], + id: "Enablement_Admin_Eligibility", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Eligibility", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Expiration_Admin_Assignment", + isExpirationRequired: false, + maximumDuration: "P90D", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + enabledRules: ["Justification", "MultiFactorAuthentication"], + id: "Enablement_Admin_Assignment", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_admin_member@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Requestor_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_admin_member@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Approver_Admin_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["approver_admin_member@test.com"], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "Admin", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Expiration_EndUser_Assignment", + isExpirationRequired: true, + maximumDuration: "PT7H", + ruleType: "RoleManagementPolicyExpirationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + enabledRules: [ + "Justification", + "MultiFactorAuthentication", + "Ticketing" + ], + id: "Enablement_EndUser_Assignment", + ruleType: "RoleManagementPolicyEnablementRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Approval_EndUser_Assignment", + ruleType: "RoleManagementPolicyApprovalRule", + setting: { + approvalMode: "SingleStage", + approvalStages: [ + { + approvalStageTimeOutInDays: 1, + escalationApprovers: [], + escalationTimeInMinutes: 0, + isApproverJustificationRequired: true, + isEscalationEnabled: false, + primaryApprovers: [ + { + description: "amansw_new_group", + id: "2385b0f3-5fa9-43cf-8ca4-b01dc97298cd", + isBackup: false, + userType: "Group" + }, + { + description: "amansw_group", + id: "2f4913c9-d15b-406a-9946-1d66a28f2690", + isBackup: false, + userType: "Group" + } + ] + } + ], + isApprovalRequired: true, + isApprovalRequiredForExtension: false, + isRequestorJustificationRequired: true + }, + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + claimValue: "", + id: "AuthenticationContext_EndUser_Assignment", + isEnabled: false, + ruleType: "RoleManagementPolicyAuthenticationContextRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Admin_EndUser_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["admin_enduser_member@test.com"], + notificationType: "Email", + recipientType: "Admin", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Requestor_EndUser_Assignment", + isDefaultRecipientsEnabled: false, + notificationLevel: "Critical", + notificationRecipients: ["requestor_enduser_member@test.com"], + notificationType: "Email", + recipientType: "Requestor", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + }, + { + id: "Notification_Approver_EndUser_Assignment", + isDefaultRecipientsEnabled: true, + notificationLevel: "Critical", + notificationRecipients: [], + notificationType: "Email", + recipientType: "Approver", + ruleType: "RoleManagementPolicyNotificationRule", + target: { + caller: "EndUser", + enforcedSettings: [], + inheritableSettings: [], + level: "Assignment", + targetObjects: [], + operations: ["All"] + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicies.update( + scope, + roleManagementPolicyName, + parameters + ); + console.log(result); +} + +patchRoleManagementPolicy().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsCreateSample.ts new file mode 100644 index 000000000000..0f46b3432fa9 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsCreateSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RoleManagementPolicyAssignment, + AuthorizationManagementClient +} from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a role management policy assignment + * + * @summary Create a role management policy assignment + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json + */ +async function putRoleManagementPolicyAssignment() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const parameters: RoleManagementPolicyAssignment = { + policyId: + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicies/b959d571-f0b5-4042-88a7-01be6cb22db9", + roleDefinitionId: + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleDefinitions/a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + scope: "/subscriptions/129ff972-28f8-46b8-a726-e497be039368" + }; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.create( + scope, + roleManagementPolicyAssignmentName, + parameters + ); + console.log(result); +} + +putRoleManagementPolicyAssignment().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsDeleteSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsDeleteSample.ts new file mode 100644 index 000000000000..a09ef112cce5 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsDeleteSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a role management policy assignment + * + * @summary Delete a role management policy assignment + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json + */ +async function deleteRoleManagementPolicyAssignment() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.delete( + scope, + roleManagementPolicyAssignmentName + ); + console.log(result); +} + +deleteRoleManagementPolicyAssignment().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsGetSample.ts new file mode 100644 index 000000000000..25d9bc663dd0 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsGetSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the specified role management policy assignment for a resource scope + * + * @summary Get the specified role management policy assignment for a resource scope + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json + */ +async function getConfigurations() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const roleManagementPolicyAssignmentName = + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const result = await client.roleManagementPolicyAssignments.get( + scope, + roleManagementPolicyAssignmentName + ); + console.log(result); +} + +getConfigurations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsListForScopeSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsListForScopeSample.ts new file mode 100644 index 000000000000..15cea6984ac1 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsListForScopeSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets role management assignment policies for a resource scope. + * + * @summary Gets role management assignment policies for a resource scope. + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json + */ +async function getRoleManagementPolicyAssignmentByScope() { + const scope = + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential); + const resArray = new Array(); + for await (let item of client.roleManagementPolicyAssignments.listForScope( + scope + )) { + resArray.push(item); + } + console.log(resArray); +} + +getRoleManagementPolicyAssignmentByScope().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts new file mode 100644 index 000000000000..208201a4fc3c --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AuthorizationManagementClient } from "@azure/arm-authorization"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get access review instance contacted reviewers + * + * @summary Get access review instance contacted reviewers + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ +async function tenantLevelGetAccessReviewInstanceContactedReviewers() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; + const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; + const credential = new DefaultAzureCredential(); + const client = new AuthorizationManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( + scheduleDefinitionId, + id + )) { + resArray.push(item); + } + console.log(resArray); +} + +tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/tsconfig.json b/sdk/authorization/arm-authorization/samples/v9/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts index 25957bcb79b0..948e763731e0 100644 --- a/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts +++ b/sdk/authorization/arm-authorization/src/authorizationManagementClient.ts @@ -9,63 +9,45 @@ import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; import { - OperationsImpl, - AccessReviewHistoryDefinitionsImpl, - AccessReviewHistoryDefinitionOperationsImpl, - AccessReviewHistoryDefinitionInstanceImpl, - AccessReviewHistoryDefinitionInstancesImpl, - AccessReviewScheduleDefinitionsImpl, - AccessReviewInstancesImpl, - AccessReviewInstanceOperationsImpl, - AccessReviewInstanceDecisionsImpl, - AccessReviewInstanceContactedReviewersImpl, - AccessReviewDefaultSettingsOperationsImpl, - AccessReviewScheduleDefinitionsAssignedForMyApprovalImpl, - AccessReviewInstancesAssignedForMyApprovalImpl, - AccessReviewInstanceMyDecisionsImpl, - TenantLevelAccessReviewInstanceContactedReviewersImpl + EligibleChildResourcesImpl, + RoleAssignmentSchedulesImpl, + RoleAssignmentScheduleInstancesImpl, + RoleAssignmentScheduleRequestsImpl, + RoleEligibilitySchedulesImpl, + RoleEligibilityScheduleInstancesImpl, + RoleEligibilityScheduleRequestsImpl, + RoleManagementPoliciesImpl, + RoleManagementPolicyAssignmentsImpl } from "./operations"; import { - Operations, - AccessReviewHistoryDefinitions, - AccessReviewHistoryDefinitionOperations, - AccessReviewHistoryDefinitionInstance, - AccessReviewHistoryDefinitionInstances, - AccessReviewScheduleDefinitions, - AccessReviewInstances, - AccessReviewInstanceOperations, - AccessReviewInstanceDecisions, - AccessReviewInstanceContactedReviewers, - AccessReviewDefaultSettingsOperations, - AccessReviewScheduleDefinitionsAssignedForMyApproval, - AccessReviewInstancesAssignedForMyApproval, - AccessReviewInstanceMyDecisions, - TenantLevelAccessReviewInstanceContactedReviewers + EligibleChildResources, + RoleAssignmentSchedules, + RoleAssignmentScheduleInstances, + RoleAssignmentScheduleRequests, + RoleEligibilitySchedules, + RoleEligibilityScheduleInstances, + RoleEligibilityScheduleRequests, + RoleManagementPolicies, + RoleManagementPolicyAssignments } from "./operationsInterfaces"; import { AuthorizationManagementClientOptionalParams } from "./models"; export class AuthorizationManagementClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; /** * Initializes a new instance of the AuthorizationManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, - subscriptionId: string, options?: AuthorizationManagementClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } // Initializing default values for options if (!options) { @@ -76,7 +58,7 @@ export class AuthorizationManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-authorization/9.0.0-beta.2`; + const packageDetails = `azsdk-js-arm-authorization/9.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -95,68 +77,38 @@ export class AuthorizationManagementClient extends coreClient.ServiceClient { options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-16-preview"; - this.operations = new OperationsImpl(this); - this.accessReviewHistoryDefinitions = new AccessReviewHistoryDefinitionsImpl( - this - ); - this.accessReviewHistoryDefinitionOperations = new AccessReviewHistoryDefinitionOperationsImpl( - this - ); - this.accessReviewHistoryDefinitionInstance = new AccessReviewHistoryDefinitionInstanceImpl( - this - ); - this.accessReviewHistoryDefinitionInstances = new AccessReviewHistoryDefinitionInstancesImpl( - this - ); - this.accessReviewScheduleDefinitions = new AccessReviewScheduleDefinitionsImpl( - this - ); - this.accessReviewInstances = new AccessReviewInstancesImpl(this); - this.accessReviewInstanceOperations = new AccessReviewInstanceOperationsImpl( - this - ); - this.accessReviewInstanceDecisions = new AccessReviewInstanceDecisionsImpl( - this - ); - this.accessReviewInstanceContactedReviewers = new AccessReviewInstanceContactedReviewersImpl( - this - ); - this.accessReviewDefaultSettingsOperations = new AccessReviewDefaultSettingsOperationsImpl( + this.apiVersion = options.apiVersion || "2020-10-01"; + this.eligibleChildResources = new EligibleChildResourcesImpl(this); + this.roleAssignmentSchedules = new RoleAssignmentSchedulesImpl(this); + this.roleAssignmentScheduleInstances = new RoleAssignmentScheduleInstancesImpl( this ); - this.accessReviewScheduleDefinitionsAssignedForMyApproval = new AccessReviewScheduleDefinitionsAssignedForMyApprovalImpl( + this.roleAssignmentScheduleRequests = new RoleAssignmentScheduleRequestsImpl( this ); - this.accessReviewInstancesAssignedForMyApproval = new AccessReviewInstancesAssignedForMyApprovalImpl( + this.roleEligibilitySchedules = new RoleEligibilitySchedulesImpl(this); + this.roleEligibilityScheduleInstances = new RoleEligibilityScheduleInstancesImpl( this ); - this.accessReviewInstanceMyDecisions = new AccessReviewInstanceMyDecisionsImpl( + this.roleEligibilityScheduleRequests = new RoleEligibilityScheduleRequestsImpl( this ); - this.tenantLevelAccessReviewInstanceContactedReviewers = new TenantLevelAccessReviewInstanceContactedReviewersImpl( + this.roleManagementPolicies = new RoleManagementPoliciesImpl(this); + this.roleManagementPolicyAssignments = new RoleManagementPolicyAssignmentsImpl( this ); } - operations: Operations; - accessReviewHistoryDefinitions: AccessReviewHistoryDefinitions; - accessReviewHistoryDefinitionOperations: AccessReviewHistoryDefinitionOperations; - accessReviewHistoryDefinitionInstance: AccessReviewHistoryDefinitionInstance; - accessReviewHistoryDefinitionInstances: AccessReviewHistoryDefinitionInstances; - accessReviewScheduleDefinitions: AccessReviewScheduleDefinitions; - accessReviewInstances: AccessReviewInstances; - accessReviewInstanceOperations: AccessReviewInstanceOperations; - accessReviewInstanceDecisions: AccessReviewInstanceDecisions; - accessReviewInstanceContactedReviewers: AccessReviewInstanceContactedReviewers; - accessReviewDefaultSettingsOperations: AccessReviewDefaultSettingsOperations; - accessReviewScheduleDefinitionsAssignedForMyApproval: AccessReviewScheduleDefinitionsAssignedForMyApproval; - accessReviewInstancesAssignedForMyApproval: AccessReviewInstancesAssignedForMyApproval; - accessReviewInstanceMyDecisions: AccessReviewInstanceMyDecisions; - tenantLevelAccessReviewInstanceContactedReviewers: TenantLevelAccessReviewInstanceContactedReviewers; + eligibleChildResources: EligibleChildResources; + roleAssignmentSchedules: RoleAssignmentSchedules; + roleAssignmentScheduleInstances: RoleAssignmentScheduleInstances; + roleAssignmentScheduleRequests: RoleAssignmentScheduleRequests; + roleEligibilitySchedules: RoleEligibilitySchedules; + roleEligibilityScheduleInstances: RoleEligibilityScheduleInstances; + roleEligibilityScheduleRequests: RoleEligibilityScheduleRequests; + roleManagementPolicies: RoleManagementPolicies; + roleManagementPolicyAssignments: RoleManagementPolicyAssignments; } diff --git a/sdk/authorization/arm-authorization/src/models/index.ts b/sdk/authorization/arm-authorization/src/models/index.ts index b97b429ed3d8..45fc6f7ad94a 100644 --- a/sdk/authorization/arm-authorization/src/models/index.ts +++ b/sdk/authorization/arm-authorization/src/models/index.ts @@ -8,1647 +8,1488 @@ import * as coreClient from "@azure/core-client"; -export type AccessReviewDecisionIdentityUnion = - | AccessReviewDecisionIdentity - | AccessReviewDecisionUserIdentity - | AccessReviewDecisionServicePrincipalIdentity; -export type AccessReviewDecisionResourceUnion = - | AccessReviewDecisionResource - | AccessReviewDecisionResourceAzureRole; - -/** The result of a request to list Microsoft.Authorization operations. */ -export interface OperationListResult { - /** The collection value. */ - value?: Operation[]; - /** The URI that can be used to request the next set of paged results. */ +export type RoleManagementPolicyRuleUnion = + | RoleManagementPolicyRule + | RoleManagementPolicyApprovalRule + | RoleManagementPolicyAuthenticationContextRule + | RoleManagementPolicyEnablementRule + | RoleManagementPolicyExpirationRule + | RoleManagementPolicyNotificationRule; + +/** Eligible child resources list operation result. */ +export interface EligibleChildResourcesListResult { + /** Eligible child resource list. */ + value?: EligibleChildResource[]; + /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** The definition of a Microsoft.Authorization operation. */ -export interface Operation { - /** Name of the operation */ - name?: string; - /** Indicates whether the operation is a data action */ - isDataAction?: boolean; - /** Display of the operation */ - display?: OperationDisplay; - /** Origin of the operation */ - origin?: string; -} - -/** The display information for a Microsoft.Authorization operation. */ -export interface OperationDisplay { +/** Eligible child resource */ +export interface EligibleChildResource { /** - * The resource provider name: Microsoft.Authorization. + * The resource scope Id. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; - /** - * The resource on which the operation is performed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; + readonly id?: string; /** - * The operation that users can perform. + * The resource name. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly name?: string; /** - * The description for the operation. + * The resource type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; + readonly type?: string; } -/** Error description and code explaining why an operation failed. */ -export interface ErrorDefinition { - /** Error of the list gateway status. */ - error?: ErrorDefinitionProperties; +/** An error response from the service. */ +export interface CloudError { + /** An error response from the service. */ + error?: CloudErrorBody; } -/** Error description and code explaining why an operation failed. */ -export interface ErrorDefinitionProperties { - /** - * Description of the error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** Error code of list gateway. */ +/** An error response from the service. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; } -/** List of Access Review History Definitions. */ -export interface AccessReviewHistoryDefinitionListResult { - /** Access Review History Definition list. */ - value?: AccessReviewHistoryDefinition[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - -/** Access Review History Definition. */ -export interface AccessReviewHistoryDefinition { +/** Role Assignment schedule */ +export interface RoleAssignmentSchedule { /** - * The access review history definition id. + * The role assignment schedule Id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The access review history definition unique id. + * The role assignment schedule name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The resource type. + * The role assignment schedule type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The display name for the history definition. */ - displayName?: string; - /** - * Date time used when selecting review data, all reviews included in data start on or after this date. For use only with one-time/non-recurring reports. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewHistoryPeriodStartDateTime?: Date; - /** - * Date time used when selecting review data, all reviews included in data end on or before this date. For use only with one-time/non-recurring reports. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewHistoryPeriodEndDateTime?: Date; - /** Collection of review decisions which the history data should be filtered on. For example if Approve and Deny are supplied the data will only contain review results in which the decision maker approved or denied a review request. */ - decisions?: AccessReviewResult[]; - /** - * This read-only field specifies the of the requested review history data. This is either requested, in-progress, done or error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: AccessReviewHistoryDefinitionStatus; - /** - * Date time when history definition was created - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdDateTime?: Date; - /** A collection of scopes used when selecting review history data */ - scopes?: AccessReviewScope[]; - /** Set of access review history instances for this history definition. */ - instances?: AccessReviewHistoryInstance[]; - /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ - typePropertiesSettingsRangeType?: AccessReviewRecurrenceRangeType; - /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ - numberOfOccurrences?: number; - /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ - startDate?: Date; - /** The DateTime when the review is scheduled to end. Required if type is endDate */ - endDate?: Date; - /** The recurrence type : weekly, monthly, etc. */ - typePropertiesSettingsPatternType?: AccessReviewRecurrencePatternType; - /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ - interval?: number; - /** - * The identity id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The identity type : user/servicePrincipal - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalType?: AccessReviewActorIdentityType; - /** - * The identity display name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalName?: string; - /** - * The user principal name(if valid) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userPrincipalName?: string; + /** The role assignment schedule scope. */ + scope?: string; + /** The role definition ID. */ + roleDefinitionId?: string; + /** The principal ID. */ + principalId?: string; + /** The principal type of the assigned principal ID. */ + principalType?: PrincipalType; + /** The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule */ + roleAssignmentScheduleRequestId?: string; + /** The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule */ + linkedRoleEligibilityScheduleId?: string; + /** Assignment type of the role assignment schedule */ + assignmentType?: AssignmentType; + /** Membership type of the role assignment schedule */ + memberType?: MemberType; + /** The status of the role assignment schedule. */ + status?: Status; + /** Start DateTime when role assignment schedule */ + startDateTime?: Date; + /** End DateTime when role assignment schedule */ + endDateTime?: Date; + /** 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' */ + condition?: string; + /** Version of the condition. Currently accepted value is '2.0' */ + conditionVersion?: string; + /** DateTime when role assignment schedule was created */ + createdOn?: Date; + /** DateTime when role assignment schedule was modified */ + updatedOn?: Date; + /** Additional properties of principal, scope and role definition */ + expandedProperties?: ExpandedProperties; } -/** Access Review History Instances. */ -export interface AccessReviewHistoryDefinitionProperties { - /** The display name for the history definition. */ +export interface ExpandedProperties { + /** Details of the resource scope */ + scope?: ExpandedPropertiesScope; + /** Details of role definition */ + roleDefinition?: ExpandedPropertiesRoleDefinition; + /** Details of the principal */ + principal?: ExpandedPropertiesPrincipal; +} + +/** Details of the resource scope */ +export interface ExpandedPropertiesScope { + /** Scope id of the resource */ + id?: string; + /** Display name of the resource */ displayName?: string; - /** - * Date time used when selecting review data, all reviews included in data start on or after this date. For use only with one-time/non-recurring reports. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewHistoryPeriodStartDateTime?: Date; - /** - * Date time used when selecting review data, all reviews included in data end on or before this date. For use only with one-time/non-recurring reports. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewHistoryPeriodEndDateTime?: Date; - /** Collection of review decisions which the history data should be filtered on. For example if Approve and Deny are supplied the data will only contain review results in which the decision maker approved or denied a review request. */ - decisions?: AccessReviewResult[]; - /** - * This read-only field specifies the of the requested review history data. This is either requested, in-progress, done or error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: AccessReviewHistoryDefinitionStatus; - /** - * Date time when history definition was created - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdDateTime?: Date; - /** A collection of scopes used when selecting review history data */ - scopes?: AccessReviewScope[]; - /** Set of access review history instances for this history definition. */ - instances?: AccessReviewHistoryInstance[]; - /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ - typeSettingsRangeType?: AccessReviewRecurrenceRangeType; - /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ - numberOfOccurrences?: number; - /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ - startDate?: Date; - /** The DateTime when the review is scheduled to end. Required if type is endDate */ - endDate?: Date; - /** The recurrence type : weekly, monthly, etc. */ - typeSettingsPatternType?: AccessReviewRecurrencePatternType; - /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ - interval?: number; - /** - * The identity id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The identity type : user/servicePrincipal - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalType?: AccessReviewActorIdentityType; - /** - * The identity display name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalName?: string; - /** - * The user principal name(if valid) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userPrincipalName?: string; + /** Type of the resource */ + type?: string; } -/** Descriptor for what needs to be reviewed */ -export interface AccessReviewScope { - /** - * ResourceId in which this review is getting created - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceId?: string; - /** - * This is used to indicate the role being reviewed - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly roleDefinitionId?: string; - /** - * The identity type user/servicePrincipal to review - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalType?: AccessReviewScopePrincipalType; - /** - * The role assignment state eligible/active to review - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assignmentState?: AccessReviewScopeAssignmentState; - /** Duration users are inactive for. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - inactiveDuration?: string; - /** Flag to indicate whether to expand nested memberships or not. */ - expandNestedMemberships?: boolean; +/** Details of role definition */ +export interface ExpandedPropertiesRoleDefinition { + /** Id of the role definition */ + id?: string; + /** Display name of the role definition */ + displayName?: string; + /** Type of the role definition */ + type?: string; } -/** Access Review History Definition Instance. */ -export interface AccessReviewHistoryInstance { - /** - * The access review history definition instance id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The access review history definition instance unique id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Date time used when selecting review data, all reviews included in data start on or after this date. For use only with one-time/non-recurring reports. */ - reviewHistoryPeriodStartDateTime?: Date; - /** Date time used when selecting review data, all reviews included in data end on or before this date. For use only with one-time/non-recurring reports. */ - reviewHistoryPeriodEndDateTime?: Date; - /** The display name for the parent history definition. */ +/** Details of the principal */ +export interface ExpandedPropertiesPrincipal { + /** Id of the principal */ + id?: string; + /** Display name of the principal */ displayName?: string; - /** - * Status of the requested review history instance data. This is either requested, in-progress, done or error. The state transitions are as follows - Requested -> InProgress -> Done -> Expired - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: AccessReviewHistoryDefinitionStatus; - /** Date time when the history data report is scheduled to be generated. */ - runDateTime?: Date; - /** Date time when the history data report is scheduled to be generated. */ - fulfilledDateTime?: Date; - /** - * Uri which can be used to retrieve review history data. To generate this Uri, generateDownloadUri() must be called for a specific accessReviewHistoryDefinitionInstance. The link expires after a 24 hour period. Callers can see the expiration date time by looking at the 'se' parameter in the generated uri. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly downloadUri?: string; - /** Date time when history data report expires and the associated data is deleted. */ - expiration?: Date; + /** Email id of the principal */ + email?: string; + /** Type of the principal */ + type?: string; } -/** List of Access Review History Instances. */ -export interface AccessReviewHistoryDefinitionInstanceListResult { - /** Access Review History Definition's Instance list. */ - value?: AccessReviewHistoryInstance[]; +/** Role assignment schedule list operation result. */ +export interface RoleAssignmentScheduleListResult { + /** Role assignment schedule list. */ + value?: RoleAssignmentSchedule[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** List of Access Review Schedule Definitions. */ -export interface AccessReviewScheduleDefinitionListResult { - /** Access Review Schedule Definition list. */ - value?: AccessReviewScheduleDefinition[]; +/** Role assignment schedule instance list operation result. */ +export interface RoleAssignmentScheduleInstanceListResult { + /** Role assignment schedule instance list. */ + value?: RoleAssignmentScheduleInstance[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Access Review Schedule Definition. */ -export interface AccessReviewScheduleDefinition { +/** Information about current or upcoming role assignment schedule instance */ +export interface RoleAssignmentScheduleInstance { /** - * The access review schedule definition id. + * The role assignment schedule instance ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The access review schedule definition unique id. + * The role assignment schedule instance name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The resource type. + * The role assignment schedule instance type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** The display name for the schedule definition. */ - displayName?: string; - /** - * This read-only field specifies the status of an accessReview. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: AccessReviewScheduleDefinitionStatus; - /** The description provided by the access review creator and visible to admins. */ - descriptionForAdmins?: string; - /** The description provided by the access review creator to be shown to reviewers. */ - descriptionForReviewers?: string; - /** This is the collection of reviewers. */ - reviewers?: AccessReviewReviewer[]; - /** This is the collection of backup reviewers. */ - backupReviewers?: AccessReviewReviewer[]; - /** - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; - /** This is the collection of instances returned when one does an expand on it. */ - instances?: AccessReviewInstance[]; - /** - * ResourceId in which this review is getting created - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceId?: string; - /** - * This is used to indicate the role being reviewed - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly roleDefinitionId?: string; - /** - * The identity type user/servicePrincipal to review - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalTypePropertiesScopePrincipalType?: AccessReviewScopePrincipalType; - /** - * The role assignment state eligible/active to review - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assignmentState?: AccessReviewScopeAssignmentState; - /** Duration users are inactive for. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - inactiveDuration?: string; - /** Flag to indicate whether to expand nested memberships or not. */ - expandNestedMemberships?: boolean; - /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ - mailNotificationsEnabled?: boolean; - /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ - reminderNotificationsEnabled?: boolean; - /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ - defaultDecisionEnabled?: boolean; - /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ - justificationRequiredOnApproval?: boolean; - /** This specifies the behavior for the autoReview feature when an access review completes. */ - defaultDecision?: DefaultDecisionType; - /** 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. */ - autoApplyDecisionsEnabled?: boolean; - /** Flag to indicate whether showing recommendations to reviewers is enabled. */ - recommendationsEnabled?: boolean; - /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - recommendationLookBackDuration?: string; - /** The duration in days for an instance. */ - instanceDurationInDays?: number; - /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ - typePropertiesSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; - /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ - numberOfOccurrences?: number; - /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ - startDate?: Date; - /** The DateTime when the review is scheduled to end. Required if type is endDate */ - endDate?: Date; - /** The recurrence type : weekly, monthly, etc. */ - typePropertiesSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; - /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ - interval?: number; - /** - * The identity id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The identity type : user/servicePrincipal - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalTypePropertiesCreatedByPrincipalType?: AccessReviewActorIdentityType; - /** - * The identity display name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalName?: string; - /** - * The user principal name(if valid) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userPrincipalName?: string; + /** The role assignment schedule scope. */ + scope?: string; + /** The role definition ID. */ + roleDefinitionId?: string; + /** The principal ID. */ + principalId?: string; + /** The principal type of the assigned principal ID. */ + principalType?: PrincipalType; + /** Id of the master role assignment schedule */ + roleAssignmentScheduleId?: string; + /** Role Assignment Id in external system */ + originRoleAssignmentId?: string; + /** The status of the role assignment schedule instance. */ + status?: Status; + /** The startDateTime of the role assignment schedule instance */ + startDateTime?: Date; + /** The endDateTime of the role assignment schedule instance */ + endDateTime?: Date; + /** roleEligibilityScheduleId used to activate */ + linkedRoleEligibilityScheduleId?: string; + /** roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance */ + linkedRoleEligibilityScheduleInstanceId?: string; + /** Assignment type of the role assignment schedule */ + assignmentType?: AssignmentType; + /** Membership type of the role assignment schedule */ + memberType?: MemberType; + /** 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' */ + condition?: string; + /** Version of the condition. Currently accepted value is '2.0' */ + conditionVersion?: string; + /** DateTime when role assignment schedule was created */ + createdOn?: Date; + /** Additional properties of principal, scope and role definition */ + expandedProperties?: ExpandedProperties; } -/** Access Review. */ -export interface AccessReviewScheduleDefinitionProperties { - /** The display name for the schedule definition. */ - displayName?: string; +/** Role Assignment schedule request */ +export interface RoleAssignmentScheduleRequest { /** - * This read-only field specifies the status of an accessReview. + * The role assignment schedule request ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: AccessReviewScheduleDefinitionStatus; - /** The description provided by the access review creator and visible to admins. */ - descriptionForAdmins?: string; - /** The description provided by the access review creator to be shown to reviewers. */ - descriptionForReviewers?: string; - /** This is the collection of reviewers. */ - reviewers?: AccessReviewReviewer[]; - /** This is the collection of backup reviewers. */ - backupReviewers?: AccessReviewReviewer[]; - /** - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewersType?: AccessReviewScheduleDefinitionReviewersType; - /** This is the collection of instances returned when one does an expand on it. */ - instances?: AccessReviewInstance[]; + readonly id?: string; /** - * ResourceId in which this review is getting created + * The role assignment schedule request name. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceId?: string; + readonly name?: string; /** - * This is used to indicate the role being reviewed + * The role assignment schedule request type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly roleDefinitionId?: string; + readonly type?: string; /** - * The identity type user/servicePrincipal to review + * The role assignment schedule request scope. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalTypeScopePrincipalType?: AccessReviewScopePrincipalType; + readonly scope?: string; + /** The role definition ID. */ + roleDefinitionId?: string; + /** The principal ID. */ + principalId?: string; /** - * The role assignment state eligible/active to review + * The principal type of the assigned principal ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly assignmentState?: AccessReviewScopeAssignmentState; - /** Duration users are inactive for. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - inactiveDuration?: string; - /** Flag to indicate whether to expand nested memberships or not. */ - expandNestedMemberships?: boolean; - /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ - mailNotificationsEnabled?: boolean; - /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ - reminderNotificationsEnabled?: boolean; - /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ - defaultDecisionEnabled?: boolean; - /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ - justificationRequiredOnApproval?: boolean; - /** This specifies the behavior for the autoReview feature when an access review completes. */ - defaultDecision?: DefaultDecisionType; - /** 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. */ - autoApplyDecisionsEnabled?: boolean; - /** Flag to indicate whether showing recommendations to reviewers is enabled. */ - recommendationsEnabled?: boolean; - /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - recommendationLookBackDuration?: string; - /** The duration in days for an instance. */ - instanceDurationInDays?: number; - /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ - typeSettingsRecurrenceRangeType?: AccessReviewRecurrenceRangeType; - /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ - numberOfOccurrences?: number; - /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ - startDate?: Date; - /** The DateTime when the review is scheduled to end. Required if type is endDate */ - endDate?: Date; - /** The recurrence type : weekly, monthly, etc. */ - typeSettingsRecurrencePatternType?: AccessReviewRecurrencePatternType; - /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ - interval?: number; + readonly principalType?: PrincipalType; + /** The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc */ + requestType?: RequestType; /** - * The identity id + * The status of the role assignment schedule request. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalId?: string; + readonly status?: Status; /** - * The identity type : user/servicePrincipal + * The approvalId of the role assignment schedule request. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalTypeCreatedByPrincipalType?: AccessReviewActorIdentityType; + readonly approvalId?: string; + /** The resultant role assignment schedule id or the role assignment schedule id being updated */ + targetRoleAssignmentScheduleId?: string; + /** The role assignment schedule instance id being updated */ + targetRoleAssignmentScheduleInstanceId?: string; + /** Schedule info of the role assignment schedule */ + scheduleInfo?: RoleAssignmentScheduleRequestPropertiesScheduleInfo; + /** The linked role eligibility schedule id - to activate an eligibility. */ + linkedRoleEligibilityScheduleId?: string; + /** Justification for the role assignment */ + justification?: string; + /** Ticket Info of the role assignment */ + ticketInfo?: RoleAssignmentScheduleRequestPropertiesTicketInfo; + /** 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' */ + condition?: string; + /** Version of the condition. Currently accepted value is '2.0' */ + conditionVersion?: string; /** - * The identity display name + * DateTime when role assignment schedule request was created * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalName?: string; + readonly createdOn?: Date; /** - * The user principal name(if valid) + * Id of the user who created this request * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userPrincipalName?: string; -} - -/** Settings of an Access Review. */ -export interface AccessReviewScheduleSettings { - /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ - mailNotificationsEnabled?: boolean; - /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ - reminderNotificationsEnabled?: boolean; - /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ - defaultDecisionEnabled?: boolean; - /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ - justificationRequiredOnApproval?: boolean; - /** This specifies the behavior for the autoReview feature when an access review completes. */ - defaultDecision?: DefaultDecisionType; - /** 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. */ - autoApplyDecisionsEnabled?: boolean; - /** Flag to indicate whether showing recommendations to reviewers is enabled. */ - recommendationsEnabled?: boolean; - /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - recommendationLookBackDuration?: string; - /** The duration in days for an instance. */ - instanceDurationInDays?: number; - /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ - typeRecurrenceRangeType?: AccessReviewRecurrenceRangeType; - /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ - numberOfOccurrences?: number; - /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ - startDate?: Date; - /** The DateTime when the review is scheduled to end. Required if type is endDate */ - endDate?: Date; - /** The recurrence type : weekly, monthly, etc. */ - typeRecurrencePatternType?: AccessReviewRecurrencePatternType; - /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ - interval?: number; -} - -/** Descriptor for what needs to be reviewed */ -export interface AccessReviewReviewer { - /** The id of the reviewer(user/servicePrincipal) */ - principalId?: string; + readonly requestorId?: string; /** - * The identity type : user/servicePrincipal + * Additional properties of principal, scope and role definition * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalType?: AccessReviewReviewerType; + readonly expandedProperties?: ExpandedProperties; +} + +/** Schedule info of the role assignment schedule */ +export interface RoleAssignmentScheduleRequestPropertiesScheduleInfo { + /** Start DateTime of the role assignment schedule. */ + startDateTime?: Date; + /** Expiration of the role assignment schedule */ + expiration?: RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +} + +/** Expiration of the role assignment schedule */ +export interface RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration { + /** Type of the role assignment schedule expiration */ + type?: Type; + /** End DateTime of the role assignment schedule. */ + endDateTime?: Date; + /** Duration of the role assignment schedule in TimeSpan. */ + duration?: string; +} + +/** Ticket Info of the role assignment */ +export interface RoleAssignmentScheduleRequestPropertiesTicketInfo { + /** Ticket number for the role assignment */ + ticketNumber?: string; + /** Ticket system name for the role assignment */ + ticketSystem?: string; +} + +/** Role assignment schedule request list operation result. */ +export interface RoleAssignmentScheduleRequestListResult { + /** Role assignment schedule request list. */ + value?: RoleAssignmentScheduleRequest[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; } -/** Access Review Instance. */ -export interface AccessReviewInstance { +/** Role eligibility schedule */ +export interface RoleEligibilitySchedule { /** - * The access review instance id. + * The role eligibility schedule Id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The access review instance name. + * The role eligibility schedule name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The resource type. + * The role eligibility schedule type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * This read-only field specifies the status of an access review instance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: AccessReviewInstanceStatus; - /** The DateTime when the review instance is scheduled to be start. */ - startDateTime?: Date; - /** The DateTime when the review instance is scheduled to end. */ - endDateTime?: Date; - /** This is the collection of reviewers. */ - reviewers?: AccessReviewReviewer[]; - /** This is the collection of backup reviewers. */ - backupReviewers?: AccessReviewReviewer[]; - /** - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewersType?: AccessReviewInstanceReviewersType; -} - -/** Access Review Instance properties. */ -export interface AccessReviewInstanceProperties { - /** - * This read-only field specifies the status of an access review instance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: AccessReviewInstanceStatus; - /** The DateTime when the review instance is scheduled to be start. */ + /** The role eligibility schedule scope. */ + scope?: string; + /** The role definition ID. */ + roleDefinitionId?: string; + /** The principal ID. */ + principalId?: string; + /** The principal type of the assigned principal ID. */ + principalType?: PrincipalType; + /** The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule */ + roleEligibilityScheduleRequestId?: string; + /** Membership type of the role eligibility schedule */ + memberType?: MemberType; + /** The status of the role eligibility schedule. */ + status?: Status; + /** Start DateTime when role eligibility schedule */ startDateTime?: Date; - /** The DateTime when the review instance is scheduled to end. */ + /** End DateTime when role eligibility schedule */ endDateTime?: Date; - /** This is the collection of reviewers. */ - reviewers?: AccessReviewReviewer[]; - /** This is the collection of backup reviewers. */ - backupReviewers?: AccessReviewReviewer[]; - /** - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewersType?: AccessReviewInstanceReviewersType; + /** 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' */ + condition?: string; + /** Version of the condition. Currently accepted value is '2.0' */ + conditionVersion?: string; + /** DateTime when role eligibility schedule was created */ + createdOn?: Date; + /** DateTime when role eligibility schedule was modified */ + updatedOn?: Date; + /** Additional properties of principal, scope and role definition */ + expandedProperties?: ExpandedProperties; } -/** List of Access Review Instances. */ -export interface AccessReviewInstanceListResult { - /** Access Review Instance list. */ - value?: AccessReviewInstance[]; +/** role eligibility schedule list operation result. */ +export interface RoleEligibilityScheduleListResult { + /** role eligibility schedule list. */ + value?: RoleEligibilitySchedule[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** List of access review decisions. */ -export interface AccessReviewDecisionListResult { - /** Access Review Decision list. */ - value?: AccessReviewDecision[]; +/** Role eligibility schedule instance list operation result. */ +export interface RoleEligibilityScheduleInstanceListResult { + /** Role eligibility schedule instance list. */ + value?: RoleEligibilityScheduleInstance[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Access Review. */ -export interface AccessReviewDecision { +/** Information about current or upcoming role eligibility schedule instance */ +export interface RoleEligibilityScheduleInstance { /** - * The access review decision id. + * The role eligibility schedule instance ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The access review decision name. + * The role eligibility schedule instance name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The resource type. + * The role eligibility schedule instance type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** The role eligibility schedule scope. */ + scope?: string; + /** The role definition ID. */ + roleDefinitionId?: string; + /** The principal ID. */ + principalId?: string; + /** The principal type of the assigned principal ID. */ + principalType?: PrincipalType; + /** Id of the master role eligibility schedule */ + roleEligibilityScheduleId?: string; + /** The status of the role eligibility schedule instance */ + status?: Status; + /** The startDateTime of the role eligibility schedule instance */ + startDateTime?: Date; + /** The endDateTime of the role eligibility schedule instance */ + endDateTime?: Date; + /** Membership type of the role eligibility schedule */ + memberType?: MemberType; + /** 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' */ + condition?: string; + /** Version of the condition. Currently accepted value is '2.0' */ + conditionVersion?: string; + /** DateTime when role eligibility schedule was created */ + createdOn?: Date; + /** Additional properties of principal, scope and role definition */ + expandedProperties?: ExpandedProperties; +} + +/** Role Eligibility schedule request */ +export interface RoleEligibilityScheduleRequest { /** - * The feature- generated recommendation shown to the reviewer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly recommendation?: AccessRecommendationType; - /** The decision on the approval step. This value is initially set to NotReviewed. Approvers can take action of Approve/Deny */ - decision?: AccessReviewResult; - /** Justification provided by approvers for their action */ - justification?: string; - /** - * Date Time when a decision was taken. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewedDateTime?: Date; - /** - * The outcome of applying the decision. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly applyResult?: AccessReviewApplyResult; - /** - * The date and time when the review decision was applied. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly appliedDateTime?: Date; - /** - * The identity id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalIdPropertiesAppliedByPrincipalId?: string; - /** - * The identity type : user/servicePrincipal - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalTypePropertiesAppliedByPrincipalType?: AccessReviewActorIdentityType; - /** - * The identity display name + * The role eligibility schedule request ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalNamePropertiesAppliedByPrincipalName?: string; + readonly id?: string; /** - * The user principal name(if valid) + * The role eligibility schedule request name. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userPrincipalNamePropertiesAppliedByUserPrincipalName?: string; + readonly name?: string; /** - * The identity id + * The role eligibility schedule request type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalIdPropertiesReviewedByPrincipalId?: string; + readonly type?: string; /** - * The identity type : user/servicePrincipal + * The role eligibility schedule request scope. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalTypePropertiesReviewedByPrincipalType?: AccessReviewActorIdentityType; + readonly scope?: string; + /** The role definition ID. */ + roleDefinitionId?: string; + /** The principal ID. */ + principalId?: string; /** - * The identity display name + * The principal type of the assigned principal ID. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalNamePropertiesReviewedByPrincipalName?: string; + readonly principalType?: PrincipalType; + /** The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc */ + requestType?: RequestType; /** - * The user principal name(if valid) + * The status of the role eligibility schedule request. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userPrincipalNamePropertiesReviewedByUserPrincipalName?: string; - /** The type of resource: azureRole */ - typePropertiesResourceType?: DecisionResourceType; + readonly status?: Status; /** - * The id of resource associated with a decision record. + * The approvalId of the role eligibility schedule request. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly idPropertiesResourceId?: string; + readonly approvalId?: string; + /** Schedule info of the role eligibility schedule */ + scheduleInfo?: RoleEligibilityScheduleRequestPropertiesScheduleInfo; + /** The resultant role eligibility schedule id or the role eligibility schedule id being updated */ + targetRoleEligibilityScheduleId?: string; + /** The role eligibility schedule instance id being updated */ + targetRoleEligibilityScheduleInstanceId?: string; + /** Justification for the role eligibility */ + justification?: string; + /** Ticket Info of the role eligibility */ + ticketInfo?: RoleEligibilityScheduleRequestPropertiesTicketInfo; + /** 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' */ + condition?: string; + /** Version of the condition. Currently accepted value is '2.0' */ + conditionVersion?: string; /** - * The display name of resource associated with a decision record. + * DateTime when role eligibility schedule request was created * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayNamePropertiesResourceDisplayName?: string; - /** The type of decision target : User/ServicePrincipal */ - typePropertiesPrincipalType?: DecisionTargetType; + readonly createdOn?: Date; /** - * The id of principal whose access was reviewed. + * Id of the user who created this request * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly idPropertiesPrincipalId?: string; + readonly requestorId?: string; /** - * The display name of the user whose access was reviewed. + * Additional properties of principal, scope and role definition * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayNamePropertiesPrincipalDisplayName?: string; + readonly expandedProperties?: ExpandedProperties; } -/** Approval Step. */ -export interface AccessReviewDecisionProperties { - /** - * The feature- generated recommendation shown to the reviewer. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly recommendation?: AccessRecommendationType; - /** The decision on the approval step. This value is initially set to NotReviewed. Approvers can take action of Approve/Deny */ - decision?: AccessReviewResult; - /** Justification provided by approvers for their action */ - justification?: string; - /** - * Date Time when a decision was taken. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reviewedDateTime?: Date; - /** - * The outcome of applying the decision. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly applyResult?: AccessReviewApplyResult; - /** - * The date and time when the review decision was applied. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly appliedDateTime?: Date; - /** - * The identity id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalIdAppliedByPrincipalId?: string; - /** - * The identity type : user/servicePrincipal - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalTypeAppliedByPrincipalType?: AccessReviewActorIdentityType; - /** - * The identity display name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalNameAppliedByPrincipalName?: string; - /** - * The user principal name(if valid) - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userPrincipalNameAppliedByUserPrincipalName?: string; - /** - * The identity id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalIdReviewedByPrincipalId?: string; +/** Schedule info of the role eligibility schedule */ +export interface RoleEligibilityScheduleRequestPropertiesScheduleInfo { + /** Start DateTime of the role eligibility schedule. */ + startDateTime?: Date; + /** Expiration of the role eligibility schedule */ + expiration?: RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +} + +/** Expiration of the role eligibility schedule */ +export interface RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration { + /** Type of the role eligibility schedule expiration */ + type?: Type; + /** End DateTime of the role eligibility schedule. */ + endDateTime?: Date; + /** Duration of the role eligibility schedule in TimeSpan. */ + duration?: string; +} + +/** Ticket Info of the role eligibility */ +export interface RoleEligibilityScheduleRequestPropertiesTicketInfo { + /** Ticket number for the role eligibility */ + ticketNumber?: string; + /** Ticket system name for the role eligibility */ + ticketSystem?: string; +} + +/** Role eligibility schedule request list operation result. */ +export interface RoleEligibilityScheduleRequestListResult { + /** Role eligibility schedule request list. */ + value?: RoleEligibilityScheduleRequest[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + +/** Role management policy */ +export interface RoleManagementPolicy { /** - * The identity type : user/servicePrincipal + * The role management policy Id. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalTypeReviewedByPrincipalType?: AccessReviewActorIdentityType; + readonly id?: string; /** - * The identity display name + * The role management policy name. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalNameReviewedByPrincipalName?: string; + readonly name?: string; /** - * The user principal name(if valid) + * The role management policy type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userPrincipalNameReviewedByUserPrincipalName?: string; - /** The type of resource: azureRole */ - typeResourceType?: DecisionResourceType; + readonly type?: string; + /** The role management policy scope. */ + scope?: string; + /** The role management policy display name. */ + displayName?: string; + /** The role management policy description. */ + description?: string; + /** The role management policy is default policy. */ + isOrganizationDefault?: boolean; /** - * The id of resource associated with a decision record. + * The name of the entity last modified it * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly idResourceId?: string; + readonly lastModifiedBy?: Principal; /** - * The display name of resource associated with a decision record. + * The last modified date time. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayNameResourceDisplayName?: string; - /** The type of decision target : User/ServicePrincipal */ - typePrincipalType?: DecisionTargetType; + readonly lastModifiedDateTime?: Date; + /** The rule applied to the policy. */ + rules?: RoleManagementPolicyRuleUnion[]; /** - * The id of principal whose access was reviewed. + * The readonly computed rule applied to the policy. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly idPrincipalId?: string; + readonly effectiveRules?: RoleManagementPolicyRuleUnion[]; /** - * The display name of the user whose access was reviewed. + * Additional properties of scope * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayNamePrincipalDisplayName?: string; + readonly policyProperties?: PolicyProperties; } -/** Target of the decision. */ -export interface AccessReviewDecisionIdentity { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "user" | "servicePrincipal"; - /** - * The id of principal whose access was reviewed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The display name of the user whose access was reviewed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly displayName?: string; +/** The name of the entity last modified it */ +export interface Principal { + /** The id of the principal made changes */ + id?: string; + /** The name of the principal made changes */ + displayName?: string; + /** Type of principal such as user , group etc */ + type?: string; + /** Email of principal */ + email?: string; } -/** Target of the decision. */ -export interface AccessReviewDecisionResource { +/** The role management policy rule. */ +export interface RoleManagementPolicyRule { /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "azureRole"; - /** - * The id of resource associated with a decision record. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; + ruleType: + | "RoleManagementPolicyApprovalRule" + | "RoleManagementPolicyAuthenticationContextRule" + | "RoleManagementPolicyEnablementRule" + | "RoleManagementPolicyExpirationRule" + | "RoleManagementPolicyNotificationRule"; + /** The id of the rule. */ + id?: string; + /** The target of the current rule. */ + target?: RoleManagementPolicyRuleTarget; +} + +/** The role management policy rule target. */ +export interface RoleManagementPolicyRuleTarget { + /** The caller of the setting. */ + caller?: string; + /** The type of operation. */ + operations?: string[]; + /** The assignment level to which rule is applied. */ + level?: string; + /** The list of target objects. */ + targetObjects?: string[]; + /** The list of inheritable settings. */ + inheritableSettings?: string[]; + /** The list of enforced settings. */ + enforcedSettings?: string[]; +} + +/** Expanded info of resource scope */ +export interface PolicyProperties { /** - * The display name of resource associated with a decision record. + * Details of the resource scope * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayName?: string; + readonly scope?: PolicyPropertiesScope; +} + +/** Details of the resource scope */ +export interface PolicyPropertiesScope { + /** Scope id of the resource */ + id?: string; + /** Display name of the resource */ + displayName?: string; + /** Type of the resource */ + type?: string; } -/** List of access review contacted reviewers. */ -export interface AccessReviewContactedReviewerListResult { - /** Access Review Contacted Reviewer. */ - value?: AccessReviewContactedReviewer[]; +/** Role management policy list operation result. */ +export interface RoleManagementPolicyListResult { + /** Role management policy list. */ + value?: RoleManagementPolicy[]; /** The URL to use for getting the next set of results. */ nextLink?: string; } -/** Access Review Contacted Reviewer. */ -export interface AccessReviewContactedReviewer { +/** Role management policy */ +export interface RoleManagementPolicyAssignment { /** - * The access review reviewer id. + * The role management policy Id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The access review reviewer id. + * The role management policy name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The resource type. + * The role management policy type. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** The role management policy scope. */ + scope?: string; + /** The role definition of management policy assignment. */ + roleDefinitionId?: string; + /** The policy id role management policy assignment. */ + policyId?: string; /** - * The display name of the reviewer - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userDisplayName?: string; - /** - * The user principal name of the reviewer + * The readonly computed rule applied to the policy. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userPrincipalName?: string; + readonly effectiveRules?: RoleManagementPolicyRuleUnion[]; /** - * Date Time when the reviewer was contacted. + * Additional properties of scope, role definition and policy * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdDateTime?: Date; + readonly policyAssignmentProperties?: PolicyAssignmentProperties; } -/** Access Review Default Settings. */ -export interface AccessReviewDefaultSettings { - /** - * The access review default settings id. This is only going to be default - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The access review default settings name. This is always going to be Access Review Default Settings - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Flag to indicate whether sending mails to reviewers and the review creator is enabled. */ - mailNotificationsEnabled?: boolean; - /** Flag to indicate whether sending reminder emails to reviewers are enabled. */ - reminderNotificationsEnabled?: boolean; - /** Flag to indicate whether reviewers are required to provide a justification when reviewing access. */ - defaultDecisionEnabled?: boolean; - /** Flag to indicate whether the reviewer is required to pass justification when recording a decision. */ - justificationRequiredOnApproval?: boolean; - /** This specifies the behavior for the autoReview feature when an access review completes. */ - defaultDecision?: DefaultDecisionType; - /** 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. */ - autoApplyDecisionsEnabled?: boolean; - /** Flag to indicate whether showing recommendations to reviewers is enabled. */ - recommendationsEnabled?: boolean; - /** Recommendations for access reviews are calculated by looking back at 30 days of data(w.r.t the start date of the review) by default. However, in some scenarios, customers want to change how far back to look at and want to configure 60 days, 90 days, etc. instead. This setting allows customers to configure this duration. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) */ - recommendationLookBackDuration?: string; - /** The duration in days for an instance. */ - instanceDurationInDays?: number; - /** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ - typePropertiesRecurrenceRangeType?: AccessReviewRecurrenceRangeType; - /** The number of times to repeat the access review. Required and must be positive if type is numbered. */ - numberOfOccurrences?: number; - /** The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. */ - startDate?: Date; - /** The DateTime when the review is scheduled to end. Required if type is endDate */ - endDate?: Date; - /** The recurrence type : weekly, monthly, etc. */ - typePropertiesRecurrencePatternType?: AccessReviewRecurrencePatternType; - /** The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. */ - interval?: number; -} - -/** User Decision Target */ -export type AccessReviewDecisionUserIdentity = AccessReviewDecisionIdentity & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "user"; - /** - * The user principal name of the user whose access was reviewed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userPrincipalName?: string; -}; +/** Expanded info of resource scope, role definition and policy */ +export interface PolicyAssignmentProperties { + /** Details of the resource scope */ + scope?: PolicyAssignmentPropertiesScope; + /** Details of role definition */ + roleDefinition?: PolicyAssignmentPropertiesRoleDefinition; + /** Details of the policy */ + policy?: PolicyAssignmentPropertiesPolicy; +} -/** Service Principal Decision Target */ -export type AccessReviewDecisionServicePrincipalIdentity = AccessReviewDecisionIdentity & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "servicePrincipal"; +/** Details of the resource scope */ +export interface PolicyAssignmentPropertiesScope { + /** Scope id of the resource */ + id?: string; + /** Display name of the resource */ + displayName?: string; + /** Type of the resource */ + type?: string; +} + +/** Details of role definition */ +export interface PolicyAssignmentPropertiesRoleDefinition { + /** Id of the role definition */ + id?: string; + /** Display name of the role definition */ + displayName?: string; + /** Type of the role definition */ + type?: string; +} + +/** Details of the policy */ +export interface PolicyAssignmentPropertiesPolicy { + /** Id of the policy */ + id?: string; /** - * The appId for the service principal entity being reviewed + * The name of the entity last modified it * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly appId?: string; -}; + readonly lastModifiedBy?: Principal; + /** The last modified date time. */ + lastModifiedDateTime?: Date; +} -/** Target of the decision. */ -export type AccessReviewDecisionResourceAzureRole = AccessReviewDecisionResource & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "azureRole"; -}; +/** Role management policy assignment list operation result. */ +export interface RoleManagementPolicyAssignmentListResult { + /** Role management policy assignment list. */ + value?: RoleManagementPolicyAssignment[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} -/** Known values of {@link AccessReviewResult} that the service accepts. */ -export enum KnownAccessReviewResult { - Approve = "Approve", - Deny = "Deny", - NotReviewed = "NotReviewed", - DontKnow = "DontKnow", - NotNotified = "NotNotified" +/** Role definition permissions. */ +export interface Permission { + /** Allowed actions. */ + actions?: string[]; + /** Denied actions. */ + notActions?: string[]; + /** Allowed Data actions. */ + dataActions?: string[]; + /** Denied Data actions. */ + notDataActions?: string[]; } -/** - * Defines values for AccessReviewResult. \ - * {@link KnownAccessReviewResult} can be used interchangeably with AccessReviewResult, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Approve** \ - * **Deny** \ - * **NotReviewed** \ - * **DontKnow** \ - * **NotNotified** - */ -export type AccessReviewResult = string; +/** The approval settings. */ +export interface ApprovalSettings { + /** Determines whether approval is required or not. */ + isApprovalRequired?: boolean; + /** Determines whether approval is required for assignment extension. */ + isApprovalRequiredForExtension?: boolean; + /** Determine whether requestor justification is required. */ + isRequestorJustificationRequired?: boolean; + /** The type of rule */ + approvalMode?: ApprovalMode; + /** The approval stages of the request. */ + approvalStages?: ApprovalStage[]; +} -/** Known values of {@link AccessReviewHistoryDefinitionStatus} that the service accepts. */ -export enum KnownAccessReviewHistoryDefinitionStatus { - Requested = "Requested", - InProgress = "InProgress", - Done = "Done", - Error = "Error" +/** The approval stage. */ +export interface ApprovalStage { + /** The time in days when approval request would be timed out */ + approvalStageTimeOutInDays?: number; + /** Determines whether approver need to provide justification for his decision. */ + isApproverJustificationRequired?: boolean; + /** The time in minutes when the approval request would be escalated if the primary approver does not approve */ + escalationTimeInMinutes?: number; + /** The primary approver of the request. */ + primaryApprovers?: UserSet[]; + /** The value determine whether escalation feature is enabled. */ + isEscalationEnabled?: boolean; + /** The escalation approver of the request. */ + escalationApprovers?: UserSet[]; } -/** - * Defines values for AccessReviewHistoryDefinitionStatus. \ - * {@link KnownAccessReviewHistoryDefinitionStatus} can be used interchangeably with AccessReviewHistoryDefinitionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Requested** \ - * **InProgress** \ - * **Done** \ - * **Error** - */ -export type AccessReviewHistoryDefinitionStatus = string; +/** The detail of a user. */ +export interface UserSet { + /** The type of user. */ + userType?: UserType; + /** The value indicating whether the user is a backup fallback approver */ + isBackup?: boolean; + /** The object id of the user. */ + id?: string; + /** The description of the user. */ + description?: string; +} -/** Known values of {@link AccessReviewActorIdentityType} that the service accepts. */ -export enum KnownAccessReviewActorIdentityType { - User = "user", - ServicePrincipal = "servicePrincipal" +/** Role assignment schedule filter */ +export interface RoleAssignmentScheduleFilter { + /** Returns role assignment schedule of the specific principal. */ + principalId?: string; + /** Returns role assignment schedule of the specific role definition. */ + roleDefinitionId?: string; + /** Returns role assignment schedule instances of the specific status. */ + status?: string; } -/** - * Defines values for AccessReviewActorIdentityType. \ - * {@link KnownAccessReviewActorIdentityType} can be used interchangeably with AccessReviewActorIdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **servicePrincipal** - */ -export type AccessReviewActorIdentityType = string; +/** Role assignment schedule instance filter */ +export interface RoleAssignmentScheduleInstanceFilter { + /** Returns role assignment schedule instances of the specific principal. */ + principalId?: string; + /** Returns role assignment schedule instances of the specific role definition. */ + roleDefinitionId?: string; + /** Returns role assignment schedule instances of the specific status. */ + status?: string; + /** Returns role assignment schedule instances belonging to a specific role assignment schedule. */ + roleAssignmentScheduleId?: string; +} -/** Known values of {@link AccessReviewScopePrincipalType} that the service accepts. */ -export enum KnownAccessReviewScopePrincipalType { - User = "user", - GuestUser = "guestUser", - ServicePrincipal = "servicePrincipal", - UserGroup = "user,group", - RedeemedGuestUser = "redeemedGuestUser" +/** Role assignment schedule request filter */ +export interface RoleAssignmentScheduleRequestFilter { + /** Returns role assignment requests of the specific principal. */ + principalId?: string; + /** Returns role assignment requests of the specific role definition. */ + roleDefinitionId?: string; + /** Returns role assignment requests created by specific principal. */ + requestorId?: string; + /** Returns role assignment requests of specific status. */ + status?: string; } -/** - * Defines values for AccessReviewScopePrincipalType. \ - * {@link KnownAccessReviewScopePrincipalType} can be used interchangeably with AccessReviewScopePrincipalType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **guestUser** \ - * **servicePrincipal** \ - * **user,group** \ - * **redeemedGuestUser** - */ -export type AccessReviewScopePrincipalType = string; +/** Role eligibility schedule filter */ +export interface RoleEligibilityScheduleFilter { + /** Returns role eligibility schedule of the specific principal. */ + principalId?: string; + /** Returns role eligibility schedule of the specific role definition. */ + roleDefinitionId?: string; + /** Returns role eligibility schedule of the specific status. */ + status?: string; +} + +/** Role eligibility schedule instance filter */ +export interface RoleEligibilityScheduleInstanceFilter { + /** Returns role eligibility schedule instances of the specific principal. */ + principalId?: string; + /** Returns role eligibility schedule instances of the specific role definition. */ + roleDefinitionId?: string; + /** Returns role eligibility schedule instances of the specific status. */ + status?: string; + /** Returns role eligibility schedule instances belonging to a specific role eligibility schedule. */ + roleEligibilityScheduleId?: string; +} + +/** Role eligibility schedule request filter */ +export interface RoleEligibilityScheduleRequestFilter { + /** Returns role eligibility requests of the specific principal. */ + principalId?: string; + /** Returns role eligibility requests of the specific role definition. */ + roleDefinitionId?: string; + /** Returns role eligibility requests created by specific principal. */ + requestorId?: string; + /** Returns role eligibility requests of specific status. */ + status?: string; +} + +/** The role management policy approval rule. */ +export type RoleManagementPolicyApprovalRule = RoleManagementPolicyRule & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + ruleType: "RoleManagementPolicyApprovalRule"; + /** The approval setting */ + setting?: ApprovalSettings; +}; + +/** The role management policy authentication context rule. */ +export type RoleManagementPolicyAuthenticationContextRule = RoleManagementPolicyRule & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + ruleType: "RoleManagementPolicyAuthenticationContextRule"; + /** The value indicating if rule is enabled. */ + isEnabled?: boolean; + /** The claim value. */ + claimValue?: string; +}; + +/** The role management policy enablement rule. */ +export type RoleManagementPolicyEnablementRule = RoleManagementPolicyRule & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + ruleType: "RoleManagementPolicyEnablementRule"; + /** The list of enabled rules. */ + enabledRules?: EnablementRules[]; +}; + +/** The role management policy expiration rule. */ +export type RoleManagementPolicyExpirationRule = RoleManagementPolicyRule & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + ruleType: "RoleManagementPolicyExpirationRule"; + /** The value indicating whether expiration is required. */ + isExpirationRequired?: boolean; + /** The maximum duration of expiration in timespan. */ + maximumDuration?: string; +}; -/** Known values of {@link AccessReviewScopeAssignmentState} that the service accepts. */ -export enum KnownAccessReviewScopeAssignmentState { - Eligible = "eligible", - Active = "active" +/** The role management policy notification rule. */ +export type RoleManagementPolicyNotificationRule = RoleManagementPolicyRule & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + ruleType: "RoleManagementPolicyNotificationRule"; + /** The type of notification. */ + notificationType?: NotificationDeliveryMechanism; + /** The notification level. */ + notificationLevel?: NotificationLevel; + /** The recipient type. */ + recipientType?: RecipientType; + /** The list of notification recipients. */ + notificationRecipients?: string[]; + /** Determines if the notification will be sent to the recipient type specified in the policy rule. */ + isDefaultRecipientsEnabled?: boolean; +}; + +/** Known values of {@link PrincipalType} that the service accepts. */ +export enum KnownPrincipalType { + User = "User", + Group = "Group", + ServicePrincipal = "ServicePrincipal", + ForeignGroup = "ForeignGroup", + Device = "Device" } /** - * Defines values for AccessReviewScopeAssignmentState. \ - * {@link KnownAccessReviewScopeAssignmentState} can be used interchangeably with AccessReviewScopeAssignmentState, + * Defines values for PrincipalType. \ + * {@link KnownPrincipalType} can be used interchangeably with PrincipalType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **eligible** \ - * **active** + * **User** \ + * **Group** \ + * **ServicePrincipal** \ + * **ForeignGroup** \ + * **Device** */ -export type AccessReviewScopeAssignmentState = string; +export type PrincipalType = string; -/** Known values of {@link AccessReviewRecurrencePatternType} that the service accepts. */ -export enum KnownAccessReviewRecurrencePatternType { - Weekly = "weekly", - AbsoluteMonthly = "absoluteMonthly" +/** Known values of {@link AssignmentType} that the service accepts. */ +export enum KnownAssignmentType { + Activated = "Activated", + Assigned = "Assigned" } /** - * Defines values for AccessReviewRecurrencePatternType. \ - * {@link KnownAccessReviewRecurrencePatternType} can be used interchangeably with AccessReviewRecurrencePatternType, + * Defines values for AssignmentType. \ + * {@link KnownAssignmentType} can be used interchangeably with AssignmentType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **weekly** \ - * **absoluteMonthly** + * **Activated** \ + * **Assigned** */ -export type AccessReviewRecurrencePatternType = string; +export type AssignmentType = string; -/** Known values of {@link AccessReviewRecurrenceRangeType} that the service accepts. */ -export enum KnownAccessReviewRecurrenceRangeType { - EndDate = "endDate", - NoEnd = "noEnd", - Numbered = "numbered" +/** Known values of {@link MemberType} that the service accepts. */ +export enum KnownMemberType { + Inherited = "Inherited", + Direct = "Direct", + Group = "Group" } /** - * Defines values for AccessReviewRecurrenceRangeType. \ - * {@link KnownAccessReviewRecurrenceRangeType} can be used interchangeably with AccessReviewRecurrenceRangeType, + * Defines values for MemberType. \ + * {@link KnownMemberType} can be used interchangeably with MemberType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **endDate** \ - * **noEnd** \ - * **numbered** + * **Inherited** \ + * **Direct** \ + * **Group** */ -export type AccessReviewRecurrenceRangeType = string; - -/** Known values of {@link AccessReviewScheduleDefinitionStatus} that the service accepts. */ -export enum KnownAccessReviewScheduleDefinitionStatus { - NotStarted = "NotStarted", - InProgress = "InProgress", - Completed = "Completed", - Applied = "Applied", - Initializing = "Initializing", - Applying = "Applying", - Completing = "Completing", - Scheduled = "Scheduled", - AutoReviewing = "AutoReviewing", - AutoReviewed = "AutoReviewed", - Starting = "Starting" +export type MemberType = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + Accepted = "Accepted", + PendingEvaluation = "PendingEvaluation", + Granted = "Granted", + Denied = "Denied", + PendingProvisioning = "PendingProvisioning", + Provisioned = "Provisioned", + PendingRevocation = "PendingRevocation", + Revoked = "Revoked", + Canceled = "Canceled", + Failed = "Failed", + PendingApprovalProvisioning = "PendingApprovalProvisioning", + PendingApproval = "PendingApproval", + FailedAsResourceIsLocked = "FailedAsResourceIsLocked", + PendingAdminDecision = "PendingAdminDecision", + AdminApproved = "AdminApproved", + AdminDenied = "AdminDenied", + TimedOut = "TimedOut", + ProvisioningStarted = "ProvisioningStarted", + Invalid = "Invalid", + PendingScheduleCreation = "PendingScheduleCreation", + ScheduleCreated = "ScheduleCreated", + PendingExternalProvisioning = "PendingExternalProvisioning" } /** - * Defines values for AccessReviewScheduleDefinitionStatus. \ - * {@link KnownAccessReviewScheduleDefinitionStatus} can be used interchangeably with AccessReviewScheduleDefinitionStatus, + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **NotStarted** \ - * **InProgress** \ - * **Completed** \ - * **Applied** \ - * **Initializing** \ - * **Applying** \ - * **Completing** \ - * **Scheduled** \ - * **AutoReviewing** \ - * **AutoReviewed** \ - * **Starting** + * **Accepted** \ + * **PendingEvaluation** \ + * **Granted** \ + * **Denied** \ + * **PendingProvisioning** \ + * **Provisioned** \ + * **PendingRevocation** \ + * **Revoked** \ + * **Canceled** \ + * **Failed** \ + * **PendingApprovalProvisioning** \ + * **PendingApproval** \ + * **FailedAsResourceIsLocked** \ + * **PendingAdminDecision** \ + * **AdminApproved** \ + * **AdminDenied** \ + * **TimedOut** \ + * **ProvisioningStarted** \ + * **Invalid** \ + * **PendingScheduleCreation** \ + * **ScheduleCreated** \ + * **PendingExternalProvisioning** */ -export type AccessReviewScheduleDefinitionStatus = string; - -/** Known values of {@link DefaultDecisionType} that the service accepts. */ -export enum KnownDefaultDecisionType { - Approve = "Approve", - Deny = "Deny", - Recommendation = "Recommendation" +export type Status = string; + +/** Known values of {@link RequestType} that the service accepts. */ +export enum KnownRequestType { + AdminAssign = "AdminAssign", + AdminRemove = "AdminRemove", + AdminUpdate = "AdminUpdate", + AdminExtend = "AdminExtend", + AdminRenew = "AdminRenew", + SelfActivate = "SelfActivate", + SelfDeactivate = "SelfDeactivate", + SelfExtend = "SelfExtend", + SelfRenew = "SelfRenew" } /** - * Defines values for DefaultDecisionType. \ - * {@link KnownDefaultDecisionType} can be used interchangeably with DefaultDecisionType, + * Defines values for RequestType. \ + * {@link KnownRequestType} can be used interchangeably with RequestType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Approve** \ - * **Deny** \ - * **Recommendation** + * **AdminAssign** \ + * **AdminRemove** \ + * **AdminUpdate** \ + * **AdminExtend** \ + * **AdminRenew** \ + * **SelfActivate** \ + * **SelfDeactivate** \ + * **SelfExtend** \ + * **SelfRenew** */ -export type DefaultDecisionType = string; +export type RequestType = string; -/** Known values of {@link AccessReviewReviewerType} that the service accepts. */ -export enum KnownAccessReviewReviewerType { - User = "user", - ServicePrincipal = "servicePrincipal" +/** Known values of {@link Type} that the service accepts. */ +export enum KnownType { + AfterDuration = "AfterDuration", + AfterDateTime = "AfterDateTime", + NoExpiration = "NoExpiration" } /** - * Defines values for AccessReviewReviewerType. \ - * {@link KnownAccessReviewReviewerType} can be used interchangeably with AccessReviewReviewerType, + * Defines values for Type. \ + * {@link KnownType} can be used interchangeably with Type, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **user** \ - * **servicePrincipal** + * **AfterDuration** \ + * **AfterDateTime** \ + * **NoExpiration** */ -export type AccessReviewReviewerType = string; - -/** Known values of {@link AccessReviewScheduleDefinitionReviewersType} that the service accepts. */ -export enum KnownAccessReviewScheduleDefinitionReviewersType { - Assigned = "Assigned", - Self = "Self", - Managers = "Managers" +export type Type = string; + +/** Known values of {@link RoleManagementPolicyRuleType} that the service accepts. */ +export enum KnownRoleManagementPolicyRuleType { + RoleManagementPolicyApprovalRule = "RoleManagementPolicyApprovalRule", + RoleManagementPolicyAuthenticationContextRule = "RoleManagementPolicyAuthenticationContextRule", + RoleManagementPolicyEnablementRule = "RoleManagementPolicyEnablementRule", + RoleManagementPolicyExpirationRule = "RoleManagementPolicyExpirationRule", + RoleManagementPolicyNotificationRule = "RoleManagementPolicyNotificationRule" } /** - * Defines values for AccessReviewScheduleDefinitionReviewersType. \ - * {@link KnownAccessReviewScheduleDefinitionReviewersType} can be used interchangeably with AccessReviewScheduleDefinitionReviewersType, + * Defines values for RoleManagementPolicyRuleType. \ + * {@link KnownRoleManagementPolicyRuleType} can be used interchangeably with RoleManagementPolicyRuleType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Assigned** \ - * **Self** \ - * **Managers** + * **RoleManagementPolicyApprovalRule** \ + * **RoleManagementPolicyAuthenticationContextRule** \ + * **RoleManagementPolicyEnablementRule** \ + * **RoleManagementPolicyExpirationRule** \ + * **RoleManagementPolicyNotificationRule** */ -export type AccessReviewScheduleDefinitionReviewersType = string; - -/** Known values of {@link AccessReviewInstanceStatus} that the service accepts. */ -export enum KnownAccessReviewInstanceStatus { - NotStarted = "NotStarted", - InProgress = "InProgress", - Completed = "Completed", - Applied = "Applied", - Initializing = "Initializing", - Applying = "Applying", - Completing = "Completing", - Scheduled = "Scheduled", - AutoReviewing = "AutoReviewing", - AutoReviewed = "AutoReviewed", - Starting = "Starting" +export type RoleManagementPolicyRuleType = string; + +/** Known values of {@link ApprovalMode} that the service accepts. */ +export enum KnownApprovalMode { + SingleStage = "SingleStage", + Serial = "Serial", + Parallel = "Parallel", + NoApproval = "NoApproval" } /** - * Defines values for AccessReviewInstanceStatus. \ - * {@link KnownAccessReviewInstanceStatus} can be used interchangeably with AccessReviewInstanceStatus, + * Defines values for ApprovalMode. \ + * {@link KnownApprovalMode} can be used interchangeably with ApprovalMode, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **NotStarted** \ - * **InProgress** \ - * **Completed** \ - * **Applied** \ - * **Initializing** \ - * **Applying** \ - * **Completing** \ - * **Scheduled** \ - * **AutoReviewing** \ - * **AutoReviewed** \ - * **Starting** + * **SingleStage** \ + * **Serial** \ + * **Parallel** \ + * **NoApproval** */ -export type AccessReviewInstanceStatus = string; +export type ApprovalMode = string; -/** Known values of {@link AccessReviewInstanceReviewersType} that the service accepts. */ -export enum KnownAccessReviewInstanceReviewersType { - Assigned = "Assigned", - Self = "Self", - Managers = "Managers" +/** Known values of {@link UserType} that the service accepts. */ +export enum KnownUserType { + User = "User", + Group = "Group" } /** - * Defines values for AccessReviewInstanceReviewersType. \ - * {@link KnownAccessReviewInstanceReviewersType} can be used interchangeably with AccessReviewInstanceReviewersType, + * Defines values for UserType. \ + * {@link KnownUserType} can be used interchangeably with UserType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Assigned** \ - * **Self** \ - * **Managers** + * **User** \ + * **Group** */ -export type AccessReviewInstanceReviewersType = string; +export type UserType = string; -/** Known values of {@link DecisionTargetType} that the service accepts. */ -export enum KnownDecisionTargetType { - User = "user", - ServicePrincipal = "servicePrincipal" +/** Known values of {@link EnablementRules} that the service accepts. */ +export enum KnownEnablementRules { + MultiFactorAuthentication = "MultiFactorAuthentication", + Justification = "Justification", + Ticketing = "Ticketing" } /** - * Defines values for DecisionTargetType. \ - * {@link KnownDecisionTargetType} can be used interchangeably with DecisionTargetType, + * Defines values for EnablementRules. \ + * {@link KnownEnablementRules} can be used interchangeably with EnablementRules, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **user** \ - * **servicePrincipal** + * **MultiFactorAuthentication** \ + * **Justification** \ + * **Ticketing** */ -export type DecisionTargetType = string; +export type EnablementRules = string; -/** Known values of {@link DecisionResourceType} that the service accepts. */ -export enum KnownDecisionResourceType { - AzureRole = "azureRole" +/** Known values of {@link NotificationDeliveryMechanism} that the service accepts. */ +export enum KnownNotificationDeliveryMechanism { + Email = "Email" } /** - * Defines values for DecisionResourceType. \ - * {@link KnownDecisionResourceType} can be used interchangeably with DecisionResourceType, + * Defines values for NotificationDeliveryMechanism. \ + * {@link KnownNotificationDeliveryMechanism} can be used interchangeably with NotificationDeliveryMechanism, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **azureRole** + * **Email** */ -export type DecisionResourceType = string; +export type NotificationDeliveryMechanism = string; -/** Known values of {@link AccessRecommendationType} that the service accepts. */ -export enum KnownAccessRecommendationType { - Approve = "Approve", - Deny = "Deny", - NoInfoAvailable = "NoInfoAvailable" +/** Known values of {@link NotificationLevel} that the service accepts. */ +export enum KnownNotificationLevel { + None = "None", + Critical = "Critical", + All = "All" } /** - * Defines values for AccessRecommendationType. \ - * {@link KnownAccessRecommendationType} can be used interchangeably with AccessRecommendationType, + * Defines values for NotificationLevel. \ + * {@link KnownNotificationLevel} can be used interchangeably with NotificationLevel, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Approve** \ - * **Deny** \ - * **NoInfoAvailable** + * **None** \ + * **Critical** \ + * **All** */ -export type AccessRecommendationType = string; +export type NotificationLevel = string; -/** Known values of {@link AccessReviewApplyResult} that the service accepts. */ -export enum KnownAccessReviewApplyResult { - New = "New", - Applying = "Applying", - AppliedSuccessfully = "AppliedSuccessfully", - AppliedWithUnknownFailure = "AppliedWithUnknownFailure", - AppliedSuccessfullyButObjectNotFound = "AppliedSuccessfullyButObjectNotFound", - ApplyNotSupported = "ApplyNotSupported" +/** Known values of {@link RecipientType} that the service accepts. */ +export enum KnownRecipientType { + Requestor = "Requestor", + Approver = "Approver", + Admin = "Admin" } /** - * Defines values for AccessReviewApplyResult. \ - * {@link KnownAccessReviewApplyResult} can be used interchangeably with AccessReviewApplyResult, + * Defines values for RecipientType. \ + * {@link KnownRecipientType} can be used interchangeably with RecipientType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **New** \ - * **Applying** \ - * **AppliedSuccessfully** \ - * **AppliedWithUnknownFailure** \ - * **AppliedSuccessfullyButObjectNotFound** \ - * **ApplyNotSupported** + * **Requestor** \ + * **Approver** \ + * **Admin** */ -export type AccessReviewApplyResult = string; +export type RecipientType = string; /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface EligibleChildResourcesGetOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup' */ + filter?: string; +} -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; +/** Contains response data for the get operation. */ +export type EligibleChildResourcesGetResponse = EligibleChildResourcesListResult; /** Optional parameters. */ -export interface AccessReviewHistoryDefinitionsListOptionalParams +export interface EligibleChildResourcesGetNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Only standard filters on definition name and created date are supported */ + /** The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup' */ filter?: string; } -/** Contains response data for the list operation. */ -export type AccessReviewHistoryDefinitionsListResponse = AccessReviewHistoryDefinitionListResult; +/** Contains response data for the getNext operation. */ +export type EligibleChildResourcesGetNextResponse = EligibleChildResourcesListResult; /** Optional parameters. */ -export interface AccessReviewHistoryDefinitionsGetByIdOptionalParams +export interface RoleAssignmentSchedulesGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getById operation. */ -export type AccessReviewHistoryDefinitionsGetByIdResponse = AccessReviewHistoryDefinition; +/** Contains response data for the get operation. */ +export type RoleAssignmentSchedulesGetResponse = RoleAssignmentSchedule; /** Optional parameters. */ -export interface AccessReviewHistoryDefinitionsListNextOptionalParams +export interface RoleAssignmentSchedulesListForScopeOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Only standard filters on definition name and created date are supported */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. */ filter?: string; } -/** Contains response data for the listNext operation. */ -export type AccessReviewHistoryDefinitionsListNextResponse = AccessReviewHistoryDefinitionListResult; - -/** Optional parameters. */ -export interface AccessReviewHistoryDefinitionCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type AccessReviewHistoryDefinitionCreateResponse = AccessReviewHistoryDefinition; - -/** Optional parameters. */ -export interface AccessReviewHistoryDefinitionDeleteByIdOptionalParams - extends coreClient.OperationOptions {} +/** Contains response data for the listForScope operation. */ +export type RoleAssignmentSchedulesListForScopeResponse = RoleAssignmentScheduleListResult; /** Optional parameters. */ -export interface AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams - extends coreClient.OperationOptions {} +export interface RoleAssignmentSchedulesListForScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. */ + filter?: string; +} -/** Contains response data for the generateDownloadUri operation. */ -export type AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse = AccessReviewHistoryInstance; +/** Contains response data for the listForScopeNext operation. */ +export type RoleAssignmentSchedulesListForScopeNextResponse = RoleAssignmentScheduleListResult; /** Optional parameters. */ -export interface AccessReviewHistoryDefinitionInstancesListOptionalParams - extends coreClient.OperationOptions {} +export interface RoleAssignmentScheduleInstancesListForScopeOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. */ + filter?: string; +} -/** Contains response data for the list operation. */ -export type AccessReviewHistoryDefinitionInstancesListResponse = AccessReviewHistoryDefinitionInstanceListResult; +/** Contains response data for the listForScope operation. */ +export type RoleAssignmentScheduleInstancesListForScopeResponse = RoleAssignmentScheduleInstanceListResult; /** Optional parameters. */ -export interface AccessReviewHistoryDefinitionInstancesListNextOptionalParams +export interface RoleAssignmentScheduleInstancesGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type AccessReviewHistoryDefinitionInstancesListNextResponse = AccessReviewHistoryDefinitionInstanceListResult; +/** Contains response data for the get operation. */ +export type RoleAssignmentScheduleInstancesGetResponse = RoleAssignmentScheduleInstance; /** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsListOptionalParams +export interface RoleAssignmentScheduleInstancesListForScopeNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. */ filter?: string; } -/** Contains response data for the list operation. */ -export type AccessReviewScheduleDefinitionsListResponse = AccessReviewScheduleDefinitionListResult; - -/** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsGetByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getById operation. */ -export type AccessReviewScheduleDefinitionsGetByIdResponse = AccessReviewScheduleDefinition; +/** Contains response data for the listForScopeNext operation. */ +export type RoleAssignmentScheduleInstancesListForScopeNextResponse = RoleAssignmentScheduleInstanceListResult; /** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsDeleteByIdOptionalParams +export interface RoleAssignmentScheduleRequestsCreateOptionalParams extends coreClient.OperationOptions {} -/** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateById operation. */ -export type AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse = AccessReviewScheduleDefinition; +/** Contains response data for the create operation. */ +export type RoleAssignmentScheduleRequestsCreateResponse = RoleAssignmentScheduleRequest; /** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsStopOptionalParams +export interface RoleAssignmentScheduleRequestsGetOptionalParams extends coreClient.OperationOptions {} -/** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ - filter?: string; -} - -/** Contains response data for the listNext operation. */ -export type AccessReviewScheduleDefinitionsListNextResponse = AccessReviewScheduleDefinitionListResult; +/** Contains response data for the get operation. */ +export type RoleAssignmentScheduleRequestsGetResponse = RoleAssignmentScheduleRequest; /** Optional parameters. */ -export interface AccessReviewInstancesListOptionalParams +export interface RoleAssignmentScheduleRequestsListForScopeOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. */ filter?: string; } -/** Contains response data for the list operation. */ -export type AccessReviewInstancesListResponse = AccessReviewInstanceListResult; +/** Contains response data for the listForScope operation. */ +export type RoleAssignmentScheduleRequestsListForScopeResponse = RoleAssignmentScheduleRequestListResult; /** Optional parameters. */ -export interface AccessReviewInstancesGetByIdOptionalParams +export interface RoleAssignmentScheduleRequestsCancelOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getById operation. */ -export type AccessReviewInstancesGetByIdResponse = AccessReviewInstance; - /** Optional parameters. */ -export interface AccessReviewInstancesCreateOptionalParams +export interface RoleAssignmentScheduleRequestsValidateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the create operation. */ -export type AccessReviewInstancesCreateResponse = AccessReviewInstance; +/** Contains response data for the validate operation. */ +export type RoleAssignmentScheduleRequestsValidateResponse = RoleAssignmentScheduleRequest; /** Optional parameters. */ -export interface AccessReviewInstancesListNextOptionalParams +export interface RoleAssignmentScheduleRequestsListForScopeNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. */ filter?: string; } -/** Contains response data for the listNext operation. */ -export type AccessReviewInstancesListNextResponse = AccessReviewInstanceListResult; - -/** Optional parameters. */ -export interface AccessReviewInstanceStopOptionalParams - extends coreClient.OperationOptions {} +/** Contains response data for the listForScopeNext operation. */ +export type RoleAssignmentScheduleRequestsListForScopeNextResponse = RoleAssignmentScheduleRequestListResult; /** Optional parameters. */ -export interface AccessReviewInstanceResetDecisionsOptionalParams +export interface RoleEligibilitySchedulesGetOptionalParams extends coreClient.OperationOptions {} -/** Optional parameters. */ -export interface AccessReviewInstanceApplyDecisionsOptionalParams - extends coreClient.OperationOptions {} +/** Contains response data for the get operation. */ +export type RoleEligibilitySchedulesGetResponse = RoleEligibilitySchedule; /** Optional parameters. */ -export interface AccessReviewInstanceSendRemindersOptionalParams - extends coreClient.OperationOptions {} +export interface RoleEligibilitySchedulesListForScopeOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ + filter?: string; +} -/** Optional parameters. */ -export interface AccessReviewInstanceAcceptRecommendationsOptionalParams - extends coreClient.OperationOptions {} +/** Contains response data for the listForScope operation. */ +export type RoleEligibilitySchedulesListForScopeResponse = RoleEligibilityScheduleListResult; /** Optional parameters. */ -export interface AccessReviewInstanceDecisionsListOptionalParams +export interface RoleEligibilitySchedulesListForScopeNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ filter?: string; } -/** Contains response data for the list operation. */ -export type AccessReviewInstanceDecisionsListResponse = AccessReviewDecisionListResult; +/** Contains response data for the listForScopeNext operation. */ +export type RoleEligibilitySchedulesListForScopeNextResponse = RoleEligibilityScheduleListResult; /** Optional parameters. */ -export interface AccessReviewInstanceDecisionsListNextOptionalParams +export interface RoleEligibilityScheduleInstancesListForScopeOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ filter?: string; } -/** Contains response data for the listNext operation. */ -export type AccessReviewInstanceDecisionsListNextResponse = AccessReviewDecisionListResult; +/** Contains response data for the listForScope operation. */ +export type RoleEligibilityScheduleInstancesListForScopeResponse = RoleEligibilityScheduleInstanceListResult; /** Optional parameters. */ -export interface AccessReviewInstanceContactedReviewersListOptionalParams +export interface RoleEligibilityScheduleInstancesGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type AccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; +/** Contains response data for the get operation. */ +export type RoleEligibilityScheduleInstancesGetResponse = RoleEligibilityScheduleInstance; /** Optional parameters. */ -export interface AccessReviewInstanceContactedReviewersListNextOptionalParams - extends coreClient.OperationOptions {} +export interface RoleEligibilityScheduleInstancesListForScopeNextOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. */ + filter?: string; +} -/** Contains response data for the listNext operation. */ -export type AccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; +/** Contains response data for the listForScopeNext operation. */ +export type RoleEligibilityScheduleInstancesListForScopeNextResponse = RoleEligibilityScheduleInstanceListResult; /** Optional parameters. */ -export interface AccessReviewDefaultSettingsGetOptionalParams +export interface RoleEligibilityScheduleRequestsCreateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type AccessReviewDefaultSettingsGetResponse = AccessReviewDefaultSettings; +/** Contains response data for the create operation. */ +export type RoleEligibilityScheduleRequestsCreateResponse = RoleEligibilityScheduleRequest; /** Optional parameters. */ -export interface AccessReviewDefaultSettingsPutOptionalParams +export interface RoleEligibilityScheduleRequestsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the put operation. */ -export type AccessReviewDefaultSettingsPutResponse = AccessReviewDefaultSettings; +/** Contains response data for the get operation. */ +export type RoleEligibilityScheduleRequestsGetResponse = RoleEligibilityScheduleRequest; /** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams +export interface RoleEligibilityScheduleRequestsListForScopeOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. */ filter?: string; } -/** Contains response data for the list operation. */ -export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListResponse = AccessReviewScheduleDefinitionListResult; +/** Contains response data for the listForScope operation. */ +export type RoleEligibilityScheduleRequestsListForScopeResponse = RoleEligibilityScheduleRequestListResult; /** Optional parameters. */ -export interface AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ - filter?: string; -} +export interface RoleEligibilityScheduleRequestsCancelOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface RoleEligibilityScheduleRequestsValidateOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse = AccessReviewScheduleDefinitionListResult; +/** Contains response data for the validate operation. */ +export type RoleEligibilityScheduleRequestsValidateResponse = RoleEligibilityScheduleRequest; /** Optional parameters. */ -export interface AccessReviewInstancesAssignedForMyApprovalListOptionalParams +export interface RoleEligibilityScheduleRequestsListForScopeNextOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ + /** The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. */ filter?: string; } -/** Contains response data for the list operation. */ -export type AccessReviewInstancesAssignedForMyApprovalListResponse = AccessReviewInstanceListResult; +/** Contains response data for the listForScopeNext operation. */ +export type RoleEligibilityScheduleRequestsListForScopeNextResponse = RoleEligibilityScheduleRequestListResult; /** Optional parameters. */ -export interface AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams +export interface RoleManagementPoliciesGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getById operation. */ -export type AccessReviewInstancesAssignedForMyApprovalGetByIdResponse = AccessReviewInstance; +/** Contains response data for the get operation. */ +export type RoleManagementPoliciesGetResponse = RoleManagementPolicy; /** Optional parameters. */ -export interface AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ - filter?: string; -} +export interface RoleManagementPoliciesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type AccessReviewInstancesAssignedForMyApprovalListNextResponse = AccessReviewInstanceListResult; +/** Contains response data for the update operation. */ +export type RoleManagementPoliciesUpdateResponse = RoleManagementPolicy; /** Optional parameters. */ -export interface AccessReviewInstanceMyDecisionsListOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ - filter?: string; -} +export interface RoleManagementPoliciesDeleteOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type AccessReviewInstanceMyDecisionsListResponse = AccessReviewDecisionListResult; +/** Optional parameters. */ +export interface RoleManagementPoliciesListForScopeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForScope operation. */ +export type RoleManagementPoliciesListForScopeResponse = RoleManagementPolicyListResult; /** Optional parameters. */ -export interface AccessReviewInstanceMyDecisionsGetByIdOptionalParams +export interface RoleManagementPoliciesListForScopeNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getById operation. */ -export type AccessReviewInstanceMyDecisionsGetByIdResponse = AccessReviewDecision; +/** Contains response data for the listForScopeNext operation. */ +export type RoleManagementPoliciesListForScopeNextResponse = RoleManagementPolicyListResult; /** Optional parameters. */ -export interface AccessReviewInstanceMyDecisionsPatchOptionalParams +export interface RoleManagementPolicyAssignmentsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the patch operation. */ -export type AccessReviewInstanceMyDecisionsPatchResponse = AccessReviewDecision; +/** Contains response data for the get operation. */ +export type RoleManagementPolicyAssignmentsGetResponse = RoleManagementPolicyAssignment; /** Optional parameters. */ -export interface AccessReviewInstanceMyDecisionsListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Other than standard filters, one custom filter option is supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are assigned to the calling user to review are returned */ - filter?: string; -} +export interface RoleManagementPolicyAssignmentsCreateOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type AccessReviewInstanceMyDecisionsListNextResponse = AccessReviewDecisionListResult; +/** Contains response data for the create operation. */ +export type RoleManagementPolicyAssignmentsCreateResponse = RoleManagementPolicyAssignment; + +/** Optional parameters. */ +export interface RoleManagementPolicyAssignmentsDeleteOptionalParams + extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams +export interface RoleManagementPolicyAssignmentsListForScopeOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type TenantLevelAccessReviewInstanceContactedReviewersListResponse = AccessReviewContactedReviewerListResult; +/** Contains response data for the listForScope operation. */ +export type RoleManagementPolicyAssignmentsListForScopeResponse = RoleManagementPolicyAssignmentListResult; /** Optional parameters. */ -export interface TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams +export interface RoleManagementPolicyAssignmentsListForScopeNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type TenantLevelAccessReviewInstanceContactedReviewersListNextResponse = AccessReviewContactedReviewerListResult; +/** Contains response data for the listForScopeNext operation. */ +export type RoleManagementPolicyAssignmentsListForScopeNextResponse = RoleManagementPolicyAssignmentListResult; /** Optional parameters. */ export interface AuthorizationManagementClientOptionalParams diff --git a/sdk/authorization/arm-authorization/src/models/mappers.ts b/sdk/authorization/arm-authorization/src/models/mappers.ts index 850350cc2da6..fc89f71aa691 100644 --- a/sdk/authorization/arm-authorization/src/models/mappers.ts +++ b/sdk/authorization/arm-authorization/src/models/mappers.ts @@ -8,10 +8,10 @@ import * as coreClient from "@azure/core-client"; -export const OperationListResult: coreClient.CompositeMapper = { +export const EligibleChildResourcesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "EligibleChildResourcesListResult", modelProperties: { value: { serializedName: "value", @@ -20,7 +20,7 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" + className: "EligibleChildResource" } } } @@ -35,68 +35,27 @@ export const OperationListResult: coreClient.CompositeMapper = { } }; -export const Operation: coreClient.CompositeMapper = { +export const EligibleChildResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "EligibleChildResource", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", - type: { - name: "Boolean" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", + id: { + serializedName: "id", readOnly: true, type: { name: "String" } }, - operation: { - serializedName: "operation", + name: { + serializedName: "name", readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", + type: { + serializedName: "type", readOnly: true, type: { name: "String" @@ -106,63 +65,35 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; -export const ErrorDefinition: coreClient.CompositeMapper = { +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDefinition", + className: "CloudError", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "ErrorDefinitionProperties" + className: "CloudErrorBody" } } } } }; -export const ErrorDefinitionProperties: coreClient.CompositeMapper = { +export const CloudErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDefinitionProperties", + className: "CloudErrorBody", modelProperties: { - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, code: { serializedName: "code", type: { name: "String" } - } - } - } -}; - -export const AccessReviewHistoryDefinitionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessReviewHistoryDefinitionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewHistoryDefinition" - } - } - } }, - nextLink: { - serializedName: "nextLink", + message: { + serializedName: "message", type: { name: "String" } @@ -171,10 +102,10 @@ export const AccessReviewHistoryDefinitionListResult: coreClient.CompositeMapper } }; -export const AccessReviewHistoryDefinition: coreClient.CompositeMapper = { +export const RoleAssignmentSchedule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewHistoryDefinition", + className: "RoleAssignmentSchedule", modelProperties: { id: { serializedName: "id", @@ -197,149 +128,156 @@ export const AccessReviewHistoryDefinition: coreClient.CompositeMapper = { name: "String" } }, - displayName: { - serializedName: "properties.displayName", + scope: { + serializedName: "properties.scope", type: { name: "String" } }, - reviewHistoryPeriodStartDateTime: { - serializedName: "properties.reviewHistoryPeriodStartDateTime", - readOnly: true, - nullable: true, + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { - name: "DateTime" + name: "String" } }, - reviewHistoryPeriodEndDateTime: { - serializedName: "properties.reviewHistoryPeriodEndDateTime", - readOnly: true, - nullable: true, + principalId: { + serializedName: "properties.principalId", type: { - name: "DateTime" + name: "String" } }, - decisions: { - serializedName: "properties.decisions", - nullable: true, + principalType: { + serializedName: "properties.principalType", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - status: { - serializedName: "properties.status", - readOnly: true, + roleAssignmentScheduleRequestId: { + serializedName: "properties.roleAssignmentScheduleRequestId", type: { name: "String" } }, - createdDateTime: { - serializedName: "properties.createdDateTime", - readOnly: true, - nullable: true, + linkedRoleEligibilityScheduleId: { + serializedName: "properties.linkedRoleEligibilityScheduleId", type: { - name: "DateTime" + name: "String" } }, - scopes: { - serializedName: "properties.scopes", + assignmentType: { + serializedName: "properties.assignmentType", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewScope" - } - } + name: "String" } }, - instances: { - serializedName: "properties.instances", + memberType: { + serializedName: "properties.memberType", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewHistoryInstance" - } - } + name: "String" } }, - typePropertiesSettingsRangeType: { - serializedName: "properties.settings.range.type", - nullable: true, + status: { + serializedName: "properties.status", type: { name: "String" } }, - numberOfOccurrences: { - serializedName: "properties.settings.range.numberOfOccurrences", - nullable: true, + startDateTime: { + serializedName: "properties.startDateTime", type: { - name: "Number" + name: "DateTime" } }, - startDate: { - serializedName: "properties.settings.range.startDate", - nullable: true, + endDateTime: { + serializedName: "properties.endDateTime", type: { name: "DateTime" } }, - endDate: { - serializedName: "properties.settings.range.endDate", - nullable: true, + condition: { + serializedName: "properties.condition", type: { - name: "DateTime" + name: "String" } }, - typePropertiesSettingsPatternType: { - serializedName: "properties.settings.pattern.type", - nullable: true, + conditionVersion: { + serializedName: "properties.conditionVersion", type: { name: "String" } }, - interval: { - serializedName: "properties.settings.pattern.interval", - nullable: true, + createdOn: { + serializedName: "properties.createdOn", type: { - name: "Number" + name: "DateTime" } }, - principalId: { - serializedName: "properties.createdBy.principalId", - readOnly: true, - nullable: true, + updatedOn: { + serializedName: "properties.updatedOn", type: { - name: "String" + name: "DateTime" } }, - principalType: { - serializedName: "properties.createdBy.principalType", - readOnly: true, - nullable: true, + expandedProperties: { + serializedName: "properties.expandedProperties", + type: { + name: "Composite", + className: "ExpandedProperties" + } + } + } + } +}; + +export const ExpandedProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExpandedProperties", + modelProperties: { + scope: { + serializedName: "scope", + type: { + name: "Composite", + className: "ExpandedPropertiesScope" + } + }, + roleDefinition: { + serializedName: "roleDefinition", + type: { + name: "Composite", + className: "ExpandedPropertiesRoleDefinition" + } + }, + principal: { + serializedName: "principal", + type: { + name: "Composite", + className: "ExpandedPropertiesPrincipal" + } + } + } + } +}; + +export const ExpandedPropertiesScope: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExpandedPropertiesScope", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - principalName: { - serializedName: "properties.createdBy.principalName", - readOnly: true, - nullable: true, + displayName: { + serializedName: "displayName", type: { name: "String" } }, - userPrincipalName: { - serializedName: "properties.createdBy.userPrincipalName", - readOnly: true, - nullable: true, + type: { + serializedName: "type", type: { name: "String" } @@ -348,215 +286,257 @@ export const AccessReviewHistoryDefinition: coreClient.CompositeMapper = { } }; -export const AccessReviewHistoryDefinitionProperties: coreClient.CompositeMapper = { +export const ExpandedPropertiesRoleDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewHistoryDefinitionProperties", + className: "ExpandedPropertiesRoleDefinition", modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, displayName: { serializedName: "displayName", type: { name: "String" } }, - reviewHistoryPeriodStartDateTime: { - serializedName: "reviewHistoryPeriodStartDateTime", - readOnly: true, - nullable: true, + type: { + serializedName: "type", type: { - name: "DateTime" + name: "String" } - }, - reviewHistoryPeriodEndDateTime: { - serializedName: "reviewHistoryPeriodEndDateTime", - readOnly: true, - nullable: true, + } + } + } +}; + +export const ExpandedPropertiesPrincipal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExpandedPropertiesPrincipal", + modelProperties: { + id: { + serializedName: "id", type: { - name: "DateTime" + name: "String" } }, - decisions: { - serializedName: "decisions", - nullable: true, + displayName: { + serializedName: "displayName", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - status: { - serializedName: "status", - readOnly: true, + email: { + serializedName: "email", type: { name: "String" } }, - createdDateTime: { - serializedName: "createdDateTime", - readOnly: true, - nullable: true, + type: { + serializedName: "type", type: { - name: "DateTime" + name: "String" } - }, - scopes: { - serializedName: "scopes", + } + } + } +}; + +export const RoleAssignmentScheduleListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleAssignmentScheduleListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AccessReviewScope" + className: "RoleAssignmentSchedule" } } } }, - instances: { - serializedName: "instances", + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const RoleAssignmentScheduleInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleAssignmentScheduleInstanceListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AccessReviewHistoryInstance" + className: "RoleAssignmentScheduleInstance" } } } }, - typeSettingsRangeType: { - serializedName: "settings.range.type", - nullable: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - numberOfOccurrences: { - serializedName: "settings.range.numberOfOccurrences", - nullable: true, + } + } + } +}; + +export const RoleAssignmentScheduleInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleAssignmentScheduleInstance", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { - name: "Number" + name: "String" } }, - startDate: { - serializedName: "settings.range.startDate", - nullable: true, + name: { + serializedName: "name", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - endDate: { - serializedName: "settings.range.endDate", - nullable: true, + type: { + serializedName: "type", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - typeSettingsPatternType: { - serializedName: "settings.pattern.type", - nullable: true, + scope: { + serializedName: "properties.scope", type: { name: "String" } }, - interval: { - serializedName: "settings.pattern.interval", - nullable: true, + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { - name: "Number" + name: "String" } }, principalId: { - serializedName: "createdBy.principalId", - readOnly: true, - nullable: true, + serializedName: "properties.principalId", type: { name: "String" } }, principalType: { - serializedName: "createdBy.principalType", - readOnly: true, - nullable: true, + serializedName: "properties.principalType", type: { name: "String" } }, - principalName: { - serializedName: "createdBy.principalName", - readOnly: true, - nullable: true, + roleAssignmentScheduleId: { + serializedName: "properties.roleAssignmentScheduleId", type: { name: "String" } }, - userPrincipalName: { - serializedName: "createdBy.userPrincipalName", - readOnly: true, - nullable: true, + originRoleAssignmentId: { + serializedName: "properties.originRoleAssignmentId", type: { name: "String" } - } - } - } -}; - -export const AccessReviewScope: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessReviewScope", - modelProperties: { - resourceId: { - serializedName: "resourceId", - readOnly: true, + }, + status: { + serializedName: "properties.status", type: { name: "String" } }, - roleDefinitionId: { - serializedName: "roleDefinitionId", - readOnly: true, + startDateTime: { + serializedName: "properties.startDateTime", + type: { + name: "DateTime" + } + }, + endDateTime: { + serializedName: "properties.endDateTime", + type: { + name: "DateTime" + } + }, + linkedRoleEligibilityScheduleId: { + serializedName: "properties.linkedRoleEligibilityScheduleId", type: { name: "String" } }, - principalType: { - serializedName: "principalType", - readOnly: true, + linkedRoleEligibilityScheduleInstanceId: { + serializedName: "properties.linkedRoleEligibilityScheduleInstanceId", type: { name: "String" } }, - assignmentState: { - serializedName: "assignmentState", - readOnly: true, + assignmentType: { + serializedName: "properties.assignmentType", type: { name: "String" } }, - inactiveDuration: { - serializedName: "inactiveDuration", + memberType: { + serializedName: "properties.memberType", type: { - name: "TimeSpan" + name: "String" } }, - expandNestedMemberships: { - serializedName: "expandNestedMemberships", + condition: { + serializedName: "properties.condition", type: { - name: "Boolean" + name: "String" + } + }, + conditionVersion: { + serializedName: "properties.conditionVersion", + type: { + name: "String" + } + }, + createdOn: { + serializedName: "properties.createdOn", + type: { + name: "DateTime" + } + }, + expandedProperties: { + serializedName: "properties.expandedProperties", + type: { + name: "Composite", + className: "ExpandedProperties" } } } } }; -export const AccessReviewHistoryInstance: coreClient.CompositeMapper = { +export const RoleAssignmentScheduleRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewHistoryInstance", + className: "RoleAssignmentScheduleRequest", modelProperties: { id: { serializedName: "id", @@ -579,20 +559,34 @@ export const AccessReviewHistoryInstance: coreClient.CompositeMapper = { name: "String" } }, - reviewHistoryPeriodStartDateTime: { - serializedName: "properties.reviewHistoryPeriodStartDateTime", + scope: { + serializedName: "properties.scope", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - reviewHistoryPeriodEndDateTime: { - serializedName: "properties.reviewHistoryPeriodEndDateTime", + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { - name: "DateTime" + name: "String" } }, - displayName: { - serializedName: "properties.displayName", + principalId: { + serializedName: "properties.principalId", + type: { + name: "String" + } + }, + principalType: { + serializedName: "properties.principalType", + readOnly: true, + type: { + name: "String" + } + }, + requestType: { + serializedName: "properties.requestType", type: { name: "String" } @@ -604,57 +598,151 @@ export const AccessReviewHistoryInstance: coreClient.CompositeMapper = { name: "String" } }, - runDateTime: { - serializedName: "properties.runDateTime", - nullable: true, + approvalId: { + serializedName: "properties.approvalId", + readOnly: true, type: { - name: "DateTime" + name: "String" + } + }, + targetRoleAssignmentScheduleId: { + serializedName: "properties.targetRoleAssignmentScheduleId", + type: { + name: "String" + } + }, + targetRoleAssignmentScheduleInstanceId: { + serializedName: "properties.targetRoleAssignmentScheduleInstanceId", + type: { + name: "String" + } + }, + scheduleInfo: { + serializedName: "properties.scheduleInfo", + type: { + name: "Composite", + className: "RoleAssignmentScheduleRequestPropertiesScheduleInfo" + } + }, + linkedRoleEligibilityScheduleId: { + serializedName: "properties.linkedRoleEligibilityScheduleId", + type: { + name: "String" + } + }, + justification: { + serializedName: "properties.justification", + type: { + name: "String" + } + }, + ticketInfo: { + serializedName: "properties.ticketInfo", + type: { + name: "Composite", + className: "RoleAssignmentScheduleRequestPropertiesTicketInfo" + } + }, + condition: { + serializedName: "properties.condition", + type: { + name: "String" + } + }, + conditionVersion: { + serializedName: "properties.conditionVersion", + type: { + name: "String" } }, - fulfilledDateTime: { - serializedName: "properties.fulfilledDateTime", - nullable: true, + createdOn: { + serializedName: "properties.createdOn", + readOnly: true, type: { name: "DateTime" } }, - downloadUri: { - serializedName: "properties.downloadUri", + requestorId: { + serializedName: "properties.requestorId", readOnly: true, type: { name: "String" } }, + expandedProperties: { + serializedName: "properties.expandedProperties", + type: { + name: "Composite", + className: "ExpandedProperties" + } + } + } + } +}; + +export const RoleAssignmentScheduleRequestPropertiesScheduleInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleAssignmentScheduleRequestPropertiesScheduleInfo", + modelProperties: { + startDateTime: { + serializedName: "startDateTime", + type: { + name: "DateTime" + } + }, expiration: { - serializedName: "properties.expiration", - nullable: true, + serializedName: "expiration", + type: { + name: "Composite", + className: + "RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration" + } + } + } + } +}; + +export const RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + endDateTime: { + serializedName: "endDateTime", type: { name: "DateTime" } + }, + duration: { + serializedName: "duration", + type: { + name: "String" + } } } } }; -export const AccessReviewHistoryDefinitionInstanceListResult: coreClient.CompositeMapper = { +export const RoleAssignmentScheduleRequestPropertiesTicketInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewHistoryDefinitionInstanceListResult", + className: "RoleAssignmentScheduleRequestPropertiesTicketInfo", modelProperties: { - value: { - serializedName: "value", + ticketNumber: { + serializedName: "ticketNumber", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewHistoryInstance" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + ticketSystem: { + serializedName: "ticketSystem", type: { name: "String" } @@ -663,10 +751,10 @@ export const AccessReviewHistoryDefinitionInstanceListResult: coreClient.Composi } }; -export const AccessReviewScheduleDefinitionListResult: coreClient.CompositeMapper = { +export const RoleAssignmentScheduleRequestListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewScheduleDefinitionListResult", + className: "RoleAssignmentScheduleRequestListResult", modelProperties: { value: { serializedName: "value", @@ -675,7 +763,7 @@ export const AccessReviewScheduleDefinitionListResult: coreClient.CompositeMappe element: { type: { name: "Composite", - className: "AccessReviewScheduleDefinition" + className: "RoleAssignmentScheduleRequest" } } } @@ -690,10 +778,10 @@ export const AccessReviewScheduleDefinitionListResult: coreClient.CompositeMappe } }; -export const AccessReviewScheduleDefinition: coreClient.CompositeMapper = { +export const RoleEligibilitySchedule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewScheduleDefinition", + className: "RoleEligibilitySchedule", modelProperties: { id: { serializedName: "id", @@ -716,591 +804,489 @@ export const AccessReviewScheduleDefinition: coreClient.CompositeMapper = { name: "String" } }, - displayName: { - serializedName: "properties.displayName", + scope: { + serializedName: "properties.scope", + type: { + name: "String" + } + }, + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", + type: { + name: "String" + } + }, + principalId: { + serializedName: "properties.principalId", + type: { + name: "String" + } + }, + principalType: { + serializedName: "properties.principalType", + type: { + name: "String" + } + }, + roleEligibilityScheduleRequestId: { + serializedName: "properties.roleEligibilityScheduleRequestId", + type: { + name: "String" + } + }, + memberType: { + serializedName: "properties.memberType", type: { name: "String" } }, status: { serializedName: "properties.status", - readOnly: true, type: { name: "String" } }, - descriptionForAdmins: { - serializedName: "properties.descriptionForAdmins", + startDateTime: { + serializedName: "properties.startDateTime", + type: { + name: "DateTime" + } + }, + endDateTime: { + serializedName: "properties.endDateTime", + type: { + name: "DateTime" + } + }, + condition: { + serializedName: "properties.condition", type: { name: "String" } }, - descriptionForReviewers: { - serializedName: "properties.descriptionForReviewers", + conditionVersion: { + serializedName: "properties.conditionVersion", type: { name: "String" } }, - reviewers: { - serializedName: "properties.reviewers", + createdOn: { + serializedName: "properties.createdOn", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewReviewer" - } - } + name: "DateTime" + } + }, + updatedOn: { + serializedName: "properties.updatedOn", + type: { + name: "DateTime" } }, - backupReviewers: { - serializedName: "properties.backupReviewers", + expandedProperties: { + serializedName: "properties.expandedProperties", + type: { + name: "Composite", + className: "ExpandedProperties" + } + } + } + } +}; + +export const RoleEligibilityScheduleListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AccessReviewReviewer" + className: "RoleEligibilitySchedule" } } } }, - reviewersType: { - serializedName: "properties.reviewersType", - readOnly: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - instances: { - serializedName: "properties.instances", + } + } + } +}; + +export const RoleEligibilityScheduleInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleInstanceListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AccessReviewInstance" + className: "RoleEligibilityScheduleInstance" } } } }, - resourceId: { - serializedName: "properties.scope.resourceId", - readOnly: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - roleDefinitionId: { - serializedName: "properties.scope.roleDefinitionId", + } + } + } +}; + +export const RoleEligibilityScheduleInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleInstance", + modelProperties: { + id: { + serializedName: "id", readOnly: true, type: { name: "String" } }, - principalTypePropertiesScopePrincipalType: { - serializedName: "properties.scope.principalType", + name: { + serializedName: "name", readOnly: true, type: { name: "String" } }, - assignmentState: { - serializedName: "properties.scope.assignmentState", + type: { + serializedName: "type", readOnly: true, type: { name: "String" } }, - inactiveDuration: { - serializedName: "properties.scope.inactiveDuration", + scope: { + serializedName: "properties.scope", type: { - name: "TimeSpan" + name: "String" } }, - expandNestedMemberships: { - serializedName: "properties.scope.expandNestedMemberships", - type: { - name: "Boolean" - } - }, - mailNotificationsEnabled: { - serializedName: "properties.settings.mailNotificationsEnabled", - type: { - name: "Boolean" - } - }, - reminderNotificationsEnabled: { - serializedName: "properties.settings.reminderNotificationsEnabled", - type: { - name: "Boolean" - } - }, - defaultDecisionEnabled: { - serializedName: "properties.settings.defaultDecisionEnabled", - type: { - name: "Boolean" - } - }, - justificationRequiredOnApproval: { - serializedName: "properties.settings.justificationRequiredOnApproval", - type: { - name: "Boolean" - } - }, - defaultDecision: { - serializedName: "properties.settings.defaultDecision", + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { name: "String" } }, - autoApplyDecisionsEnabled: { - serializedName: "properties.settings.autoApplyDecisionsEnabled", - type: { - name: "Boolean" - } - }, - recommendationsEnabled: { - serializedName: "properties.settings.recommendationsEnabled", - type: { - name: "Boolean" - } - }, - recommendationLookBackDuration: { - serializedName: "properties.settings.recommendationLookBackDuration", + principalId: { + serializedName: "properties.principalId", type: { - name: "TimeSpan" + name: "String" } }, - instanceDurationInDays: { - serializedName: "properties.settings.instanceDurationInDays", + principalType: { + serializedName: "properties.principalType", type: { - name: "Number" + name: "String" } }, - typePropertiesSettingsRecurrenceRangeType: { - serializedName: "properties.settings.recurrence.range.type", + roleEligibilityScheduleId: { + serializedName: "properties.roleEligibilityScheduleId", type: { name: "String" } }, - numberOfOccurrences: { - serializedName: - "properties.settings.recurrence.range.numberOfOccurrences", + status: { + serializedName: "properties.status", type: { - name: "Number" + name: "String" } }, - startDate: { - serializedName: "properties.settings.recurrence.range.startDate", - nullable: true, + startDateTime: { + serializedName: "properties.startDateTime", type: { name: "DateTime" } }, - endDate: { - serializedName: "properties.settings.recurrence.range.endDate", - nullable: true, + endDateTime: { + serializedName: "properties.endDateTime", type: { name: "DateTime" } }, - typePropertiesSettingsRecurrencePatternType: { - serializedName: "properties.settings.recurrence.pattern.type", + memberType: { + serializedName: "properties.memberType", type: { name: "String" } }, - interval: { - serializedName: "properties.settings.recurrence.pattern.interval", - type: { - name: "Number" - } - }, - principalId: { - serializedName: "properties.createdBy.principalId", - readOnly: true, + condition: { + serializedName: "properties.condition", type: { name: "String" } }, - principalTypePropertiesCreatedByPrincipalType: { - serializedName: "properties.createdBy.principalType", - readOnly: true, + conditionVersion: { + serializedName: "properties.conditionVersion", type: { name: "String" } }, - principalName: { - serializedName: "properties.createdBy.principalName", - readOnly: true, + createdOn: { + serializedName: "properties.createdOn", type: { - name: "String" + name: "DateTime" } }, - userPrincipalName: { - serializedName: "properties.createdBy.userPrincipalName", - readOnly: true, + expandedProperties: { + serializedName: "properties.expandedProperties", type: { - name: "String" + name: "Composite", + className: "ExpandedProperties" } } } } }; -export const AccessReviewScheduleDefinitionProperties: coreClient.CompositeMapper = { +export const RoleEligibilityScheduleRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewScheduleDefinitionProperties", + className: "RoleEligibilityScheduleRequest", modelProperties: { - displayName: { - serializedName: "displayName", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - status: { - serializedName: "status", + name: { + serializedName: "name", readOnly: true, type: { name: "String" } }, - descriptionForAdmins: { - serializedName: "descriptionForAdmins", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - descriptionForReviewers: { - serializedName: "descriptionForReviewers", + scope: { + serializedName: "properties.scope", + readOnly: true, type: { name: "String" } }, - reviewers: { - serializedName: "reviewers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewReviewer" - } - } - } - }, - backupReviewers: { - serializedName: "backupReviewers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewReviewer" - } - } - } - }, - reviewersType: { - serializedName: "reviewersType", - readOnly: true, + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { name: "String" } }, - instances: { - serializedName: "instances", + principalId: { + serializedName: "properties.principalId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewInstance" - } - } + name: "String" } }, - resourceId: { - serializedName: "scope.resourceId", + principalType: { + serializedName: "properties.principalType", readOnly: true, type: { name: "String" } }, - roleDefinitionId: { - serializedName: "scope.roleDefinitionId", - readOnly: true, + requestType: { + serializedName: "properties.requestType", type: { name: "String" } }, - principalTypeScopePrincipalType: { - serializedName: "scope.principalType", + status: { + serializedName: "properties.status", readOnly: true, type: { name: "String" } }, - assignmentState: { - serializedName: "scope.assignmentState", + approvalId: { + serializedName: "properties.approvalId", readOnly: true, type: { name: "String" } }, - inactiveDuration: { - serializedName: "scope.inactiveDuration", - type: { - name: "TimeSpan" - } - }, - expandNestedMemberships: { - serializedName: "scope.expandNestedMemberships", - type: { - name: "Boolean" - } - }, - mailNotificationsEnabled: { - serializedName: "settings.mailNotificationsEnabled", - type: { - name: "Boolean" - } - }, - reminderNotificationsEnabled: { - serializedName: "settings.reminderNotificationsEnabled", - type: { - name: "Boolean" - } - }, - defaultDecisionEnabled: { - serializedName: "settings.defaultDecisionEnabled", - type: { - name: "Boolean" - } - }, - justificationRequiredOnApproval: { - serializedName: "settings.justificationRequiredOnApproval", + scheduleInfo: { + serializedName: "properties.scheduleInfo", type: { - name: "Boolean" + name: "Composite", + className: "RoleEligibilityScheduleRequestPropertiesScheduleInfo" } }, - defaultDecision: { - serializedName: "settings.defaultDecision", + targetRoleEligibilityScheduleId: { + serializedName: "properties.targetRoleEligibilityScheduleId", type: { name: "String" } }, - autoApplyDecisionsEnabled: { - serializedName: "settings.autoApplyDecisionsEnabled", - type: { - name: "Boolean" - } - }, - recommendationsEnabled: { - serializedName: "settings.recommendationsEnabled", - type: { - name: "Boolean" - } - }, - recommendationLookBackDuration: { - serializedName: "settings.recommendationLookBackDuration", - type: { - name: "TimeSpan" - } - }, - instanceDurationInDays: { - serializedName: "settings.instanceDurationInDays", - type: { - name: "Number" - } - }, - typeSettingsRecurrenceRangeType: { - serializedName: "settings.recurrence.range.type", + targetRoleEligibilityScheduleInstanceId: { + serializedName: "properties.targetRoleEligibilityScheduleInstanceId", type: { name: "String" } }, - numberOfOccurrences: { - serializedName: "settings.recurrence.range.numberOfOccurrences", - type: { - name: "Number" - } - }, - startDate: { - serializedName: "settings.recurrence.range.startDate", - nullable: true, + justification: { + serializedName: "properties.justification", type: { - name: "DateTime" + name: "String" } }, - endDate: { - serializedName: "settings.recurrence.range.endDate", - nullable: true, + ticketInfo: { + serializedName: "properties.ticketInfo", type: { - name: "DateTime" + name: "Composite", + className: "RoleEligibilityScheduleRequestPropertiesTicketInfo" } }, - typeSettingsRecurrencePatternType: { - serializedName: "settings.recurrence.pattern.type", + condition: { + serializedName: "properties.condition", type: { name: "String" } }, - interval: { - serializedName: "settings.recurrence.pattern.interval", - type: { - name: "Number" - } - }, - principalId: { - serializedName: "createdBy.principalId", - readOnly: true, + conditionVersion: { + serializedName: "properties.conditionVersion", type: { name: "String" } }, - principalTypeCreatedByPrincipalType: { - serializedName: "createdBy.principalType", + createdOn: { + serializedName: "properties.createdOn", readOnly: true, type: { - name: "String" + name: "DateTime" } }, - principalName: { - serializedName: "createdBy.principalName", + requestorId: { + serializedName: "properties.requestorId", readOnly: true, type: { name: "String" } }, - userPrincipalName: { - serializedName: "createdBy.userPrincipalName", - readOnly: true, + expandedProperties: { + serializedName: "properties.expandedProperties", type: { - name: "String" + name: "Composite", + className: "ExpandedProperties" } } } } }; -export const AccessReviewScheduleSettings: coreClient.CompositeMapper = { +export const RoleEligibilityScheduleRequestPropertiesScheduleInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewScheduleSettings", + className: "RoleEligibilityScheduleRequestPropertiesScheduleInfo", modelProperties: { - mailNotificationsEnabled: { - serializedName: "mailNotificationsEnabled", - type: { - name: "Boolean" - } - }, - reminderNotificationsEnabled: { - serializedName: "reminderNotificationsEnabled", - type: { - name: "Boolean" - } - }, - defaultDecisionEnabled: { - serializedName: "defaultDecisionEnabled", - type: { - name: "Boolean" - } - }, - justificationRequiredOnApproval: { - serializedName: "justificationRequiredOnApproval", - type: { - name: "Boolean" - } - }, - defaultDecision: { - serializedName: "defaultDecision", - type: { - name: "String" - } - }, - autoApplyDecisionsEnabled: { - serializedName: "autoApplyDecisionsEnabled", - type: { - name: "Boolean" - } - }, - recommendationsEnabled: { - serializedName: "recommendationsEnabled", - type: { - name: "Boolean" - } - }, - recommendationLookBackDuration: { - serializedName: "recommendationLookBackDuration", + startDateTime: { + serializedName: "startDateTime", type: { - name: "TimeSpan" + name: "DateTime" } }, - instanceDurationInDays: { - serializedName: "instanceDurationInDays", + expiration: { + serializedName: "expiration", type: { - name: "Number" + name: "Composite", + className: + "RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration" } - }, - typeRecurrenceRangeType: { - serializedName: "recurrence.range.type", + } + } + } +}; + +export const RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration", + modelProperties: { + type: { + serializedName: "type", type: { name: "String" } }, - numberOfOccurrences: { - serializedName: "recurrence.range.numberOfOccurrences", - type: { - name: "Number" - } - }, - startDate: { - serializedName: "recurrence.range.startDate", - nullable: true, + endDateTime: { + serializedName: "endDateTime", type: { name: "DateTime" } }, - endDate: { - serializedName: "recurrence.range.endDate", - nullable: true, + duration: { + serializedName: "duration", type: { - name: "DateTime" + name: "String" } - }, - typeRecurrencePatternType: { - serializedName: "recurrence.pattern.type", + } + } + } +}; + +export const RoleEligibilityScheduleRequestPropertiesTicketInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleRequestPropertiesTicketInfo", + modelProperties: { + ticketNumber: { + serializedName: "ticketNumber", type: { name: "String" } }, - interval: { - serializedName: "recurrence.pattern.interval", + ticketSystem: { + serializedName: "ticketSystem", type: { - name: "Number" + name: "String" } } } } }; -export const AccessReviewReviewer: coreClient.CompositeMapper = { +export const RoleEligibilityScheduleRequestListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewReviewer", + className: "RoleEligibilityScheduleRequestListResult", modelProperties: { - principalId: { - serializedName: "principalId", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleEligibilityScheduleRequest" + } + } } }, - principalType: { - serializedName: "principalType", - readOnly: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -1309,10 +1295,10 @@ export const AccessReviewReviewer: coreClient.CompositeMapper = { } }; -export const AccessReviewInstance: coreClient.CompositeMapper = { +export const RoleManagementPolicy: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewInstance", + className: "RoleManagementPolicy", modelProperties: { id: { serializedName: "id", @@ -1335,52 +1321,105 @@ export const AccessReviewInstance: coreClient.CompositeMapper = { name: "String" } }, - status: { - serializedName: "properties.status", - readOnly: true, + scope: { + serializedName: "properties.scope", type: { name: "String" } }, - startDateTime: { - serializedName: "properties.startDateTime", + displayName: { + serializedName: "properties.displayName", type: { - name: "DateTime" + name: "String" } }, - endDateTime: { - serializedName: "properties.endDateTime", + description: { + serializedName: "properties.description", type: { - name: "DateTime" + name: "String" } }, - reviewers: { - serializedName: "properties.reviewers", + isOrganizationDefault: { + serializedName: "properties.isOrganizationDefault", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewReviewer" - } - } + name: "Boolean" + } + }, + lastModifiedBy: { + serializedName: "properties.lastModifiedBy", + type: { + name: "Composite", + className: "Principal" + } + }, + lastModifiedDateTime: { + serializedName: "properties.lastModifiedDateTime", + readOnly: true, + type: { + name: "DateTime" } }, - backupReviewers: { - serializedName: "properties.backupReviewers", + rules: { + serializedName: "properties.rules", type: { name: "Sequence", element: { type: { name: "Composite", - className: "AccessReviewReviewer" + className: "RoleManagementPolicyRule" } } } }, - reviewersType: { - serializedName: "properties.reviewersType", + effectiveRules: { + serializedName: "properties.effectiveRules", readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleManagementPolicyRule" + } + } + } + }, + policyProperties: { + serializedName: "properties.policyProperties", + type: { + name: "Composite", + className: "PolicyProperties" + } + } + } + } +}; + +export const Principal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Principal", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + email: { + serializedName: "email", type: { name: "String" } @@ -1389,84 +1428,140 @@ export const AccessReviewInstance: coreClient.CompositeMapper = { } }; -export const AccessReviewInstanceProperties: coreClient.CompositeMapper = { +export const RoleManagementPolicyRule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewInstanceProperties", + className: "RoleManagementPolicyRule", + uberParent: "RoleManagementPolicyRule", + polymorphicDiscriminator: { + serializedName: "ruleType", + clientName: "ruleType" + }, modelProperties: { - status: { - serializedName: "status", - readOnly: true, + id: { + serializedName: "id", type: { name: "String" } }, - startDateTime: { - serializedName: "startDateTime", + ruleType: { + serializedName: "ruleType", + required: true, type: { - name: "DateTime" + name: "String" } }, - endDateTime: { - serializedName: "endDateTime", + target: { + serializedName: "target", type: { - name: "DateTime" + name: "Composite", + className: "RoleManagementPolicyRuleTarget" + } + } + } + } +}; + +export const RoleManagementPolicyRuleTarget: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleManagementPolicyRuleTarget", + modelProperties: { + caller: { + serializedName: "caller", + type: { + name: "String" } }, - reviewers: { - serializedName: "reviewers", + operations: { + serializedName: "operations", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "AccessReviewReviewer" + name: "String" + } + } + } + }, + level: { + serializedName: "level", + type: { + name: "String" + } + }, + targetObjects: { + serializedName: "targetObjects", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } }, - backupReviewers: { - serializedName: "backupReviewers", + inheritableSettings: { + serializedName: "inheritableSettings", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "AccessReviewReviewer" + name: "String" } } } }, - reviewersType: { - serializedName: "reviewersType", - readOnly: true, + enforcedSettings: { + serializedName: "enforcedSettings", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const AccessReviewInstanceListResult: coreClient.CompositeMapper = { +export const PolicyProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewInstanceListResult", + className: "PolicyProperties", modelProperties: { - value: { - serializedName: "value", + scope: { + serializedName: "scope", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewInstance" - } - } + name: "Composite", + className: "PolicyPropertiesScope" + } + } + } + } +}; + +export const PolicyPropertiesScope: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyPropertiesScope", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" } }, - nextLink: { - serializedName: "nextLink", + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + type: { + serializedName: "type", type: { name: "String" } @@ -1475,10 +1570,10 @@ export const AccessReviewInstanceListResult: coreClient.CompositeMapper = { } }; -export const AccessReviewDecisionListResult: coreClient.CompositeMapper = { +export const RoleManagementPolicyListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewDecisionListResult", + className: "RoleManagementPolicyListResult", modelProperties: { value: { serializedName: "value", @@ -1487,7 +1582,7 @@ export const AccessReviewDecisionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AccessReviewDecision" + className: "RoleManagementPolicy" } } } @@ -1502,10 +1597,10 @@ export const AccessReviewDecisionListResult: coreClient.CompositeMapper = { } }; -export const AccessReviewDecision: coreClient.CompositeMapper = { +export const RoleManagementPolicyAssignment: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewDecision", + className: "RoleManagementPolicyAssignment", modelProperties: { id: { serializedName: "id", @@ -1528,154 +1623,179 @@ export const AccessReviewDecision: coreClient.CompositeMapper = { name: "String" } }, - recommendation: { - serializedName: "properties.recommendation", - readOnly: true, + scope: { + serializedName: "properties.scope", type: { name: "String" } }, - decision: { - serializedName: "properties.decision", + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { name: "String" } }, - justification: { - serializedName: "properties.justification", + policyId: { + serializedName: "properties.policyId", type: { name: "String" } }, - reviewedDateTime: { - serializedName: "properties.reviewedDateTime", + effectiveRules: { + serializedName: "properties.effectiveRules", readOnly: true, - nullable: true, type: { - name: "DateTime" - } - }, - applyResult: { - serializedName: "properties.applyResult", - readOnly: true, - type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleManagementPolicyRule" + } + } } }, - appliedDateTime: { - serializedName: "properties.appliedDateTime", - readOnly: true, - nullable: true, + policyAssignmentProperties: { + serializedName: "properties.policyAssignmentProperties", type: { - name: "DateTime" + name: "Composite", + className: "PolicyAssignmentProperties" } - }, - principalIdPropertiesAppliedByPrincipalId: { - serializedName: "properties.appliedBy.principalId", - readOnly: true, - nullable: true, + } + } + } +}; + +export const PolicyAssignmentProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignmentProperties", + modelProperties: { + scope: { + serializedName: "scope", type: { - name: "String" + name: "Composite", + className: "PolicyAssignmentPropertiesScope" } }, - principalTypePropertiesAppliedByPrincipalType: { - serializedName: "properties.appliedBy.principalType", - readOnly: true, - nullable: true, + roleDefinition: { + serializedName: "roleDefinition", type: { - name: "String" + name: "Composite", + className: "PolicyAssignmentPropertiesRoleDefinition" } }, - principalNamePropertiesAppliedByPrincipalName: { - serializedName: "properties.appliedBy.principalName", - readOnly: true, - nullable: true, + policy: { + serializedName: "policy", type: { - name: "String" + name: "Composite", + className: "PolicyAssignmentPropertiesPolicy" } - }, - userPrincipalNamePropertiesAppliedByUserPrincipalName: { - serializedName: "properties.appliedBy.userPrincipalName", - readOnly: true, - nullable: true, + } + } + } +}; + +export const PolicyAssignmentPropertiesScope: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignmentPropertiesScope", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - principalIdPropertiesReviewedByPrincipalId: { - serializedName: "properties.reviewedBy.principalId", - readOnly: true, - nullable: true, + displayName: { + serializedName: "displayName", type: { name: "String" } }, - principalTypePropertiesReviewedByPrincipalType: { - serializedName: "properties.reviewedBy.principalType", - readOnly: true, - nullable: true, + type: { + serializedName: "type", type: { name: "String" } - }, - principalNamePropertiesReviewedByPrincipalName: { - serializedName: "properties.reviewedBy.principalName", - readOnly: true, - nullable: true, + } + } + } +}; + +export const PolicyAssignmentPropertiesRoleDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignmentPropertiesRoleDefinition", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - userPrincipalNamePropertiesReviewedByUserPrincipalName: { - serializedName: "properties.reviewedBy.userPrincipalName", - readOnly: true, - nullable: true, + displayName: { + serializedName: "displayName", type: { name: "String" } }, - typePropertiesResourceType: { - serializedName: "properties.resource.type", - nullable: true, + type: { + serializedName: "type", type: { name: "String" } - }, - idPropertiesResourceId: { - serializedName: "properties.resource.id", - readOnly: true, - nullable: true, + } + } + } +}; + +export const PolicyAssignmentPropertiesPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignmentPropertiesPolicy", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - displayNamePropertiesResourceDisplayName: { - serializedName: "properties.resource.displayName", - readOnly: true, - nullable: true, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { - name: "String" + name: "Composite", + className: "Principal" } }, - typePropertiesPrincipalType: { - serializedName: "properties.principal.type", - nullable: true, + lastModifiedDateTime: { + serializedName: "lastModifiedDateTime", type: { - name: "String" + name: "DateTime" } - }, - idPropertiesPrincipalId: { - serializedName: "properties.principal.id", - readOnly: true, - nullable: true, + } + } + } +}; + +export const RoleManagementPolicyAssignmentListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleManagementPolicyAssignmentListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleManagementPolicyAssignment" + } + } } }, - displayNamePropertiesPrincipalDisplayName: { - serializedName: "properties.principal.displayName", - readOnly: true, - nullable: true, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -1684,159 +1804,186 @@ export const AccessReviewDecision: coreClient.CompositeMapper = { } }; -export const AccessReviewDecisionProperties: coreClient.CompositeMapper = { +export const Permission: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewDecisionProperties", + className: "Permission", modelProperties: { - recommendation: { - serializedName: "recommendation", - readOnly: true, - type: { - name: "String" - } - }, - decision: { - serializedName: "decision", + actions: { + serializedName: "actions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - justification: { - serializedName: "justification", + notActions: { + serializedName: "notActions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - reviewedDateTime: { - serializedName: "reviewedDateTime", - readOnly: true, - nullable: true, + dataActions: { + serializedName: "dataActions", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - applyResult: { - serializedName: "applyResult", - readOnly: true, + notDataActions: { + serializedName: "notDataActions", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } - }, - appliedDateTime: { - serializedName: "appliedDateTime", - readOnly: true, - nullable: true, + } + } + } +}; + +export const ApprovalSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalSettings", + modelProperties: { + isApprovalRequired: { + serializedName: "isApprovalRequired", type: { - name: "DateTime" + name: "Boolean" } }, - principalIdAppliedByPrincipalId: { - serializedName: "appliedBy.principalId", - readOnly: true, - nullable: true, + isApprovalRequiredForExtension: { + serializedName: "isApprovalRequiredForExtension", type: { - name: "String" + name: "Boolean" } }, - principalTypeAppliedByPrincipalType: { - serializedName: "appliedBy.principalType", - readOnly: true, - nullable: true, + isRequestorJustificationRequired: { + serializedName: "isRequestorJustificationRequired", type: { - name: "String" + name: "Boolean" } }, - principalNameAppliedByPrincipalName: { - serializedName: "appliedBy.principalName", - readOnly: true, - nullable: true, + approvalMode: { + serializedName: "approvalMode", type: { name: "String" } }, - userPrincipalNameAppliedByUserPrincipalName: { - serializedName: "appliedBy.userPrincipalName", - readOnly: true, - nullable: true, + approvalStages: { + serializedName: "approvalStages", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApprovalStage" + } + } } - }, - principalIdReviewedByPrincipalId: { - serializedName: "reviewedBy.principalId", - readOnly: true, - nullable: true, + } + } + } +}; + +export const ApprovalStage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalStage", + modelProperties: { + approvalStageTimeOutInDays: { + serializedName: "approvalStageTimeOutInDays", type: { - name: "String" + name: "Number" } }, - principalTypeReviewedByPrincipalType: { - serializedName: "reviewedBy.principalType", - readOnly: true, - nullable: true, + isApproverJustificationRequired: { + serializedName: "isApproverJustificationRequired", type: { - name: "String" + name: "Boolean" } }, - principalNameReviewedByPrincipalName: { - serializedName: "reviewedBy.principalName", - readOnly: true, - nullable: true, + escalationTimeInMinutes: { + serializedName: "escalationTimeInMinutes", type: { - name: "String" + name: "Number" } }, - userPrincipalNameReviewedByUserPrincipalName: { - serializedName: "reviewedBy.userPrincipalName", - readOnly: true, - nullable: true, + primaryApprovers: { + serializedName: "primaryApprovers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserSet" + } + } } }, - typeResourceType: { - serializedName: "resource.type", - nullable: true, + isEscalationEnabled: { + serializedName: "isEscalationEnabled", type: { - name: "String" + name: "Boolean" } }, - idResourceId: { - serializedName: "resource.id", - readOnly: true, - nullable: true, + escalationApprovers: { + serializedName: "escalationApprovers", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserSet" + } + } } - }, - displayNameResourceDisplayName: { - serializedName: "resource.displayName", - readOnly: true, - nullable: true, + } + } + } +}; + +export const UserSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserSet", + modelProperties: { + userType: { + serializedName: "userType", type: { name: "String" } }, - typePrincipalType: { - serializedName: "principal.type", - nullable: true, + isBackup: { + serializedName: "isBackup", type: { - name: "String" + name: "Boolean" } }, - idPrincipalId: { - serializedName: "principal.id", - readOnly: true, - nullable: true, + id: { + serializedName: "id", type: { name: "String" } }, - displayNamePrincipalDisplayName: { - serializedName: "principal.displayName", - readOnly: true, - nullable: true, + description: { + serializedName: "description", type: { name: "String" } @@ -1845,33 +1992,25 @@ export const AccessReviewDecisionProperties: coreClient.CompositeMapper = { } }; -export const AccessReviewDecisionIdentity: coreClient.CompositeMapper = { +export const RoleAssignmentScheduleFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewDecisionIdentity", - uberParent: "AccessReviewDecisionIdentity", - polymorphicDiscriminator: { - serializedName: "type", - clientName: "type" - }, + className: "RoleAssignmentScheduleFilter", modelProperties: { - type: { - serializedName: "type", - required: true, + principalId: { + serializedName: "principalId", type: { name: "String" } }, - id: { - serializedName: "id", - readOnly: true, + roleDefinitionId: { + serializedName: "roleDefinitionId", type: { name: "String" } }, - displayName: { - serializedName: "displayName", - readOnly: true, + status: { + serializedName: "status", type: { name: "String" } @@ -1880,60 +2019,31 @@ export const AccessReviewDecisionIdentity: coreClient.CompositeMapper = { } }; -export const AccessReviewDecisionResource: coreClient.CompositeMapper = { +export const RoleAssignmentScheduleInstanceFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewDecisionResource", - uberParent: "AccessReviewDecisionResource", - polymorphicDiscriminator: { - serializedName: "type", - clientName: "type" - }, + className: "RoleAssignmentScheduleInstanceFilter", modelProperties: { - type: { - serializedName: "type", - required: true, + principalId: { + serializedName: "principalId", type: { name: "String" } }, - id: { - serializedName: "id", - readOnly: true, + roleDefinitionId: { + serializedName: "roleDefinitionId", type: { name: "String" } }, - displayName: { - serializedName: "displayName", - readOnly: true, + status: { + serializedName: "status", type: { name: "String" } - } - } - } -}; - -export const AccessReviewContactedReviewerListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessReviewContactedReviewerListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessReviewContactedReviewer" - } - } - } }, - nextLink: { - serializedName: "nextLink", + roleAssignmentScheduleId: { + serializedName: "roleAssignmentScheduleId", type: { name: "String" } @@ -1942,214 +2052,222 @@ export const AccessReviewContactedReviewerListResult: coreClient.CompositeMapper } }; -export const AccessReviewContactedReviewer: coreClient.CompositeMapper = { +export const RoleAssignmentScheduleRequestFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewContactedReviewer", + className: "RoleAssignmentScheduleRequestFilter", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, + principalId: { + serializedName: "principalId", type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + roleDefinitionId: { + serializedName: "roleDefinitionId", type: { name: "String" } }, - userDisplayName: { - serializedName: "properties.userDisplayName", - readOnly: true, + requestorId: { + serializedName: "requestorId", type: { name: "String" } }, - userPrincipalName: { - serializedName: "properties.userPrincipalName", - readOnly: true, + status: { + serializedName: "status", type: { name: "String" } - }, - createdDateTime: { - serializedName: "properties.createdDateTime", - readOnly: true, - nullable: true, - type: { - name: "DateTime" - } } } } }; -export const AccessReviewDefaultSettings: coreClient.CompositeMapper = { +export const RoleEligibilityScheduleFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessReviewDefaultSettings", + className: "RoleEligibilityScheduleFilter", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + principalId: { + serializedName: "principalId", type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + roleDefinitionId: { + serializedName: "roleDefinitionId", type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + status: { + serializedName: "status", type: { name: "String" } - }, - mailNotificationsEnabled: { - serializedName: "properties.mailNotificationsEnabled", - type: { - name: "Boolean" - } - }, - reminderNotificationsEnabled: { - serializedName: "properties.reminderNotificationsEnabled", - type: { - name: "Boolean" - } - }, - defaultDecisionEnabled: { - serializedName: "properties.defaultDecisionEnabled", - type: { - name: "Boolean" - } - }, - justificationRequiredOnApproval: { - serializedName: "properties.justificationRequiredOnApproval", + } + } + } +}; + +export const RoleEligibilityScheduleInstanceFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleInstanceFilter", + modelProperties: { + principalId: { + serializedName: "principalId", type: { - name: "Boolean" + name: "String" } }, - defaultDecision: { - serializedName: "properties.defaultDecision", + roleDefinitionId: { + serializedName: "roleDefinitionId", type: { name: "String" } }, - autoApplyDecisionsEnabled: { - serializedName: "properties.autoApplyDecisionsEnabled", + status: { + serializedName: "status", type: { - name: "Boolean" + name: "String" } }, - recommendationsEnabled: { - serializedName: "properties.recommendationsEnabled", + roleEligibilityScheduleId: { + serializedName: "roleEligibilityScheduleId", type: { - name: "Boolean" + name: "String" } - }, - recommendationLookBackDuration: { - serializedName: "properties.recommendationLookBackDuration", + } + } + } +}; + +export const RoleEligibilityScheduleRequestFilter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleEligibilityScheduleRequestFilter", + modelProperties: { + principalId: { + serializedName: "principalId", type: { - name: "TimeSpan" + name: "String" } }, - instanceDurationInDays: { - serializedName: "properties.instanceDurationInDays", + roleDefinitionId: { + serializedName: "roleDefinitionId", type: { - name: "Number" + name: "String" } }, - typePropertiesRecurrenceRangeType: { - serializedName: "properties.recurrence.range.type", + requestorId: { + serializedName: "requestorId", type: { name: "String" } }, - numberOfOccurrences: { - serializedName: "properties.recurrence.range.numberOfOccurrences", + status: { + serializedName: "status", type: { - name: "Number" + name: "String" } - }, - startDate: { - serializedName: "properties.recurrence.range.startDate", - nullable: true, + } + } + } +}; + +export const RoleManagementPolicyApprovalRule: coreClient.CompositeMapper = { + serializedName: "RoleManagementPolicyApprovalRule", + type: { + name: "Composite", + className: "RoleManagementPolicyApprovalRule", + uberParent: "RoleManagementPolicyRule", + polymorphicDiscriminator: + RoleManagementPolicyRule.type.polymorphicDiscriminator, + modelProperties: { + ...RoleManagementPolicyRule.type.modelProperties, + setting: { + serializedName: "setting", type: { - name: "DateTime" + name: "Composite", + className: "ApprovalSettings" } - }, - endDate: { - serializedName: "properties.recurrence.range.endDate", - nullable: true, + } + } + } +}; + +export const RoleManagementPolicyAuthenticationContextRule: coreClient.CompositeMapper = { + serializedName: "RoleManagementPolicyAuthenticationContextRule", + type: { + name: "Composite", + className: "RoleManagementPolicyAuthenticationContextRule", + uberParent: "RoleManagementPolicyRule", + polymorphicDiscriminator: + RoleManagementPolicyRule.type.polymorphicDiscriminator, + modelProperties: { + ...RoleManagementPolicyRule.type.modelProperties, + isEnabled: { + serializedName: "isEnabled", type: { - name: "DateTime" + name: "Boolean" } }, - typePropertiesRecurrencePatternType: { - serializedName: "properties.recurrence.pattern.type", + claimValue: { + serializedName: "claimValue", type: { name: "String" } - }, - interval: { - serializedName: "properties.recurrence.pattern.interval", - type: { - name: "Number" - } } } } }; -export const AccessReviewDecisionUserIdentity: coreClient.CompositeMapper = { - serializedName: "user", +export const RoleManagementPolicyEnablementRule: coreClient.CompositeMapper = { + serializedName: "RoleManagementPolicyEnablementRule", type: { name: "Composite", - className: "AccessReviewDecisionUserIdentity", - uberParent: "AccessReviewDecisionIdentity", + className: "RoleManagementPolicyEnablementRule", + uberParent: "RoleManagementPolicyRule", polymorphicDiscriminator: - AccessReviewDecisionIdentity.type.polymorphicDiscriminator, + RoleManagementPolicyRule.type.polymorphicDiscriminator, modelProperties: { - ...AccessReviewDecisionIdentity.type.modelProperties, - userPrincipalName: { - serializedName: "userPrincipalName", - readOnly: true, + ...RoleManagementPolicyRule.type.modelProperties, + enabledRules: { + serializedName: "enabledRules", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const AccessReviewDecisionServicePrincipalIdentity: coreClient.CompositeMapper = { - serializedName: "servicePrincipal", +export const RoleManagementPolicyExpirationRule: coreClient.CompositeMapper = { + serializedName: "RoleManagementPolicyExpirationRule", type: { name: "Composite", - className: "AccessReviewDecisionServicePrincipalIdentity", - uberParent: "AccessReviewDecisionIdentity", + className: "RoleManagementPolicyExpirationRule", + uberParent: "RoleManagementPolicyRule", polymorphicDiscriminator: - AccessReviewDecisionIdentity.type.polymorphicDiscriminator, + RoleManagementPolicyRule.type.polymorphicDiscriminator, modelProperties: { - ...AccessReviewDecisionIdentity.type.modelProperties, - appId: { - serializedName: "appId", - readOnly: true, + ...RoleManagementPolicyRule.type.modelProperties, + isExpirationRequired: { + serializedName: "isExpirationRequired", + type: { + name: "Boolean" + } + }, + maximumDuration: { + serializedName: "maximumDuration", type: { name: "String" } @@ -2158,24 +2276,60 @@ export const AccessReviewDecisionServicePrincipalIdentity: coreClient.CompositeM } }; -export const AccessReviewDecisionResourceAzureRole: coreClient.CompositeMapper = { - serializedName: "azureRole", +export const RoleManagementPolicyNotificationRule: coreClient.CompositeMapper = { + serializedName: "RoleManagementPolicyNotificationRule", type: { name: "Composite", - className: "AccessReviewDecisionResourceAzureRole", - uberParent: "AccessReviewDecisionResource", + className: "RoleManagementPolicyNotificationRule", + uberParent: "RoleManagementPolicyRule", polymorphicDiscriminator: - AccessReviewDecisionResource.type.polymorphicDiscriminator, + RoleManagementPolicyRule.type.polymorphicDiscriminator, modelProperties: { - ...AccessReviewDecisionResource.type.modelProperties + ...RoleManagementPolicyRule.type.modelProperties, + notificationType: { + serializedName: "notificationType", + type: { + name: "String" + } + }, + notificationLevel: { + serializedName: "notificationLevel", + type: { + name: "String" + } + }, + recipientType: { + serializedName: "recipientType", + type: { + name: "String" + } + }, + notificationRecipients: { + serializedName: "notificationRecipients", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + isDefaultRecipientsEnabled: { + serializedName: "isDefaultRecipientsEnabled", + type: { + name: "Boolean" + } + } } } }; export let discriminators = { - AccessReviewDecisionIdentity: AccessReviewDecisionIdentity, - AccessReviewDecisionResource: AccessReviewDecisionResource, - "AccessReviewDecisionIdentity.user": AccessReviewDecisionUserIdentity, - "AccessReviewDecisionIdentity.servicePrincipal": AccessReviewDecisionServicePrincipalIdentity, - "AccessReviewDecisionResource.azureRole": AccessReviewDecisionResourceAzureRole + RoleManagementPolicyRule: RoleManagementPolicyRule, + "RoleManagementPolicyRule.RoleManagementPolicyApprovalRule": RoleManagementPolicyApprovalRule, + "RoleManagementPolicyRule.RoleManagementPolicyAuthenticationContextRule": RoleManagementPolicyAuthenticationContextRule, + "RoleManagementPolicyRule.RoleManagementPolicyEnablementRule": RoleManagementPolicyEnablementRule, + "RoleManagementPolicyRule.RoleManagementPolicyExpirationRule": RoleManagementPolicyExpirationRule, + "RoleManagementPolicyRule.RoleManagementPolicyNotificationRule": RoleManagementPolicyNotificationRule }; diff --git a/sdk/authorization/arm-authorization/src/models/parameters.ts b/sdk/authorization/arm-authorization/src/models/parameters.ts index a8dc16f96275..fee85694d879 100644 --- a/sdk/authorization/arm-authorization/src/models/parameters.ts +++ b/sdk/authorization/arm-authorization/src/models/parameters.ts @@ -12,11 +12,10 @@ import { OperationQueryParameter } from "@azure/core-client"; import { - AccessReviewHistoryDefinitionProperties as AccessReviewHistoryDefinitionPropertiesMapper, - AccessReviewScheduleDefinitionProperties as AccessReviewScheduleDefinitionPropertiesMapper, - AccessReviewInstanceProperties as AccessReviewInstancePropertiesMapper, - AccessReviewScheduleSettings as AccessReviewScheduleSettingsMapper, - AccessReviewDecisionProperties as AccessReviewDecisionPropertiesMapper + RoleAssignmentScheduleRequest as RoleAssignmentScheduleRequestMapper, + RoleEligibilityScheduleRequest as RoleEligibilityScheduleRequestMapper, + RoleManagementPolicy as RoleManagementPolicyMapper, + RoleManagementPolicyAssignment as RoleManagementPolicyAssignmentMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -43,10 +42,32 @@ export const $host: OperationURLParameter = { skipEncoding: true }; +export const scope: OperationURLParameter = { + parameterPath: "scope", + mapper: { + serializedName: "scope", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-16-preview", + defaultValue: "2020-10-01", isConstant: true, serializedName: "api-version", type: { @@ -67,10 +88,10 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const roleAssignmentScheduleName: OperationURLParameter = { + parameterPath: "roleAssignmentScheduleName", mapper: { - serializedName: "subscriptionId", + serializedName: "roleAssignmentScheduleName", required: true, type: { name: "String" @@ -78,21 +99,10 @@ export const subscriptionId: OperationURLParameter = { } }; -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String" - } - }, - skipEncoding: true -}; - -export const historyDefinitionId: OperationURLParameter = { - parameterPath: "historyDefinitionId", +export const roleAssignmentScheduleInstanceName: OperationURLParameter = { + parameterPath: "roleAssignmentScheduleInstanceName", mapper: { - serializedName: "historyDefinitionId", + serializedName: "roleAssignmentScheduleInstanceName", required: true, type: { name: "String" @@ -112,15 +122,26 @@ export const contentType: OperationParameter = { } }; -export const properties: OperationParameter = { - parameterPath: "properties", - mapper: AccessReviewHistoryDefinitionPropertiesMapper +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: RoleAssignmentScheduleRequestMapper +}; + +export const roleAssignmentScheduleRequestName: OperationURLParameter = { + parameterPath: "roleAssignmentScheduleRequestName", + mapper: { + serializedName: "roleAssignmentScheduleRequestName", + required: true, + type: { + name: "String" + } + } }; -export const instanceId: OperationURLParameter = { - parameterPath: "instanceId", +export const roleEligibilityScheduleName: OperationURLParameter = { + parameterPath: "roleEligibilityScheduleName", mapper: { - serializedName: "instanceId", + serializedName: "roleEligibilityScheduleName", required: true, type: { name: "String" @@ -128,10 +149,10 @@ export const instanceId: OperationURLParameter = { } }; -export const scheduleDefinitionId: OperationURLParameter = { - parameterPath: "scheduleDefinitionId", +export const roleEligibilityScheduleInstanceName: OperationURLParameter = { + parameterPath: "roleEligibilityScheduleInstanceName", mapper: { - serializedName: "scheduleDefinitionId", + serializedName: "roleEligibilityScheduleInstanceName", required: true, type: { name: "String" @@ -139,15 +160,15 @@ export const scheduleDefinitionId: OperationURLParameter = { } }; -export const properties1: OperationParameter = { - parameterPath: "properties", - mapper: AccessReviewScheduleDefinitionPropertiesMapper +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: RoleEligibilityScheduleRequestMapper }; -export const id: OperationURLParameter = { - parameterPath: "id", +export const roleEligibilityScheduleRequestName: OperationURLParameter = { + parameterPath: "roleEligibilityScheduleRequestName", mapper: { - serializedName: "id", + serializedName: "roleEligibilityScheduleRequestName", required: true, type: { name: "String" @@ -155,20 +176,26 @@ export const id: OperationURLParameter = { } }; -export const properties2: OperationParameter = { - parameterPath: "properties", - mapper: AccessReviewInstancePropertiesMapper +export const roleManagementPolicyName: OperationURLParameter = { + parameterPath: "roleManagementPolicyName", + mapper: { + serializedName: "roleManagementPolicyName", + required: true, + type: { + name: "String" + } + } }; -export const properties3: OperationParameter = { - parameterPath: "properties", - mapper: AccessReviewScheduleSettingsMapper +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: RoleManagementPolicyMapper }; -export const decisionId: OperationURLParameter = { - parameterPath: "decisionId", +export const roleManagementPolicyAssignmentName: OperationURLParameter = { + parameterPath: "roleManagementPolicyAssignmentName", mapper: { - serializedName: "decisionId", + serializedName: "roleManagementPolicyAssignmentName", required: true, type: { name: "String" @@ -176,7 +203,7 @@ export const decisionId: OperationURLParameter = { } }; -export const properties4: OperationParameter = { - parameterPath: "properties", - mapper: AccessReviewDecisionPropertiesMapper +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: RoleManagementPolicyAssignmentMapper }; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts deleted file mode 100644 index 58839bfa576a..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewDefaultSettingsOperations.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { AccessReviewDefaultSettingsOperations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewDefaultSettingsGetOptionalParams, - AccessReviewDefaultSettingsGetResponse, - AccessReviewScheduleSettings, - AccessReviewDefaultSettingsPutOptionalParams, - AccessReviewDefaultSettingsPutResponse -} from "../models"; - -/** Class containing AccessReviewDefaultSettingsOperations operations. */ -export class AccessReviewDefaultSettingsOperationsImpl - implements AccessReviewDefaultSettingsOperations { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewDefaultSettingsOperations class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review default settings for the subscription - * @param options The options parameters. - */ - get( - options?: AccessReviewDefaultSettingsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, getOperationSpec); - } - - /** - * Get access review default settings for the subscription - * @param properties Access review schedule settings. - * @param options The options parameters. - */ - put( - properties: AccessReviewScheduleSettings, - options?: AccessReviewDefaultSettingsPutOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { properties, options }, - putOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDefaultSettings - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const putOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDefaultSettings - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - requestBody: Parameters.properties3, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts deleted file mode 100644 index 1061170f58da..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstance.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { AccessReviewHistoryDefinitionInstance } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams, - AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse -} from "../models"; - -/** Class containing AccessReviewHistoryDefinitionInstance operations. */ -export class AccessReviewHistoryDefinitionInstanceImpl - implements AccessReviewHistoryDefinitionInstance { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewHistoryDefinitionInstance class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and - * can be retrieved by fetching the accessReviewHistoryDefinition object. - * @param historyDefinitionId The id of the access review history definition. - * @param instanceId The id of the access review history definition instance to generate a URI for. - * @param options The options parameters. - */ - generateDownloadUri( - historyDefinitionId: string, - instanceId: string, - options?: AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { historyDefinitionId, instanceId, options }, - generateDownloadUriOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const generateDownloadUriOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}/instances/{instanceId}/generateDownloadUri", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryInstance - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.historyDefinitionId, - Parameters.instanceId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts deleted file mode 100644 index 858a755b9d7f..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionInstances.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewHistoryDefinitionInstances } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewHistoryInstance, - AccessReviewHistoryDefinitionInstancesListNextOptionalParams, - AccessReviewHistoryDefinitionInstancesListOptionalParams, - AccessReviewHistoryDefinitionInstancesListResponse, - AccessReviewHistoryDefinitionInstancesListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewHistoryDefinitionInstances operations. */ -export class AccessReviewHistoryDefinitionInstancesImpl - implements AccessReviewHistoryDefinitionInstances { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewHistoryDefinitionInstances class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review history definition instances by definition Id - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - public list( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionInstancesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(historyDefinitionId, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(historyDefinitionId, options); - } - }; - } - - private async *listPagingPage( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionInstancesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(historyDefinitionId, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - historyDefinitionId, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionInstancesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - historyDefinitionId, - options - )) { - yield* page; - } - } - - /** - * Get access review history definition instances by definition Id - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - private _list( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionInstancesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { historyDefinitionId, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param historyDefinitionId The id of the access review history definition. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - historyDefinitionId: string, - nextLink: string, - options?: AccessReviewHistoryDefinitionInstancesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { historyDefinitionId, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}/instances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryDefinitionInstanceListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.historyDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryDefinitionInstanceListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.historyDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts deleted file mode 100644 index b78f8f3e5b37..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitionOperations.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { AccessReviewHistoryDefinitionOperations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewHistoryDefinitionProperties, - AccessReviewHistoryDefinitionCreateOptionalParams, - AccessReviewHistoryDefinitionCreateResponse, - AccessReviewHistoryDefinitionDeleteByIdOptionalParams -} from "../models"; - -/** Class containing AccessReviewHistoryDefinitionOperations operations. */ -export class AccessReviewHistoryDefinitionOperationsImpl - implements AccessReviewHistoryDefinitionOperations { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewHistoryDefinitionOperations class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Create a scheduled or one-time Access Review History Definition - * @param historyDefinitionId The id of the access review history definition. - * @param properties Access review history definition properties. - * @param options The options parameters. - */ - create( - historyDefinitionId: string, - properties: AccessReviewHistoryDefinitionProperties, - options?: AccessReviewHistoryDefinitionCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { historyDefinitionId, properties, options }, - createOperationSpec - ); - } - - /** - * Delete an access review history definition - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - deleteById( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionDeleteByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { historyDefinitionId, options }, - deleteByIdOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryDefinition - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - requestBody: Parameters.properties, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.historyDefinitionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const deleteByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.historyDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts deleted file mode 100644 index be4fd2dbd809..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewHistoryDefinitions.ts +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewHistoryDefinitions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewHistoryDefinition, - AccessReviewHistoryDefinitionsListNextOptionalParams, - AccessReviewHistoryDefinitionsListOptionalParams, - AccessReviewHistoryDefinitionsListResponse, - AccessReviewHistoryDefinitionsGetByIdOptionalParams, - AccessReviewHistoryDefinitionsGetByIdResponse, - AccessReviewHistoryDefinitionsListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewHistoryDefinitions operations. */ -export class AccessReviewHistoryDefinitionsImpl - implements AccessReviewHistoryDefinitions { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewHistoryDefinitions class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only - * available for 30 days after creation. - * @param options The options parameters. - */ - public list( - options?: AccessReviewHistoryDefinitionsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: AccessReviewHistoryDefinitionsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: AccessReviewHistoryDefinitionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only - * available for 30 days after creation. - * @param options The options parameters. - */ - private _list( - options?: AccessReviewHistoryDefinitionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Get access review history definition by definition Id - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - getById( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionsGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { historyDefinitionId, options }, - getByIdOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: AccessReviewHistoryDefinitionsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryDefinition - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.historyDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewHistoryDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts deleted file mode 100644 index 447d349d61c7..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceContactedReviewers.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewInstanceContactedReviewers } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewContactedReviewer, - AccessReviewInstanceContactedReviewersListNextOptionalParams, - AccessReviewInstanceContactedReviewersListOptionalParams, - AccessReviewInstanceContactedReviewersListResponse, - AccessReviewInstanceContactedReviewersListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewInstanceContactedReviewers operations. */ -export class AccessReviewInstanceContactedReviewersImpl - implements AccessReviewInstanceContactedReviewers { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewInstanceContactedReviewers class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review instance contacted reviewers - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - public list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceContactedReviewersListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scheduleDefinitionId, id, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(scheduleDefinitionId, id, options); - } - }; - } - - private async *listPagingPage( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceContactedReviewersListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(scheduleDefinitionId, id, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - scheduleDefinitionId, - id, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceContactedReviewersListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - scheduleDefinitionId, - id, - options - )) { - yield* page; - } - } - - /** - * Get access review instance contacted reviewers - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - private _list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceContactedReviewersListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - scheduleDefinitionId: string, - id: string, - nextLink: string, - options?: AccessReviewInstanceContactedReviewersListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/contactedReviewers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewContactedReviewerListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewContactedReviewerListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts deleted file mode 100644 index 279a0dcd6999..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceDecisions.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewInstanceDecisions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewDecision, - AccessReviewInstanceDecisionsListNextOptionalParams, - AccessReviewInstanceDecisionsListOptionalParams, - AccessReviewInstanceDecisionsListResponse, - AccessReviewInstanceDecisionsListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewInstanceDecisions operations. */ -export class AccessReviewInstanceDecisionsImpl - implements AccessReviewInstanceDecisions { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewInstanceDecisions class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review instance decisions - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - public list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceDecisionsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scheduleDefinitionId, id, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(scheduleDefinitionId, id, options); - } - }; - } - - private async *listPagingPage( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceDecisionsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(scheduleDefinitionId, id, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - scheduleDefinitionId, - id, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceDecisionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - scheduleDefinitionId, - id, - options - )) { - yield* page; - } - } - - /** - * Get access review instance decisions - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - private _list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceDecisionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - scheduleDefinitionId: string, - id: string, - nextLink: string, - options?: AccessReviewInstanceDecisionsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDecisionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDecisionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts deleted file mode 100644 index 1cb78a3324c6..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceMyDecisions.ts +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewInstanceMyDecisions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewDecision, - AccessReviewInstanceMyDecisionsListNextOptionalParams, - AccessReviewInstanceMyDecisionsListOptionalParams, - AccessReviewInstanceMyDecisionsListResponse, - AccessReviewInstanceMyDecisionsGetByIdOptionalParams, - AccessReviewInstanceMyDecisionsGetByIdResponse, - AccessReviewDecisionProperties, - AccessReviewInstanceMyDecisionsPatchOptionalParams, - AccessReviewInstanceMyDecisionsPatchResponse, - AccessReviewInstanceMyDecisionsListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewInstanceMyDecisions operations. */ -export class AccessReviewInstanceMyDecisionsImpl - implements AccessReviewInstanceMyDecisions { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewInstanceMyDecisions class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get my access review instance decisions. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - public list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceMyDecisionsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scheduleDefinitionId, id, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(scheduleDefinitionId, id, options); - } - }; - } - - private async *listPagingPage( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceMyDecisionsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(scheduleDefinitionId, id, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - scheduleDefinitionId, - id, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceMyDecisionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - scheduleDefinitionId, - id, - options - )) { - yield* page; - } - } - - /** - * Get my access review instance decisions. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - private _list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceMyDecisionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - listOperationSpec - ); - } - - /** - * Get my single access review instance decision. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param decisionId The id of the decision record. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - id: string, - decisionId: string, - options?: AccessReviewInstanceMyDecisionsGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, decisionId, options }, - getByIdOperationSpec - ); - } - - /** - * Record a decision. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param decisionId The id of the decision record. - * @param properties Access review decision properties to patch. - * @param options The options parameters. - */ - patch( - scheduleDefinitionId: string, - id: string, - decisionId: string, - properties: AccessReviewDecisionProperties, - options?: AccessReviewInstanceMyDecisionsPatchOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, decisionId, properties, options }, - patchOperationSpec - ); - } - - /** - * ListNext - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - scheduleDefinitionId: string, - id: string, - nextLink: string, - options?: AccessReviewInstanceMyDecisionsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDecisionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions/{decisionId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDecision - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scheduleDefinitionId, - Parameters.id, - Parameters.decisionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const patchOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/decisions/{decisionId}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDecision - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - requestBody: Parameters.properties4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scheduleDefinitionId, - Parameters.id, - Parameters.decisionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewDecisionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts deleted file mode 100644 index f05466471bf4..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewInstanceOperations.ts +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { AccessReviewInstanceOperations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewInstanceStopOptionalParams, - AccessReviewInstanceResetDecisionsOptionalParams, - AccessReviewInstanceApplyDecisionsOptionalParams, - AccessReviewInstanceSendRemindersOptionalParams, - AccessReviewInstanceAcceptRecommendationsOptionalParams -} from "../models"; - -/** Class containing AccessReviewInstanceOperations operations. */ -export class AccessReviewInstanceOperationsImpl - implements AccessReviewInstanceOperations { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewInstanceOperations class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * An action to stop an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - stop( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceStopOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - stopOperationSpec - ); - } - - /** - * An action to reset all decisions for an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - resetDecisions( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceResetDecisionsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - resetDecisionsOperationSpec - ); - } - - /** - * An action to apply all decisions for an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - applyDecisions( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceApplyDecisionsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - applyDecisionsOperationSpec - ); - } - - /** - * An action to send reminders for an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - sendReminders( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceSendRemindersOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - sendRemindersOperationSpec - ); - } - - /** - * An action to accept recommendations for decision in an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - acceptRecommendations( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceAcceptRecommendationsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - acceptRecommendationsOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const stopOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/stop", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const resetDecisionsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/resetDecisions", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const applyDecisionsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/applyDecisions", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const sendRemindersOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/sendReminders", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const acceptRecommendationsOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/acceptRecommendations", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts deleted file mode 100644 index 70922c853751..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewInstances.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewInstances } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewInstance, - AccessReviewInstancesListNextOptionalParams, - AccessReviewInstancesListOptionalParams, - AccessReviewInstancesListResponse, - AccessReviewInstancesGetByIdOptionalParams, - AccessReviewInstancesGetByIdResponse, - AccessReviewInstanceProperties, - AccessReviewInstancesCreateOptionalParams, - AccessReviewInstancesCreateResponse, - AccessReviewInstancesListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewInstances operations. */ -export class AccessReviewInstancesImpl implements AccessReviewInstances { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewInstances class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review instances - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - public list( - scheduleDefinitionId: string, - options?: AccessReviewInstancesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scheduleDefinitionId, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(scheduleDefinitionId, options); - } - }; - } - - private async *listPagingPage( - scheduleDefinitionId: string, - options?: AccessReviewInstancesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(scheduleDefinitionId, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - scheduleDefinitionId, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - scheduleDefinitionId: string, - options?: AccessReviewInstancesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - scheduleDefinitionId, - options - )) { - yield* page; - } - } - - /** - * Get access review instances - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - private _list( - scheduleDefinitionId: string, - options?: AccessReviewInstancesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, options }, - listOperationSpec - ); - } - - /** - * Get access review instances - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstancesGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - getByIdOperationSpec - ); - } - - /** - * Update access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param properties Access review instance properties. - * @param options The options parameters. - */ - create( - scheduleDefinitionId: string, - id: string, - properties: AccessReviewInstanceProperties, - options?: AccessReviewInstancesCreateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, properties, options }, - createOperationSpec - ); - } - - /** - * ListNext - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - scheduleDefinitionId: string, - nextLink: string, - options?: AccessReviewInstancesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstanceListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstance - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstance - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - requestBody: Parameters.properties2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstanceListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts deleted file mode 100644 index dd65a2600972..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewInstancesAssignedForMyApproval.ts +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewInstancesAssignedForMyApproval } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewInstance, - AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams, - AccessReviewInstancesAssignedForMyApprovalListOptionalParams, - AccessReviewInstancesAssignedForMyApprovalListResponse, - AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams, - AccessReviewInstancesAssignedForMyApprovalGetByIdResponse, - AccessReviewInstancesAssignedForMyApprovalListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewInstancesAssignedForMyApproval operations. */ -export class AccessReviewInstancesAssignedForMyApprovalImpl - implements AccessReviewInstancesAssignedForMyApproval { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewInstancesAssignedForMyApproval class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review instances assigned for my approval. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - public list( - scheduleDefinitionId: string, - options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scheduleDefinitionId, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(scheduleDefinitionId, options); - } - }; - } - - private async *listPagingPage( - scheduleDefinitionId: string, - options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(scheduleDefinitionId, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - scheduleDefinitionId, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - scheduleDefinitionId: string, - options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - scheduleDefinitionId, - options - )) { - yield* page; - } - } - - /** - * Get access review instances assigned for my approval. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - private _list( - scheduleDefinitionId: string, - options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, options }, - listOperationSpec - ); - } - - /** - * Get single access review instance assigned for my approval. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - getByIdOperationSpec - ); - } - - /** - * ListNext - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - scheduleDefinitionId: string, - nextLink: string, - options?: AccessReviewInstancesAssignedForMyApprovalListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstanceListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.scheduleDefinitionId], - headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstance - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewInstanceListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts deleted file mode 100644 index 455682d885e8..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitions.ts +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewScheduleDefinitions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewScheduleDefinition, - AccessReviewScheduleDefinitionsListNextOptionalParams, - AccessReviewScheduleDefinitionsListOptionalParams, - AccessReviewScheduleDefinitionsListResponse, - AccessReviewScheduleDefinitionsGetByIdOptionalParams, - AccessReviewScheduleDefinitionsGetByIdResponse, - AccessReviewScheduleDefinitionsDeleteByIdOptionalParams, - AccessReviewScheduleDefinitionProperties, - AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams, - AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse, - AccessReviewScheduleDefinitionsStopOptionalParams, - AccessReviewScheduleDefinitionsListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewScheduleDefinitions operations. */ -export class AccessReviewScheduleDefinitionsImpl - implements AccessReviewScheduleDefinitions { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewScheduleDefinitions class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review schedule definitions - * @param options The options parameters. - */ - public list( - options?: AccessReviewScheduleDefinitionsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: AccessReviewScheduleDefinitionsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: AccessReviewScheduleDefinitionsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Get access review schedule definitions - * @param options The options parameters. - */ - private _list( - options?: AccessReviewScheduleDefinitionsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Get single access review definition - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - options?: AccessReviewScheduleDefinitionsGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, options }, - getByIdOperationSpec - ); - } - - /** - * Delete access review schedule definition - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - deleteById( - scheduleDefinitionId: string, - options?: AccessReviewScheduleDefinitionsDeleteByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, options }, - deleteByIdOperationSpec - ); - } - - /** - * Create or Update access review schedule definition. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param properties Access review schedule definition properties. - * @param options The options parameters. - */ - createOrUpdateById( - scheduleDefinitionId: string, - properties: AccessReviewScheduleDefinitionProperties, - options?: AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, properties, options }, - createOrUpdateByIdOperationSpec - ); - } - - /** - * Stop access review definition - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - stop( - scheduleDefinitionId: string, - options?: AccessReviewScheduleDefinitionsStopOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, options }, - stopOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: AccessReviewScheduleDefinitionsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewScheduleDefinition - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateByIdOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewScheduleDefinition - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - requestBody: Parameters.properties1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const stopOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/stop", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.scheduleDefinitionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts deleted file mode 100644 index 0f55d5eace36..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/accessReviewScheduleDefinitionsAssignedForMyApproval.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { AccessReviewScheduleDefinitionsAssignedForMyApproval } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewScheduleDefinition, - AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams, - AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, - AccessReviewScheduleDefinitionsAssignedForMyApprovalListResponse, - AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse -} from "../models"; - -/// -/** Class containing AccessReviewScheduleDefinitionsAssignedForMyApproval operations. */ -export class AccessReviewScheduleDefinitionsAssignedForMyApprovalImpl - implements AccessReviewScheduleDefinitionsAssignedForMyApproval { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class AccessReviewScheduleDefinitionsAssignedForMyApproval class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review instances assigned for my approval. - * @param options The options parameters. - */ - public list( - options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Get access review instances assigned for my approval. - * @param options The options parameters. - */ - private _list( - options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextOptionalParams - ): Promise< - AccessReviewScheduleDefinitionsAssignedForMyApprovalListNextResponse - > { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewScheduleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts b/sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts new file mode 100644 index 000000000000..d9e0359c041e --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/eligibleChildResources.ts @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EligibleChildResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + EligibleChildResource, + EligibleChildResourcesGetNextOptionalParams, + EligibleChildResourcesGetOptionalParams, + EligibleChildResourcesGetResponse, + EligibleChildResourcesGetNextResponse +} from "../models"; + +/// +/** Class containing EligibleChildResources operations. */ +export class EligibleChildResourcesImpl implements EligibleChildResources { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class EligibleChildResources class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Get the child resources of a resource on which user has eligible access + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + public list( + scope: string, + options?: EligibleChildResourcesGetOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.getPagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getPagingPage(scope, options); + } + }; + } + + private async *getPagingPage( + scope: string, + options?: EligibleChildResourcesGetOptionalParams + ): AsyncIterableIterator { + let result = await this._get(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._getNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *getPagingAll( + scope: string, + options?: EligibleChildResourcesGetOptionalParams + ): AsyncIterableIterator { + for await (const page of this.getPagingPage(scope, options)) { + yield* page; + } + } + + /** + * Get the child resources of a resource on which user has eligible access + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + private _get( + scope: string, + options?: EligibleChildResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + getOperationSpec + ); + } + + /** + * GetNext + * @param scope The scope of the role management policy. + * @param nextLink The nextLink from the previous successful call to the Get method. + * @param options The options parameters. + */ + private _getNext( + scope: string, + nextLink: string, + options?: EligibleChildResourcesGetNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + getNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EligibleChildResourcesListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const getNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EligibleChildResourcesListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/index.ts b/sdk/authorization/arm-authorization/src/operations/index.ts index 7fa7646d62a8..6e3e69a1df5f 100644 --- a/sdk/authorization/arm-authorization/src/operations/index.ts +++ b/sdk/authorization/arm-authorization/src/operations/index.ts @@ -6,18 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; -export * from "./accessReviewHistoryDefinitions"; -export * from "./accessReviewHistoryDefinitionOperations"; -export * from "./accessReviewHistoryDefinitionInstance"; -export * from "./accessReviewHistoryDefinitionInstances"; -export * from "./accessReviewScheduleDefinitions"; -export * from "./accessReviewInstances"; -export * from "./accessReviewInstanceOperations"; -export * from "./accessReviewInstanceDecisions"; -export * from "./accessReviewInstanceContactedReviewers"; -export * from "./accessReviewDefaultSettingsOperations"; -export * from "./accessReviewScheduleDefinitionsAssignedForMyApproval"; -export * from "./accessReviewInstancesAssignedForMyApproval"; -export * from "./accessReviewInstanceMyDecisions"; -export * from "./tenantLevelAccessReviewInstanceContactedReviewers"; +export * from "./eligibleChildResources"; +export * from "./roleAssignmentSchedules"; +export * from "./roleAssignmentScheduleInstances"; +export * from "./roleAssignmentScheduleRequests"; +export * from "./roleEligibilitySchedules"; +export * from "./roleEligibilityScheduleInstances"; +export * from "./roleEligibilityScheduleRequests"; +export * from "./roleManagementPolicies"; +export * from "./roleManagementPolicyAssignments"; diff --git a/sdk/authorization/arm-authorization/src/operations/operations.ts b/sdk/authorization/arm-authorization/src/operations/operations.ts deleted file mode 100644 index dc058f45933d..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/operations.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse -} from "../models"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Lists the operations available from this provider. - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists the operations available from this provider. - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Authorization/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts new file mode 100644 index 000000000000..dfe59da601da --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleInstances.ts @@ -0,0 +1,191 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleAssignmentScheduleInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleAssignmentScheduleInstance, + RoleAssignmentScheduleInstancesListForScopeNextOptionalParams, + RoleAssignmentScheduleInstancesListForScopeOptionalParams, + RoleAssignmentScheduleInstancesListForScopeResponse, + RoleAssignmentScheduleInstancesGetOptionalParams, + RoleAssignmentScheduleInstancesGetResponse, + RoleAssignmentScheduleInstancesListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleAssignmentScheduleInstances operations. */ +export class RoleAssignmentScheduleInstancesImpl + implements RoleAssignmentScheduleInstances { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleAssignmentScheduleInstances class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * @param scope The scope of the role assignment schedule. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * @param scope The scope of the role assignment schedule. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * Gets the specified role assignment schedule instance. + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role + * assignment schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleAssignmentScheduleInstanceName: string, + options?: RoleAssignmentScheduleInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleAssignmentScheduleInstanceName, options }, + getOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role assignment schedule. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleAssignmentScheduleInstancesListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleInstanceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleInstance + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleAssignmentScheduleInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleInstanceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts new file mode 100644 index 000000000000..e126c5c75ae4 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleAssignmentScheduleRequests.ts @@ -0,0 +1,321 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleAssignmentScheduleRequests } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleAssignmentScheduleRequest, + RoleAssignmentScheduleRequestsListForScopeNextOptionalParams, + RoleAssignmentScheduleRequestsListForScopeOptionalParams, + RoleAssignmentScheduleRequestsCreateOptionalParams, + RoleAssignmentScheduleRequestsCreateResponse, + RoleAssignmentScheduleRequestsGetOptionalParams, + RoleAssignmentScheduleRequestsGetResponse, + RoleAssignmentScheduleRequestsListForScopeResponse, + RoleAssignmentScheduleRequestsCancelOptionalParams, + RoleAssignmentScheduleRequestsValidateOptionalParams, + RoleAssignmentScheduleRequestsValidateResponse, + RoleAssignmentScheduleRequestsListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleAssignmentScheduleRequests operations. */ +export class RoleAssignmentScheduleRequestsImpl + implements RoleAssignmentScheduleRequests { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleAssignmentScheduleRequests class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role assignment schedule requests for a scope. + * @param scope The scope of the role assignments schedule requests. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Creates a role assignment schedule request. + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST + * resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be + * unique and different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @param options The options parameters. + */ + create( + scope: string, + roleAssignmentScheduleRequestName: string, + parameters: RoleAssignmentScheduleRequest, + options?: RoleAssignmentScheduleRequestsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleAssignmentScheduleRequestName, parameters, options }, + createOperationSpec + ); + } + + /** + * Get the specified role assignment schedule request. + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to + * get. + * @param options The options parameters. + */ + get( + scope: string, + roleAssignmentScheduleRequestName: string, + options?: RoleAssignmentScheduleRequestsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleAssignmentScheduleRequestName, options }, + getOperationSpec + ); + } + + /** + * Gets role assignment schedule requests for a scope. + * @param scope The scope of the role assignments schedule requests. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * Cancels a pending role assignment schedule request. + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @param options The options parameters. + */ + cancel( + scope: string, + roleAssignmentScheduleRequestName: string, + options?: RoleAssignmentScheduleRequestsCancelOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleAssignmentScheduleRequestName, options }, + cancelOperationSpec + ); + } + + /** + * Validates a new role assignment schedule request. + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @param options The options parameters. + */ + validate( + scope: string, + roleAssignmentScheduleRequestName: string, + parameters: RoleAssignmentScheduleRequest, + options?: RoleAssignmentScheduleRequestsValidateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleAssignmentScheduleRequestName, parameters, options }, + validateOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role assignments schedule requests. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleAssignmentScheduleRequestsListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + httpMethod: "PUT", + responses: { + 201: { + bodyMapper: Mappers.RoleAssignmentScheduleRequest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleAssignmentScheduleRequestName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleRequest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleAssignmentScheduleRequestName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleRequestListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleAssignmentScheduleRequestName + ], + headerParameters: [Parameters.accept], + serializer +}; +const validateOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/validate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleRequest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleAssignmentScheduleRequestName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleRequestListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts b/sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts new file mode 100644 index 000000000000..8028f48c8df2 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleAssignmentSchedules.ts @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleAssignmentSchedules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleAssignmentSchedule, + RoleAssignmentSchedulesListForScopeNextOptionalParams, + RoleAssignmentSchedulesListForScopeOptionalParams, + RoleAssignmentSchedulesGetOptionalParams, + RoleAssignmentSchedulesGetResponse, + RoleAssignmentSchedulesListForScopeResponse, + RoleAssignmentSchedulesListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleAssignmentSchedules operations. */ +export class RoleAssignmentSchedulesImpl implements RoleAssignmentSchedules { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleAssignmentSchedules class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role assignment schedules for a resource scope. + * @param scope The scope of the role assignments schedules. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleAssignmentSchedulesListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleAssignmentSchedulesListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleAssignmentSchedulesListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Get the specified role assignment schedule for a resource scope + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleAssignmentScheduleName: string, + options?: RoleAssignmentSchedulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleAssignmentScheduleName, options }, + getOperationSpec + ); + } + + /** + * Gets role assignment schedules for a resource scope. + * @param scope The scope of the role assignments schedules. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleAssignmentSchedulesListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role assignments schedules. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleAssignmentSchedulesListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentSchedule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleAssignmentScheduleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleAssignmentScheduleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts new file mode 100644 index 000000000000..ee592af7ecd1 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleInstances.ts @@ -0,0 +1,191 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleEligibilityScheduleInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleEligibilityScheduleInstance, + RoleEligibilityScheduleInstancesListForScopeNextOptionalParams, + RoleEligibilityScheduleInstancesListForScopeOptionalParams, + RoleEligibilityScheduleInstancesListForScopeResponse, + RoleEligibilityScheduleInstancesGetOptionalParams, + RoleEligibilityScheduleInstancesGetResponse, + RoleEligibilityScheduleInstancesListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleEligibilityScheduleInstances operations. */ +export class RoleEligibilityScheduleInstancesImpl + implements RoleEligibilityScheduleInstances { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleEligibilityScheduleInstances class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * @param scope The scope of the role eligibility schedule. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * @param scope The scope of the role eligibility schedule. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * Gets the specified role eligibility schedule instance. + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role + * eligibility schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleEligibilityScheduleInstanceName: string, + options?: RoleEligibilityScheduleInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleEligibilityScheduleInstanceName, options }, + getOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role eligibility schedule. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleEligibilityScheduleInstancesListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleInstanceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleInstance + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleEligibilityScheduleInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleInstanceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts new file mode 100644 index 000000000000..c09af0a25a1e --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleEligibilityScheduleRequests.ts @@ -0,0 +1,321 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleEligibilityScheduleRequests } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleEligibilityScheduleRequest, + RoleEligibilityScheduleRequestsListForScopeNextOptionalParams, + RoleEligibilityScheduleRequestsListForScopeOptionalParams, + RoleEligibilityScheduleRequestsCreateOptionalParams, + RoleEligibilityScheduleRequestsCreateResponse, + RoleEligibilityScheduleRequestsGetOptionalParams, + RoleEligibilityScheduleRequestsGetResponse, + RoleEligibilityScheduleRequestsListForScopeResponse, + RoleEligibilityScheduleRequestsCancelOptionalParams, + RoleEligibilityScheduleRequestsValidateOptionalParams, + RoleEligibilityScheduleRequestsValidateResponse, + RoleEligibilityScheduleRequestsListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleEligibilityScheduleRequests operations. */ +export class RoleEligibilityScheduleRequestsImpl + implements RoleEligibilityScheduleRequests { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleEligibilityScheduleRequests class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role eligibility schedule requests for a scope. + * @param scope The scope of the role eligibility schedule requests. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Creates a role eligibility schedule request. + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST + * resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any + * valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @param options The options parameters. + */ + create( + scope: string, + roleEligibilityScheduleRequestName: string, + parameters: RoleEligibilityScheduleRequest, + options?: RoleEligibilityScheduleRequestsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleEligibilityScheduleRequestName, parameters, options }, + createOperationSpec + ); + } + + /** + * Get the specified role eligibility schedule request. + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request + * to get. + * @param options The options parameters. + */ + get( + scope: string, + roleEligibilityScheduleRequestName: string, + options?: RoleEligibilityScheduleRequestsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleEligibilityScheduleRequestName, options }, + getOperationSpec + ); + } + + /** + * Gets role eligibility schedule requests for a scope. + * @param scope The scope of the role eligibility schedule requests. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * Cancels a pending role eligibility schedule request. + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @param options The options parameters. + */ + cancel( + scope: string, + roleEligibilityScheduleRequestName: string, + options?: RoleEligibilityScheduleRequestsCancelOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleEligibilityScheduleRequestName, options }, + cancelOperationSpec + ); + } + + /** + * Validates a new role eligibility schedule request. + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @param options The options parameters. + */ + validate( + scope: string, + roleEligibilityScheduleRequestName: string, + parameters: RoleEligibilityScheduleRequest, + options?: RoleEligibilityScheduleRequestsValidateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleEligibilityScheduleRequestName, parameters, options }, + validateOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role eligibility schedule requests. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleEligibilityScheduleRequestsListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + httpMethod: "PUT", + responses: { + 201: { + bodyMapper: Mappers.RoleEligibilityScheduleRequest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleEligibilityScheduleRequestName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleRequest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleEligibilityScheduleRequestName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleRequestListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleEligibilityScheduleRequestName + ], + headerParameters: [Parameters.accept], + serializer +}; +const validateOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/validate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleRequest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleEligibilityScheduleRequestName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleRequestListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts b/sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts new file mode 100644 index 000000000000..5fe490239643 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleEligibilitySchedules.ts @@ -0,0 +1,188 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleEligibilitySchedules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleEligibilitySchedule, + RoleEligibilitySchedulesListForScopeNextOptionalParams, + RoleEligibilitySchedulesListForScopeOptionalParams, + RoleEligibilitySchedulesGetOptionalParams, + RoleEligibilitySchedulesGetResponse, + RoleEligibilitySchedulesListForScopeResponse, + RoleEligibilitySchedulesListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleEligibilitySchedules operations. */ +export class RoleEligibilitySchedulesImpl implements RoleEligibilitySchedules { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleEligibilitySchedules class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role eligibility schedules for a resource scope. + * @param scope The scope of the role eligibility schedules. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleEligibilitySchedulesListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleEligibilitySchedulesListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleEligibilitySchedulesListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Get the specified role eligibility schedule for a resource scope + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleEligibilityScheduleName: string, + options?: RoleEligibilitySchedulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleEligibilityScheduleName, options }, + getOperationSpec + ); + } + + /** + * Gets role eligibility schedules for a resource scope. + * @param scope The scope of the role eligibility schedules. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleEligibilitySchedulesListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role eligibility schedules. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleEligibilitySchedulesListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilitySchedule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleEligibilityScheduleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleEligibilityScheduleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts b/sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts new file mode 100644 index 000000000000..25df44604806 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleManagementPolicies.ts @@ -0,0 +1,270 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleManagementPolicies } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleManagementPolicy, + RoleManagementPoliciesListForScopeNextOptionalParams, + RoleManagementPoliciesListForScopeOptionalParams, + RoleManagementPoliciesGetOptionalParams, + RoleManagementPoliciesGetResponse, + RoleManagementPoliciesUpdateOptionalParams, + RoleManagementPoliciesUpdateResponse, + RoleManagementPoliciesDeleteOptionalParams, + RoleManagementPoliciesListForScopeResponse, + RoleManagementPoliciesListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleManagementPolicies operations. */ +export class RoleManagementPoliciesImpl implements RoleManagementPolicies { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleManagementPolicies class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role management policies for a resource scope. + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleManagementPoliciesListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleManagementPoliciesListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleManagementPoliciesListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Get the specified role management policy for a resource scope + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @param options The options parameters. + */ + get( + scope: string, + roleManagementPolicyName: string, + options?: RoleManagementPoliciesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleManagementPolicyName, options }, + getOperationSpec + ); + } + + /** + * Update a role management policy + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @param options The options parameters. + */ + update( + scope: string, + roleManagementPolicyName: string, + parameters: RoleManagementPolicy, + options?: RoleManagementPoliciesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleManagementPolicyName, parameters, options }, + updateOperationSpec + ); + } + + /** + * Delete a role management policy + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param options The options parameters. + */ + delete( + scope: string, + roleManagementPolicyName: string, + options?: RoleManagementPoliciesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleManagementPolicyName, options }, + deleteOperationSpec + ); + } + + /** + * Gets role management policies for a resource scope. + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleManagementPoliciesListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role management policy. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleManagementPoliciesListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicy + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleManagementPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicy + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleManagementPolicyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleManagementPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicyListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicyListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts b/sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts new file mode 100644 index 000000000000..6aa52c331b30 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operations/roleManagementPolicyAssignments.ts @@ -0,0 +1,275 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RoleManagementPolicyAssignments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AuthorizationManagementClient } from "../authorizationManagementClient"; +import { + RoleManagementPolicyAssignment, + RoleManagementPolicyAssignmentsListForScopeNextOptionalParams, + RoleManagementPolicyAssignmentsListForScopeOptionalParams, + RoleManagementPolicyAssignmentsGetOptionalParams, + RoleManagementPolicyAssignmentsGetResponse, + RoleManagementPolicyAssignmentsCreateOptionalParams, + RoleManagementPolicyAssignmentsCreateResponse, + RoleManagementPolicyAssignmentsDeleteOptionalParams, + RoleManagementPolicyAssignmentsListForScopeResponse, + RoleManagementPolicyAssignmentsListForScopeNextResponse +} from "../models"; + +/// +/** Class containing RoleManagementPolicyAssignments operations. */ +export class RoleManagementPolicyAssignmentsImpl + implements RoleManagementPolicyAssignments { + private readonly client: AuthorizationManagementClient; + + /** + * Initialize a new instance of the class RoleManagementPolicyAssignments class. + * @param client Reference to the service client + */ + constructor(client: AuthorizationManagementClient) { + this.client = client; + } + + /** + * Gets role management assignment policies for a resource scope. + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + public listForScope( + scope: string, + options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForScopePagingAll(scope, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listForScopePagingPage(scope, options); + } + }; + } + + private async *listForScopePagingPage( + scope: string, + options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams + ): AsyncIterableIterator { + let result = await this._listForScope(scope, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listForScopeNext(scope, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listForScopePagingAll( + scope: string, + options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForScopePagingPage(scope, options)) { + yield* page; + } + } + + /** + * Get the specified role management policy assignment for a resource scope + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy + * assignment to get. + * @param options The options parameters. + */ + get( + scope: string, + roleManagementPolicyAssignmentName: string, + options?: RoleManagementPolicyAssignmentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleManagementPolicyAssignmentName, options }, + getOperationSpec + ); + } + + /** + * Create a role management policy assignment + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy + * assignment to upsert. + * @param parameters Parameters for the role management policy assignment. + * @param options The options parameters. + */ + create( + scope: string, + roleManagementPolicyAssignmentName: string, + parameters: RoleManagementPolicyAssignment, + options?: RoleManagementPolicyAssignmentsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleManagementPolicyAssignmentName, parameters, options }, + createOperationSpec + ); + } + + /** + * Delete a role management policy assignment + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy + * assignment to delete. + * @param options The options parameters. + */ + delete( + scope: string, + roleManagementPolicyAssignmentName: string, + options?: RoleManagementPolicyAssignmentsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, roleManagementPolicyAssignmentName, options }, + deleteOperationSpec + ); + } + + /** + * Gets role management assignment policies for a resource scope. + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + private _listForScope( + scope: string, + options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listForScopeOperationSpec + ); + } + + /** + * ListForScopeNext + * @param scope The scope of the role management policy. + * @param nextLink The nextLink from the previous successful call to the ListForScope method. + * @param options The options parameters. + */ + private _listForScopeNext( + scope: string, + nextLink: string, + options?: RoleManagementPolicyAssignmentsListForScopeNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listForScopeNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicyAssignment + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleManagementPolicyAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + httpMethod: "PUT", + responses: { + 201: { + bodyMapper: Mappers.RoleManagementPolicyAssignment + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleManagementPolicyAssignmentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.roleManagementPolicyAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope], + headerParameters: [Parameters.accept], + serializer +}; +const listForScopeNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RoleManagementPolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts deleted file mode 100644 index f4319fa7350d..000000000000 --- a/sdk/authorization/arm-authorization/src/operations/tenantLevelAccessReviewInstanceContactedReviewers.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { TenantLevelAccessReviewInstanceContactedReviewers } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { AuthorizationManagementClient } from "../authorizationManagementClient"; -import { - AccessReviewContactedReviewer, - TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams, - TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams, - TenantLevelAccessReviewInstanceContactedReviewersListResponse, - TenantLevelAccessReviewInstanceContactedReviewersListNextResponse -} from "../models"; - -/// -/** Class containing TenantLevelAccessReviewInstanceContactedReviewers operations. */ -export class TenantLevelAccessReviewInstanceContactedReviewersImpl - implements TenantLevelAccessReviewInstanceContactedReviewers { - private readonly client: AuthorizationManagementClient; - - /** - * Initialize a new instance of the class TenantLevelAccessReviewInstanceContactedReviewers class. - * @param client Reference to the service client - */ - constructor(client: AuthorizationManagementClient) { - this.client = client; - } - - /** - * Get access review instance contacted reviewers - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - public list( - scheduleDefinitionId: string, - id: string, - options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scheduleDefinitionId, id, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(scheduleDefinitionId, id, options); - } - }; - } - - private async *listPagingPage( - scheduleDefinitionId: string, - id: string, - options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(scheduleDefinitionId, id, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext( - scheduleDefinitionId, - id, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - scheduleDefinitionId: string, - id: string, - options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - scheduleDefinitionId, - id, - options - )) { - yield* page; - } - } - - /** - * Get access review instance contacted reviewers - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - private _list( - scheduleDefinitionId: string, - id: string, - options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - scheduleDefinitionId: string, - id: string, - nextLink: string, - options?: TenantLevelAccessReviewInstanceContactedReviewersListNextOptionalParams - ): Promise< - TenantLevelAccessReviewInstanceContactedReviewersListNextResponse - > { - return this.client.sendOperationRequest( - { scheduleDefinitionId, id, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}/contactedReviewers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewContactedReviewerListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AccessReviewContactedReviewerListResult - }, - default: { - bodyMapper: Mappers.ErrorDefinition - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.scheduleDefinitionId, - Parameters.id - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts deleted file mode 100644 index 71fc31da58f5..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewDefaultSettingsOperations.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - AccessReviewDefaultSettingsGetOptionalParams, - AccessReviewDefaultSettingsGetResponse, - AccessReviewScheduleSettings, - AccessReviewDefaultSettingsPutOptionalParams, - AccessReviewDefaultSettingsPutResponse -} from "../models"; - -/** Interface representing a AccessReviewDefaultSettingsOperations. */ -export interface AccessReviewDefaultSettingsOperations { - /** - * Get access review default settings for the subscription - * @param options The options parameters. - */ - get( - options?: AccessReviewDefaultSettingsGetOptionalParams - ): Promise; - /** - * Get access review default settings for the subscription - * @param properties Access review schedule settings. - * @param options The options parameters. - */ - put( - properties: AccessReviewScheduleSettings, - options?: AccessReviewDefaultSettingsPutOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts deleted file mode 100644 index 4d77716ecc2f..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstance.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams, - AccessReviewHistoryDefinitionInstanceGenerateDownloadUriResponse -} from "../models"; - -/** Interface representing a AccessReviewHistoryDefinitionInstance. */ -export interface AccessReviewHistoryDefinitionInstance { - /** - * Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and - * can be retrieved by fetching the accessReviewHistoryDefinition object. - * @param historyDefinitionId The id of the access review history definition. - * @param instanceId The id of the access review history definition instance to generate a URI for. - * @param options The options parameters. - */ - generateDownloadUri( - historyDefinitionId: string, - instanceId: string, - options?: AccessReviewHistoryDefinitionInstanceGenerateDownloadUriOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts deleted file mode 100644 index 1549ff379e98..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionInstances.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewHistoryInstance, - AccessReviewHistoryDefinitionInstancesListOptionalParams -} from "../models"; - -/// -/** Interface representing a AccessReviewHistoryDefinitionInstances. */ -export interface AccessReviewHistoryDefinitionInstances { - /** - * Get access review history definition instances by definition Id - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - list( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionInstancesListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts deleted file mode 100644 index dfda80c1b829..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitionOperations.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - AccessReviewHistoryDefinitionProperties, - AccessReviewHistoryDefinitionCreateOptionalParams, - AccessReviewHistoryDefinitionCreateResponse, - AccessReviewHistoryDefinitionDeleteByIdOptionalParams -} from "../models"; - -/** Interface representing a AccessReviewHistoryDefinitionOperations. */ -export interface AccessReviewHistoryDefinitionOperations { - /** - * Create a scheduled or one-time Access Review History Definition - * @param historyDefinitionId The id of the access review history definition. - * @param properties Access review history definition properties. - * @param options The options parameters. - */ - create( - historyDefinitionId: string, - properties: AccessReviewHistoryDefinitionProperties, - options?: AccessReviewHistoryDefinitionCreateOptionalParams - ): Promise; - /** - * Delete an access review history definition - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - deleteById( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionDeleteByIdOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts deleted file mode 100644 index 4c1896b8172d..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewHistoryDefinitions.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewHistoryDefinition, - AccessReviewHistoryDefinitionsListOptionalParams, - AccessReviewHistoryDefinitionsGetByIdOptionalParams, - AccessReviewHistoryDefinitionsGetByIdResponse -} from "../models"; - -/// -/** Interface representing a AccessReviewHistoryDefinitions. */ -export interface AccessReviewHistoryDefinitions { - /** - * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only - * available for 30 days after creation. - * @param options The options parameters. - */ - list( - options?: AccessReviewHistoryDefinitionsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get access review history definition by definition Id - * @param historyDefinitionId The id of the access review history definition. - * @param options The options parameters. - */ - getById( - historyDefinitionId: string, - options?: AccessReviewHistoryDefinitionsGetByIdOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts deleted file mode 100644 index 5d9cd938cae5..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceContactedReviewers.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewContactedReviewer, - AccessReviewInstanceContactedReviewersListOptionalParams -} from "../models"; - -/// -/** Interface representing a AccessReviewInstanceContactedReviewers. */ -export interface AccessReviewInstanceContactedReviewers { - /** - * Get access review instance contacted reviewers - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceContactedReviewersListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts deleted file mode 100644 index df1e4cdfc6e6..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceDecisions.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewDecision, - AccessReviewInstanceDecisionsListOptionalParams -} from "../models"; - -/// -/** Interface representing a AccessReviewInstanceDecisions. */ -export interface AccessReviewInstanceDecisions { - /** - * Get access review instance decisions - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceDecisionsListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts deleted file mode 100644 index 7f2013cc6608..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceMyDecisions.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewDecision, - AccessReviewInstanceMyDecisionsListOptionalParams, - AccessReviewInstanceMyDecisionsGetByIdOptionalParams, - AccessReviewInstanceMyDecisionsGetByIdResponse, - AccessReviewDecisionProperties, - AccessReviewInstanceMyDecisionsPatchOptionalParams, - AccessReviewInstanceMyDecisionsPatchResponse -} from "../models"; - -/// -/** Interface representing a AccessReviewInstanceMyDecisions. */ -export interface AccessReviewInstanceMyDecisions { - /** - * Get my access review instance decisions. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - list( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceMyDecisionsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get my single access review instance decision. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param decisionId The id of the decision record. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - id: string, - decisionId: string, - options?: AccessReviewInstanceMyDecisionsGetByIdOptionalParams - ): Promise; - /** - * Record a decision. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param decisionId The id of the decision record. - * @param properties Access review decision properties to patch. - * @param options The options parameters. - */ - patch( - scheduleDefinitionId: string, - id: string, - decisionId: string, - properties: AccessReviewDecisionProperties, - options?: AccessReviewInstanceMyDecisionsPatchOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts deleted file mode 100644 index 0faef402bebd..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstanceOperations.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - AccessReviewInstanceStopOptionalParams, - AccessReviewInstanceResetDecisionsOptionalParams, - AccessReviewInstanceApplyDecisionsOptionalParams, - AccessReviewInstanceSendRemindersOptionalParams, - AccessReviewInstanceAcceptRecommendationsOptionalParams -} from "../models"; - -/** Interface representing a AccessReviewInstanceOperations. */ -export interface AccessReviewInstanceOperations { - /** - * An action to stop an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - stop( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceStopOptionalParams - ): Promise; - /** - * An action to reset all decisions for an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - resetDecisions( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceResetDecisionsOptionalParams - ): Promise; - /** - * An action to apply all decisions for an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - applyDecisions( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceApplyDecisionsOptionalParams - ): Promise; - /** - * An action to send reminders for an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - sendReminders( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceSendRemindersOptionalParams - ): Promise; - /** - * An action to accept recommendations for decision in an access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - acceptRecommendations( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstanceAcceptRecommendationsOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts deleted file mode 100644 index 540b9fa5218c..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstances.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewInstance, - AccessReviewInstancesListOptionalParams, - AccessReviewInstancesGetByIdOptionalParams, - AccessReviewInstancesGetByIdResponse, - AccessReviewInstanceProperties, - AccessReviewInstancesCreateOptionalParams, - AccessReviewInstancesCreateResponse -} from "../models"; - -/// -/** Interface representing a AccessReviewInstances. */ -export interface AccessReviewInstances { - /** - * Get access review instances - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - list( - scheduleDefinitionId: string, - options?: AccessReviewInstancesListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get access review instances - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstancesGetByIdOptionalParams - ): Promise; - /** - * Update access review instance. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param properties Access review instance properties. - * @param options The options parameters. - */ - create( - scheduleDefinitionId: string, - id: string, - properties: AccessReviewInstanceProperties, - options?: AccessReviewInstancesCreateOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts deleted file mode 100644 index 86e51cc51c0e..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewInstancesAssignedForMyApproval.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewInstance, - AccessReviewInstancesAssignedForMyApprovalListOptionalParams, - AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams, - AccessReviewInstancesAssignedForMyApprovalGetByIdResponse -} from "../models"; - -/// -/** Interface representing a AccessReviewInstancesAssignedForMyApproval. */ -export interface AccessReviewInstancesAssignedForMyApproval { - /** - * Get access review instances assigned for my approval. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - list( - scheduleDefinitionId: string, - options?: AccessReviewInstancesAssignedForMyApprovalListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get single access review instance assigned for my approval. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - id: string, - options?: AccessReviewInstancesAssignedForMyApprovalGetByIdOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts deleted file mode 100644 index 972f1705680c..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitions.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewScheduleDefinition, - AccessReviewScheduleDefinitionsListOptionalParams, - AccessReviewScheduleDefinitionsGetByIdOptionalParams, - AccessReviewScheduleDefinitionsGetByIdResponse, - AccessReviewScheduleDefinitionsDeleteByIdOptionalParams, - AccessReviewScheduleDefinitionProperties, - AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams, - AccessReviewScheduleDefinitionsCreateOrUpdateByIdResponse, - AccessReviewScheduleDefinitionsStopOptionalParams -} from "../models"; - -/// -/** Interface representing a AccessReviewScheduleDefinitions. */ -export interface AccessReviewScheduleDefinitions { - /** - * Get access review schedule definitions - * @param options The options parameters. - */ - list( - options?: AccessReviewScheduleDefinitionsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get single access review definition - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - getById( - scheduleDefinitionId: string, - options?: AccessReviewScheduleDefinitionsGetByIdOptionalParams - ): Promise; - /** - * Delete access review schedule definition - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - deleteById( - scheduleDefinitionId: string, - options?: AccessReviewScheduleDefinitionsDeleteByIdOptionalParams - ): Promise; - /** - * Create or Update access review schedule definition. - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param properties Access review schedule definition properties. - * @param options The options parameters. - */ - createOrUpdateById( - scheduleDefinitionId: string, - properties: AccessReviewScheduleDefinitionProperties, - options?: AccessReviewScheduleDefinitionsCreateOrUpdateByIdOptionalParams - ): Promise; - /** - * Stop access review definition - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param options The options parameters. - */ - stop( - scheduleDefinitionId: string, - options?: AccessReviewScheduleDefinitionsStopOptionalParams - ): Promise; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts deleted file mode 100644 index 6f00935f1250..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/accessReviewScheduleDefinitionsAssignedForMyApproval.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewScheduleDefinition, - AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams -} from "../models"; - -/// -/** Interface representing a AccessReviewScheduleDefinitionsAssignedForMyApproval. */ -export interface AccessReviewScheduleDefinitionsAssignedForMyApproval { - /** - * Get access review instances assigned for my approval. - * @param options The options parameters. - */ - list( - options?: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts new file mode 100644 index 000000000000..e4d88d125602 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/eligibleChildResources.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + EligibleChildResource, + EligibleChildResourcesGetOptionalParams +} from "../models"; + +/// +/** Interface representing a EligibleChildResources. */ +export interface EligibleChildResources { + /** + * Get the child resources of a resource on which user has eligible access + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + list( + scope: string, + options?: EligibleChildResourcesGetOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts index 7fa7646d62a8..6e3e69a1df5f 100644 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/index.ts @@ -6,18 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; -export * from "./accessReviewHistoryDefinitions"; -export * from "./accessReviewHistoryDefinitionOperations"; -export * from "./accessReviewHistoryDefinitionInstance"; -export * from "./accessReviewHistoryDefinitionInstances"; -export * from "./accessReviewScheduleDefinitions"; -export * from "./accessReviewInstances"; -export * from "./accessReviewInstanceOperations"; -export * from "./accessReviewInstanceDecisions"; -export * from "./accessReviewInstanceContactedReviewers"; -export * from "./accessReviewDefaultSettingsOperations"; -export * from "./accessReviewScheduleDefinitionsAssignedForMyApproval"; -export * from "./accessReviewInstancesAssignedForMyApproval"; -export * from "./accessReviewInstanceMyDecisions"; -export * from "./tenantLevelAccessReviewInstanceContactedReviewers"; +export * from "./eligibleChildResources"; +export * from "./roleAssignmentSchedules"; +export * from "./roleAssignmentScheduleInstances"; +export * from "./roleAssignmentScheduleRequests"; +export * from "./roleEligibilitySchedules"; +export * from "./roleEligibilityScheduleInstances"; +export * from "./roleEligibilityScheduleRequests"; +export * from "./roleManagementPolicies"; +export * from "./roleManagementPolicyAssignments"; diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts deleted file mode 100644 index 92a4da30855a..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists the operations available from this provider. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts new file mode 100644 index 000000000000..6e839fde6303 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleInstances.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleAssignmentScheduleInstance, + RoleAssignmentScheduleInstancesListForScopeOptionalParams, + RoleAssignmentScheduleInstancesGetOptionalParams, + RoleAssignmentScheduleInstancesGetResponse +} from "../models"; + +/// +/** Interface representing a RoleAssignmentScheduleInstances. */ +export interface RoleAssignmentScheduleInstances { + /** + * Gets role assignment schedule instances of a role assignment schedule. + * @param scope The scope of the role assignment schedule. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleAssignmentScheduleInstancesListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified role assignment schedule instance. + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role + * assignment schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleAssignmentScheduleInstanceName: string, + options?: RoleAssignmentScheduleInstancesGetOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts new file mode 100644 index 000000000000..ddf1bb78ef4e --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentScheduleRequests.ts @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleAssignmentScheduleRequest, + RoleAssignmentScheduleRequestsListForScopeOptionalParams, + RoleAssignmentScheduleRequestsCreateOptionalParams, + RoleAssignmentScheduleRequestsCreateResponse, + RoleAssignmentScheduleRequestsGetOptionalParams, + RoleAssignmentScheduleRequestsGetResponse, + RoleAssignmentScheduleRequestsCancelOptionalParams, + RoleAssignmentScheduleRequestsValidateOptionalParams, + RoleAssignmentScheduleRequestsValidateResponse +} from "../models"; + +/// +/** Interface representing a RoleAssignmentScheduleRequests. */ +export interface RoleAssignmentScheduleRequests { + /** + * Gets role assignment schedule requests for a scope. + * @param scope The scope of the role assignments schedule requests. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleAssignmentScheduleRequestsListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates a role assignment schedule request. + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST + * resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be + * unique and different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @param options The options parameters. + */ + create( + scope: string, + roleAssignmentScheduleRequestName: string, + parameters: RoleAssignmentScheduleRequest, + options?: RoleAssignmentScheduleRequestsCreateOptionalParams + ): Promise; + /** + * Get the specified role assignment schedule request. + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to + * get. + * @param options The options parameters. + */ + get( + scope: string, + roleAssignmentScheduleRequestName: string, + options?: RoleAssignmentScheduleRequestsGetOptionalParams + ): Promise; + /** + * Cancels a pending role assignment schedule request. + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @param options The options parameters. + */ + cancel( + scope: string, + roleAssignmentScheduleRequestName: string, + options?: RoleAssignmentScheduleRequestsCancelOptionalParams + ): Promise; + /** + * Validates a new role assignment schedule request. + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @param options The options parameters. + */ + validate( + scope: string, + roleAssignmentScheduleRequestName: string, + parameters: RoleAssignmentScheduleRequest, + options?: RoleAssignmentScheduleRequestsValidateOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts new file mode 100644 index 000000000000..860f62c3bfda --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleAssignmentSchedules.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleAssignmentSchedule, + RoleAssignmentSchedulesListForScopeOptionalParams, + RoleAssignmentSchedulesGetOptionalParams, + RoleAssignmentSchedulesGetResponse +} from "../models"; + +/// +/** Interface representing a RoleAssignmentSchedules. */ +export interface RoleAssignmentSchedules { + /** + * Gets role assignment schedules for a resource scope. + * @param scope The scope of the role assignments schedules. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleAssignmentSchedulesListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the specified role assignment schedule for a resource scope + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleAssignmentScheduleName: string, + options?: RoleAssignmentSchedulesGetOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts new file mode 100644 index 000000000000..a749afd71b39 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleInstances.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleEligibilityScheduleInstance, + RoleEligibilityScheduleInstancesListForScopeOptionalParams, + RoleEligibilityScheduleInstancesGetOptionalParams, + RoleEligibilityScheduleInstancesGetResponse +} from "../models"; + +/// +/** Interface representing a RoleEligibilityScheduleInstances. */ +export interface RoleEligibilityScheduleInstances { + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * @param scope The scope of the role eligibility schedule. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleEligibilityScheduleInstancesListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified role eligibility schedule instance. + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role + * eligibility schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleEligibilityScheduleInstanceName: string, + options?: RoleEligibilityScheduleInstancesGetOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts new file mode 100644 index 000000000000..469f04796775 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilityScheduleRequests.ts @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleEligibilityScheduleRequest, + RoleEligibilityScheduleRequestsListForScopeOptionalParams, + RoleEligibilityScheduleRequestsCreateOptionalParams, + RoleEligibilityScheduleRequestsCreateResponse, + RoleEligibilityScheduleRequestsGetOptionalParams, + RoleEligibilityScheduleRequestsGetResponse, + RoleEligibilityScheduleRequestsCancelOptionalParams, + RoleEligibilityScheduleRequestsValidateOptionalParams, + RoleEligibilityScheduleRequestsValidateResponse +} from "../models"; + +/// +/** Interface representing a RoleEligibilityScheduleRequests. */ +export interface RoleEligibilityScheduleRequests { + /** + * Gets role eligibility schedule requests for a scope. + * @param scope The scope of the role eligibility schedule requests. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleEligibilityScheduleRequestsListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates a role eligibility schedule request. + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST + * resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any + * valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @param options The options parameters. + */ + create( + scope: string, + roleEligibilityScheduleRequestName: string, + parameters: RoleEligibilityScheduleRequest, + options?: RoleEligibilityScheduleRequestsCreateOptionalParams + ): Promise; + /** + * Get the specified role eligibility schedule request. + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request + * to get. + * @param options The options parameters. + */ + get( + scope: string, + roleEligibilityScheduleRequestName: string, + options?: RoleEligibilityScheduleRequestsGetOptionalParams + ): Promise; + /** + * Cancels a pending role eligibility schedule request. + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @param options The options parameters. + */ + cancel( + scope: string, + roleEligibilityScheduleRequestName: string, + options?: RoleEligibilityScheduleRequestsCancelOptionalParams + ): Promise; + /** + * Validates a new role eligibility schedule request. + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @param options The options parameters. + */ + validate( + scope: string, + roleEligibilityScheduleRequestName: string, + parameters: RoleEligibilityScheduleRequest, + options?: RoleEligibilityScheduleRequestsValidateOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts new file mode 100644 index 000000000000..7a8e00368b23 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleEligibilitySchedules.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleEligibilitySchedule, + RoleEligibilitySchedulesListForScopeOptionalParams, + RoleEligibilitySchedulesGetOptionalParams, + RoleEligibilitySchedulesGetResponse +} from "../models"; + +/// +/** Interface representing a RoleEligibilitySchedules. */ +export interface RoleEligibilitySchedules { + /** + * Gets role eligibility schedules for a resource scope. + * @param scope The scope of the role eligibility schedules. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleEligibilitySchedulesListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the specified role eligibility schedule for a resource scope + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @param options The options parameters. + */ + get( + scope: string, + roleEligibilityScheduleName: string, + options?: RoleEligibilitySchedulesGetOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts new file mode 100644 index 000000000000..1f9ef62fd721 --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicies.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleManagementPolicy, + RoleManagementPoliciesListForScopeOptionalParams, + RoleManagementPoliciesGetOptionalParams, + RoleManagementPoliciesGetResponse, + RoleManagementPoliciesUpdateOptionalParams, + RoleManagementPoliciesUpdateResponse, + RoleManagementPoliciesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a RoleManagementPolicies. */ +export interface RoleManagementPolicies { + /** + * Gets role management policies for a resource scope. + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleManagementPoliciesListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the specified role management policy for a resource scope + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @param options The options parameters. + */ + get( + scope: string, + roleManagementPolicyName: string, + options?: RoleManagementPoliciesGetOptionalParams + ): Promise; + /** + * Update a role management policy + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @param options The options parameters. + */ + update( + scope: string, + roleManagementPolicyName: string, + parameters: RoleManagementPolicy, + options?: RoleManagementPoliciesUpdateOptionalParams + ): Promise; + /** + * Delete a role management policy + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param options The options parameters. + */ + delete( + scope: string, + roleManagementPolicyName: string, + options?: RoleManagementPoliciesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts new file mode 100644 index 000000000000..04743a2ae06d --- /dev/null +++ b/sdk/authorization/arm-authorization/src/operationsInterfaces/roleManagementPolicyAssignments.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RoleManagementPolicyAssignment, + RoleManagementPolicyAssignmentsListForScopeOptionalParams, + RoleManagementPolicyAssignmentsGetOptionalParams, + RoleManagementPolicyAssignmentsGetResponse, + RoleManagementPolicyAssignmentsCreateOptionalParams, + RoleManagementPolicyAssignmentsCreateResponse, + RoleManagementPolicyAssignmentsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a RoleManagementPolicyAssignments. */ +export interface RoleManagementPolicyAssignments { + /** + * Gets role management assignment policies for a resource scope. + * @param scope The scope of the role management policy. + * @param options The options parameters. + */ + listForScope( + scope: string, + options?: RoleManagementPolicyAssignmentsListForScopeOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the specified role management policy assignment for a resource scope + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy + * assignment to get. + * @param options The options parameters. + */ + get( + scope: string, + roleManagementPolicyAssignmentName: string, + options?: RoleManagementPolicyAssignmentsGetOptionalParams + ): Promise; + /** + * Create a role management policy assignment + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy + * assignment to upsert. + * @param parameters Parameters for the role management policy assignment. + * @param options The options parameters. + */ + create( + scope: string, + roleManagementPolicyAssignmentName: string, + parameters: RoleManagementPolicyAssignment, + options?: RoleManagementPolicyAssignmentsCreateOptionalParams + ): Promise; + /** + * Delete a role management policy assignment + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy + * assignment to delete. + * @param options The options parameters. + */ + delete( + scope: string, + roleManagementPolicyAssignmentName: string, + options?: RoleManagementPolicyAssignmentsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts b/sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts deleted file mode 100644 index e7b93a374851..000000000000 --- a/sdk/authorization/arm-authorization/src/operationsInterfaces/tenantLevelAccessReviewInstanceContactedReviewers.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AccessReviewContactedReviewer, - TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams -} from "../models"; - -/// -/** Interface representing a TenantLevelAccessReviewInstanceContactedReviewers. */ -export interface TenantLevelAccessReviewInstanceContactedReviewers { - /** - * Get access review instance contacted reviewers - * @param scheduleDefinitionId The id of the access review schedule definition. - * @param id The id of the access review instance. - * @param options The options parameters. - */ - list( - scheduleDefinitionId: string, - id: string, - options?: TenantLevelAccessReviewInstanceContactedReviewersListOptionalParams - ): PagedAsyncIterableIterator; -} From 3ec5fa8215c38218d1c59186f0ba164a8cec09c4 Mon Sep 17 00:00:00 2001 From: zsgwwj Date: Tue, 12 Apr 2022 09:24:25 +0800 Subject: [PATCH 3/3] update --- .../accessReviewDefaultSettingsGetSample.ts | 28 ---- .../accessReviewDefaultSettingsPutSample.ts | 34 ----- ...cessReviewHistoryDefinitionCreateSample.ts | 36 ------ ...ReviewHistoryDefinitionDeleteByIdSample.ts | 31 ----- ...nitionInstanceGenerateDownloadUriSample.ts | 33 ----- ...iewHistoryDefinitionInstancesListSample.ts | 34 ----- ...ssReviewHistoryDefinitionsGetByIdSample.ts | 31 ----- ...ccessReviewHistoryDefinitionsListSample.ts | 31 ----- ...viewInstanceAcceptRecommendationsSample.ts | 33 ----- ...ccessReviewInstanceApplyDecisionsSample.ts | 33 ----- ...iewInstanceContactedReviewersListSample.ts | 36 ------ ...accessReviewInstanceDecisionsListSample.ts | 36 ------ ...sReviewInstanceMyDecisionsGetByIdSample.ts | 35 ----- ...cessReviewInstanceMyDecisionsListSample.ts | 36 ------ ...essReviewInstanceMyDecisionsPatchSample.ts | 40 ------ ...ccessReviewInstanceResetDecisionsSample.ts | 33 ----- ...accessReviewInstanceSendRemindersSample.ts | 33 ----- .../accessReviewInstanceStopSample.ts | 33 ----- ...ancesAssignedForMyApprovalGetByIdSample.ts | 33 ----- ...nstancesAssignedForMyApprovalListSample.ts | 42 ------ .../accessReviewInstancesCreateSample.ts | 38 ------ .../accessReviewInstancesGetByIdSample.ts | 33 ----- .../accessReviewInstancesListSample.ts | 34 ----- ...initionsAssignedForMyApprovalListSample.ts | 40 ------ ...duleDefinitionsCreateOrUpdateByIdSample.ts | 36 ------ ...viewScheduleDefinitionsDeleteByIdSample.ts | 31 ----- ...sReviewScheduleDefinitionsGetByIdSample.ts | 31 ----- ...cessReviewScheduleDefinitionsListSample.ts | 31 ----- ...cessReviewScheduleDefinitionsStopSample.ts | 31 ----- ...iewInstanceContactedReviewersListSample.ts | 36 ------ .../samples/v9/javascript/README.md | 122 +++++------------- .../accessReviewDefaultSettingsGetSample.js | 28 ---- .../accessReviewDefaultSettingsPutSample.js | 29 ----- ...cessReviewHistoryDefinitionCreateSample.js | 33 ----- ...ReviewHistoryDefinitionDeleteByIdSample.js | 31 ----- ...nitionInstanceGenerateDownloadUriSample.js | 33 ----- ...iewHistoryDefinitionInstancesListSample.js | 32 ----- ...ssReviewHistoryDefinitionsGetByIdSample.js | 29 ----- ...ccessReviewHistoryDefinitionsListSample.js | 31 ----- ...viewInstanceAcceptRecommendationsSample.js | 33 ----- ...ccessReviewInstanceApplyDecisionsSample.js | 33 ----- ...iewInstanceContactedReviewersListSample.js | 36 ------ ...accessReviewInstanceDecisionsListSample.js | 33 ----- ...sReviewInstanceMyDecisionsGetByIdSample.js | 35 ----- ...cessReviewInstanceMyDecisionsListSample.js | 33 ----- ...essReviewInstanceMyDecisionsPatchSample.js | 37 ------ ...ccessReviewInstanceResetDecisionsSample.js | 33 ----- ...accessReviewInstanceSendRemindersSample.js | 33 ----- .../accessReviewInstanceStopSample.js | 30 ----- ...ancesAssignedForMyApprovalGetByIdSample.js | 33 ----- ...nstancesAssignedForMyApprovalListSample.js | 39 ------ .../accessReviewInstancesCreateSample.js | 31 ----- .../accessReviewInstancesGetByIdSample.js | 30 ----- .../accessReviewInstancesListSample.js | 32 ----- ...initionsAssignedForMyApprovalListSample.js | 37 ------ ...duleDefinitionsCreateOrUpdateByIdSample.js | 33 ----- ...viewScheduleDefinitionsDeleteByIdSample.js | 29 ----- ...sReviewScheduleDefinitionsGetByIdSample.js | 29 ----- ...cessReviewScheduleDefinitionsListSample.js | 31 ----- ...cessReviewScheduleDefinitionsStopSample.js | 29 ----- ...iewInstanceContactedReviewersListSample.js | 36 ------ .../samples/v9/typescript/README.md | 122 +++++------------- .../accessReviewDefaultSettingsGetSample.ts | 28 ---- .../accessReviewDefaultSettingsPutSample.ts | 34 ----- ...cessReviewHistoryDefinitionCreateSample.ts | 36 ------ ...ReviewHistoryDefinitionDeleteByIdSample.ts | 31 ----- ...nitionInstanceGenerateDownloadUriSample.ts | 33 ----- ...iewHistoryDefinitionInstancesListSample.ts | 34 ----- ...ssReviewHistoryDefinitionsGetByIdSample.ts | 31 ----- ...ccessReviewHistoryDefinitionsListSample.ts | 31 ----- ...viewInstanceAcceptRecommendationsSample.ts | 33 ----- ...ccessReviewInstanceApplyDecisionsSample.ts | 33 ----- ...iewInstanceContactedReviewersListSample.ts | 36 ------ ...accessReviewInstanceDecisionsListSample.ts | 36 ------ ...sReviewInstanceMyDecisionsGetByIdSample.ts | 35 ----- ...cessReviewInstanceMyDecisionsListSample.ts | 36 ------ ...essReviewInstanceMyDecisionsPatchSample.ts | 40 ------ ...ccessReviewInstanceResetDecisionsSample.ts | 33 ----- ...accessReviewInstanceSendRemindersSample.ts | 33 ----- .../src/accessReviewInstanceStopSample.ts | 33 ----- ...ancesAssignedForMyApprovalGetByIdSample.ts | 33 ----- ...nstancesAssignedForMyApprovalListSample.ts | 42 ------ .../src/accessReviewInstancesCreateSample.ts | 38 ------ .../src/accessReviewInstancesGetByIdSample.ts | 33 ----- .../src/accessReviewInstancesListSample.ts | 34 ----- ...initionsAssignedForMyApprovalListSample.ts | 40 ------ ...duleDefinitionsCreateOrUpdateByIdSample.ts | 36 ------ ...viewScheduleDefinitionsDeleteByIdSample.ts | 31 ----- ...sReviewScheduleDefinitionsGetByIdSample.ts | 31 ----- ...cessReviewScheduleDefinitionsListSample.ts | 31 ----- ...cessReviewScheduleDefinitionsStopSample.ts | 31 ----- ...iewInstanceContactedReviewersListSample.ts | 36 ------ 92 files changed, 62 insertions(+), 3197 deletions(-) delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts delete mode 100644 sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts deleted file mode 100644 index a0b0a43a56de..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsGetSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review default settings for the subscription - * - * @summary Get access review default settings for the subscription - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json - */ -async function getAccessReviewDefaultSettings() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewDefaultSettingsOperations.get(); - console.log(result); -} - -getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts deleted file mode 100644 index 50cedccdcf86..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewDefaultSettingsPutSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewScheduleSettings, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review default settings for the subscription - * - * @summary Get access review default settings for the subscription - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json - */ -async function putAccessReviewDefaultSettings() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties: AccessReviewScheduleSettings = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewDefaultSettingsOperations.put( - properties - ); - console.log(result); -} - -putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts deleted file mode 100644 index e39c7cb0970e..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionCreateSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewHistoryDefinitionProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition - * - * @summary Create a scheduled or one-time Access Review History Definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json - */ -async function putAccessReviewHistoryDefinition() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const properties: AccessReviewHistoryDefinitionProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionOperations.create( - historyDefinitionId, - properties - ); - console.log(result); -} - -putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts deleted file mode 100644 index 69fa585d77b7..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionDeleteByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete an access review history definition - * - * @summary Delete an access review history definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json - */ -async function deleteAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionOperations.deleteById( - historyDefinitionId - ); - console.log(result); -} - -deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts deleted file mode 100644 index cc30aaaef9c2..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. - * - * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json - */ -async function postAccessReviewHistoryDefinitionInstance() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( - historyDefinitionId, - instanceId - ); - console.log(result); -} - -postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts deleted file mode 100644 index f58b44160d78..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionInstancesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review history definition instances by definition Id - * - * @summary Get access review history definition instances by definition Id - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json - */ -async function getAccessReviewHistoryDefinitionInstances() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewHistoryDefinitionInstances.list( - historyDefinitionId - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts deleted file mode 100644 index b3ac5f469101..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsGetByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review history definition by definition Id - * - * @summary Get access review history definition by definition Id - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json - */ -async function getAccessReviewHistoryDefinition() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitions.getById( - historyDefinitionId - ); - console.log(result); -} - -getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts deleted file mode 100644 index de8ee5a79dbe..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewHistoryDefinitionsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. - * - * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json - */ -async function getAccessReviewHistoryDefinitions() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewHistoryDefinitions.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts deleted file mode 100644 index e881a9757421..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceAcceptRecommendationsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. - * - * @summary An action to accept recommendations for decision in an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json - */ -async function accessReviewInstanceAcceptRecommmendations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.acceptRecommendations( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts deleted file mode 100644 index 8ee8addf9757..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceApplyDecisionsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to apply all decisions for an access review instance. - * - * @summary An action to apply all decisions for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json - */ -async function accessReviewInstanceApplyDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.applyDecisions( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts deleted file mode 100644 index f5545dce25cb..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceContactedReviewersListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instance contacted reviewers - * - * @summary Get access review instance contacted reviewers - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json - */ -async function getAccessReviewInstanceContactedReviewers() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceContactedReviewers.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts deleted file mode 100644 index d308e1577a91..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceDecisionsListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instance decisions - * - * @summary Get access review instance decisions - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json - */ -async function getAccessReviewInstanceDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceDecisions.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts deleted file mode 100644 index 098083ac906b..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsGetByIdSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get my single access review instance decision. - * - * @summary Get my single access review instance decision. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json - */ -async function getAccessReviewMyInstanceDecision() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceMyDecisions.getById( - scheduleDefinitionId, - id, - decisionId - ); - console.log(result); -} - -getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts deleted file mode 100644 index b1e50fddef13..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get my access review instance decisions. - * - * @summary Get my access review instance decisions. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json - */ -async function getAccessReviewMyInstanceDecisions() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceMyDecisions.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts deleted file mode 100644 index de192912a02f..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceMyDecisionsPatchSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewDecisionProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Record a decision. - * - * @summary Record a decision. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json - */ -async function patchAccessReviewMyInstanceDecision() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties: AccessReviewDecisionProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceMyDecisions.patch( - scheduleDefinitionId, - id, - decisionId, - properties - ); - console.log(result); -} - -patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts deleted file mode 100644 index 4e3d76961b8d..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceResetDecisionsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to reset all decisions for an access review instance. - * - * @summary An action to reset all decisions for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json - */ -async function accessReviewInstanceResetDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.resetDecisions( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts deleted file mode 100644 index 11ddd932ee2d..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceSendRemindersSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to send reminders for an access review instance. - * - * @summary An action to send reminders for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json - */ -async function accessReviewInstanceSendReminders() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.sendReminders( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts deleted file mode 100644 index 815e5afc5b27..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstanceStopSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to stop an access review instance. - * - * @summary An action to stop an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json - */ -async function accessReviewInstanceStop() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.stop( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts deleted file mode 100644 index 471034e44cfd..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get single access review instance assigned for my approval. - * - * @summary Get single access review instance assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json - */ -async function getAccessReviewInstanceAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstancesAssignedForMyApproval.getById( - scheduleDefinitionId, - id - ); - console.log(result); -} - -getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts deleted file mode 100644 index c4e9d9a65597..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesAssignedForMyApprovalListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewInstancesAssignedForMyApprovalListOptionalParams, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances assigned for my approval. - * - * @summary Get access review instances assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json - */ -async function getAccessReviewInstancesAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const filter = "assignedToMeToReview()"; - const options: AccessReviewInstancesAssignedForMyApprovalListOptionalParams = { - filter - }; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( - scheduleDefinitionId, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts deleted file mode 100644 index 87d00acf9361..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesCreateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewInstanceProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Update access review instance. - * - * @summary Update access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json - */ -async function putAccessReviewInstance() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const properties: AccessReviewInstanceProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstances.create( - scheduleDefinitionId, - id, - properties - ); - console.log(result); -} - -putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts deleted file mode 100644 index 6ccfa758845e..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesGetByIdSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances - * - * @summary Get access review instances - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json - */ -async function getAccessReviewInstance() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstances.getById( - scheduleDefinitionId, - id - ); - console.log(result); -} - -getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts deleted file mode 100644 index 5b8b8fb65158..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewInstancesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances - * - * @summary Get access review instances - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json - */ -async function getAccessReviewInstances() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstances.list( - scheduleDefinitionId - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts deleted file mode 100644 index 30af9e3d7312..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances assigned for my approval. - * - * @summary Get access review instances assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json - */ -async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = "assignedToMeToReview()"; - const options: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams = { - filter - }; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts deleted file mode 100644 index d6be116ded62..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewScheduleDefinitionProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or Update access review schedule definition. - * - * @summary Create or Update access review schedule definition. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json - */ -async function putAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties: AccessReviewScheduleDefinitionProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( - scheduleDefinitionId, - properties - ); - console.log(result); -} - -putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts deleted file mode 100644 index 3b8be5f31b06..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsDeleteByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete access review schedule definition - * - * @summary Delete access review schedule definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json - */ -async function deleteAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.deleteById( - scheduleDefinitionId - ); - console.log(result); -} - -deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts deleted file mode 100644 index d6fd1ca463af..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsGetByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get single access review definition - * - * @summary Get single access review definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json - */ -async function getAccessReviewScheduleDefinition() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.getById( - scheduleDefinitionId - ); - console.log(result); -} - -getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts deleted file mode 100644 index c65d11e35ed1..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review schedule definitions - * - * @summary Get access review schedule definitions - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json - */ -async function getAccessReviewScheduleDefinitions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewScheduleDefinitions.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts b/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts deleted file mode 100644 index a0c6c4c55e32..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/accessReviewScheduleDefinitionsStopSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Stop access review definition - * - * @summary Stop access review definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json - */ -async function accessReviewScheduleDefinitionStop() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.stop( - scheduleDefinitionId - ); - console.log(result); -} - -accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts deleted file mode 100644 index 208201a4fc3c..000000000000 --- a/sdk/authorization/arm-authorization/samples-dev/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instance contacted reviewers - * - * @summary Get access review instance contacted reviewers - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json - */ -async function tenantLevelGetAccessReviewInstanceContactedReviewers() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/README.md b/sdk/authorization/arm-authorization/samples/v9/javascript/README.md index 533ce11644f6..70843854307e 100644 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/README.md +++ b/sdk/authorization/arm-authorization/samples/v9/javascript/README.md @@ -2,65 +2,35 @@ These sample programs show how to use the JavaScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accessReviewDefaultSettingsGetSample.js][accessreviewdefaultsettingsgetsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json | -| [accessReviewDefaultSettingsPutSample.js][accessreviewdefaultsettingsputsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json | -| [accessReviewHistoryDefinitionCreateSample.js][accessreviewhistorydefinitioncreatesample] | Create a scheduled or one-time Access Review History Definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json | -| [accessReviewHistoryDefinitionDeleteByIdSample.js][accessreviewhistorydefinitiondeletebyidsample] | Delete an access review history definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json | -| [accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js][accessreviewhistorydefinitioninstancegeneratedownloadurisample] | Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json | -| [accessReviewHistoryDefinitionInstancesListSample.js][accessreviewhistorydefinitioninstanceslistsample] | Get access review history definition instances by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json | -| [accessReviewHistoryDefinitionsGetByIdSample.js][accessreviewhistorydefinitionsgetbyidsample] | Get access review history definition by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json | -| [accessReviewHistoryDefinitionsListSample.js][accessreviewhistorydefinitionslistsample] | Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json | -| [accessReviewInstanceAcceptRecommendationsSample.js][accessreviewinstanceacceptrecommendationssample] | An action to accept recommendations for decision in an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json | -| [accessReviewInstanceApplyDecisionsSample.js][accessreviewinstanceapplydecisionssample] | An action to apply all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json | -| [accessReviewInstanceContactedReviewersListSample.js][accessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json | -| [accessReviewInstanceDecisionsListSample.js][accessreviewinstancedecisionslistsample] | Get access review instance decisions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json | -| [accessReviewInstanceMyDecisionsGetByIdSample.js][accessreviewinstancemydecisionsgetbyidsample] | Get my single access review instance decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json | -| [accessReviewInstanceMyDecisionsListSample.js][accessreviewinstancemydecisionslistsample] | Get my access review instance decisions. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json | -| [accessReviewInstanceMyDecisionsPatchSample.js][accessreviewinstancemydecisionspatchsample] | Record a decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json | -| [accessReviewInstanceResetDecisionsSample.js][accessreviewinstanceresetdecisionssample] | An action to reset all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json | -| [accessReviewInstanceSendRemindersSample.js][accessreviewinstancesendreminderssample] | An action to send reminders for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json | -| [accessReviewInstanceStopSample.js][accessreviewinstancestopsample] | An action to stop an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json | -| [accessReviewInstancesAssignedForMyApprovalGetByIdSample.js][accessreviewinstancesassignedformyapprovalgetbyidsample] | Get single access review instance assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json | -| [accessReviewInstancesAssignedForMyApprovalListSample.js][accessreviewinstancesassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json | -| [accessReviewInstancesCreateSample.js][accessreviewinstancescreatesample] | Update access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json | -| [accessReviewInstancesGetByIdSample.js][accessreviewinstancesgetbyidsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json | -| [accessReviewInstancesListSample.js][accessreviewinstanceslistsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json | -| [accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js][accessreviewscheduledefinitionsassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json | -| [accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js][accessreviewscheduledefinitionscreateorupdatebyidsample] | Create or Update access review schedule definition. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json | -| [accessReviewScheduleDefinitionsDeleteByIdSample.js][accessreviewscheduledefinitionsdeletebyidsample] | Delete access review schedule definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json | -| [accessReviewScheduleDefinitionsGetByIdSample.js][accessreviewscheduledefinitionsgetbyidsample] | Get single access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json | -| [accessReviewScheduleDefinitionsListSample.js][accessreviewscheduledefinitionslistsample] | Get access review schedule definitions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json | -| [accessReviewScheduleDefinitionsStopSample.js][accessreviewscheduledefinitionsstopsample] | Stop access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json | -| [eligibleChildResourcesGetSample.js][eligiblechildresourcesgetsample] | Get the child resources of a resource on which user has eligible access x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json | -| [roleAssignmentScheduleInstancesGetSample.js][roleassignmentscheduleinstancesgetsample] | Gets the specified role assignment schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json | -| [roleAssignmentScheduleInstancesListForScopeSample.js][roleassignmentscheduleinstanceslistforscopesample] | Gets role assignment schedule instances of a role assignment schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json | -| [roleAssignmentScheduleRequestsCancelSample.js][roleassignmentschedulerequestscancelsample] | Cancels a pending role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json | -| [roleAssignmentScheduleRequestsCreateSample.js][roleassignmentschedulerequestscreatesample] | Creates a role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json | -| [roleAssignmentScheduleRequestsGetSample.js][roleassignmentschedulerequestsgetsample] | Get the specified role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json | -| [roleAssignmentScheduleRequestsListForScopeSample.js][roleassignmentschedulerequestslistforscopesample] | Gets role assignment schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json | -| [roleAssignmentScheduleRequestsValidateSample.js][roleassignmentschedulerequestsvalidatesample] | Validates a new role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json | -| [roleAssignmentSchedulesGetSample.js][roleassignmentschedulesgetsample] | Get the specified role assignment schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json | -| [roleAssignmentSchedulesListForScopeSample.js][roleassignmentscheduleslistforscopesample] | Gets role assignment schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json | -| [roleEligibilityScheduleInstancesGetSample.js][roleeligibilityscheduleinstancesgetsample] | Gets the specified role eligibility schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json | -| [roleEligibilityScheduleInstancesListForScopeSample.js][roleeligibilityscheduleinstanceslistforscopesample] | Gets role eligibility schedule instances of a role eligibility schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json | -| [roleEligibilityScheduleRequestsCancelSample.js][roleeligibilityschedulerequestscancelsample] | Cancels a pending role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json | -| [roleEligibilityScheduleRequestsCreateSample.js][roleeligibilityschedulerequestscreatesample] | Creates a role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json | -| [roleEligibilityScheduleRequestsGetSample.js][roleeligibilityschedulerequestsgetsample] | Get the specified role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json | -| [roleEligibilityScheduleRequestsListForScopeSample.js][roleeligibilityschedulerequestslistforscopesample] | Gets role eligibility schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json | -| [roleEligibilityScheduleRequestsValidateSample.js][roleeligibilityschedulerequestsvalidatesample] | Validates a new role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json | -| [roleEligibilitySchedulesGetSample.js][roleeligibilityschedulesgetsample] | Get the specified role eligibility schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json | -| [roleEligibilitySchedulesListForScopeSample.js][roleeligibilityscheduleslistforscopesample] | Gets role eligibility schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json | -| [roleManagementPoliciesDeleteSample.js][rolemanagementpoliciesdeletesample] | Delete a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json | -| [roleManagementPoliciesGetSample.js][rolemanagementpoliciesgetsample] | Get the specified role management policy for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json | -| [roleManagementPoliciesListForScopeSample.js][rolemanagementpolicieslistforscopesample] | Gets role management policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json | -| [roleManagementPoliciesUpdateSample.js][rolemanagementpoliciesupdatesample] | Update a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json | -| [roleManagementPolicyAssignmentsCreateSample.js][rolemanagementpolicyassignmentscreatesample] | Create a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json | -| [roleManagementPolicyAssignmentsDeleteSample.js][rolemanagementpolicyassignmentsdeletesample] | Delete a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json | -| [roleManagementPolicyAssignmentsGetSample.js][rolemanagementpolicyassignmentsgetsample] | Get the specified role management policy assignment for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json | -| [roleManagementPolicyAssignmentsListForScopeSample.js][rolemanagementpolicyassignmentslistforscopesample] | Gets role management assignment policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json | -| [tenantLevelAccessReviewInstanceContactedReviewersListSample.js][tenantlevelaccessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [eligibleChildResourcesGetSample.js][eligiblechildresourcesgetsample] | Get the child resources of a resource on which user has eligible access x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json | +| [roleAssignmentScheduleInstancesGetSample.js][roleassignmentscheduleinstancesgetsample] | Gets the specified role assignment schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json | +| [roleAssignmentScheduleInstancesListForScopeSample.js][roleassignmentscheduleinstanceslistforscopesample] | Gets role assignment schedule instances of a role assignment schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json | +| [roleAssignmentScheduleRequestsCancelSample.js][roleassignmentschedulerequestscancelsample] | Cancels a pending role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsCreateSample.js][roleassignmentschedulerequestscreatesample] | Creates a role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json | +| [roleAssignmentScheduleRequestsGetSample.js][roleassignmentschedulerequestsgetsample] | Get the specified role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsListForScopeSample.js][roleassignmentschedulerequestslistforscopesample] | Gets role assignment schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json | +| [roleAssignmentScheduleRequestsValidateSample.js][roleassignmentschedulerequestsvalidatesample] | Validates a new role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentSchedulesGetSample.js][roleassignmentschedulesgetsample] | Get the specified role assignment schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json | +| [roleAssignmentSchedulesListForScopeSample.js][roleassignmentscheduleslistforscopesample] | Gets role assignment schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json | +| [roleEligibilityScheduleInstancesGetSample.js][roleeligibilityscheduleinstancesgetsample] | Gets the specified role eligibility schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json | +| [roleEligibilityScheduleInstancesListForScopeSample.js][roleeligibilityscheduleinstanceslistforscopesample] | Gets role eligibility schedule instances of a role eligibility schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json | +| [roleEligibilityScheduleRequestsCancelSample.js][roleeligibilityschedulerequestscancelsample] | Cancels a pending role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsCreateSample.js][roleeligibilityschedulerequestscreatesample] | Creates a role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json | +| [roleEligibilityScheduleRequestsGetSample.js][roleeligibilityschedulerequestsgetsample] | Get the specified role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsListForScopeSample.js][roleeligibilityschedulerequestslistforscopesample] | Gets role eligibility schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json | +| [roleEligibilityScheduleRequestsValidateSample.js][roleeligibilityschedulerequestsvalidatesample] | Validates a new role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json | +| [roleEligibilitySchedulesGetSample.js][roleeligibilityschedulesgetsample] | Get the specified role eligibility schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json | +| [roleEligibilitySchedulesListForScopeSample.js][roleeligibilityscheduleslistforscopesample] | Gets role eligibility schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json | +| [roleManagementPoliciesDeleteSample.js][rolemanagementpoliciesdeletesample] | Delete a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json | +| [roleManagementPoliciesGetSample.js][rolemanagementpoliciesgetsample] | Get the specified role management policy for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json | +| [roleManagementPoliciesListForScopeSample.js][rolemanagementpolicieslistforscopesample] | Gets role management policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json | +| [roleManagementPoliciesUpdateSample.js][rolemanagementpoliciesupdatesample] | Update a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json | +| [roleManagementPolicyAssignmentsCreateSample.js][rolemanagementpolicyassignmentscreatesample] | Create a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsDeleteSample.js][rolemanagementpolicyassignmentsdeletesample] | Delete a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsGetSample.js][rolemanagementpolicyassignmentsgetsample] | Get the specified role management policy assignment for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json | +| [roleManagementPolicyAssignmentsListForScopeSample.js][rolemanagementpolicyassignmentslistforscopesample] | Gets role management assignment policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json | ## Prerequisites @@ -87,48 +57,19 @@ npm install 3. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node accessReviewDefaultSettingsGetSample.js +node eligibleChildResourcesGetSample.js ``` Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env node accessReviewDefaultSettingsGetSample.js +npx cross-env node eligibleChildResourcesGetSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[accessreviewdefaultsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js -[accessreviewdefaultsettingsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js -[accessreviewhistorydefinitioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js -[accessreviewhistorydefinitiondeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js -[accessreviewhistorydefinitioninstancegeneratedownloadurisample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js -[accessreviewhistorydefinitioninstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js -[accessreviewhistorydefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js -[accessreviewhistorydefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js -[accessreviewinstanceacceptrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js -[accessreviewinstanceapplydecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js -[accessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js -[accessreviewinstancedecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js -[accessreviewinstancemydecisionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js -[accessreviewinstancemydecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js -[accessreviewinstancemydecisionspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js -[accessreviewinstanceresetdecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js -[accessreviewinstancesendreminderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js -[accessreviewinstancestopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js -[accessreviewinstancesassignedformyapprovalgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js -[accessreviewinstancesassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js -[accessreviewinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js -[accessreviewinstancesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js -[accessreviewinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js -[accessreviewscheduledefinitionsassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js -[accessreviewscheduledefinitionscreateorupdatebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js -[accessreviewscheduledefinitionsdeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js -[accessreviewscheduledefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js -[accessreviewscheduledefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js -[accessreviewscheduledefinitionsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js [eligiblechildresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/eligibleChildResourcesGetSample.js [roleassignmentscheduleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesGetSample.js [roleassignmentscheduleinstanceslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleAssignmentScheduleInstancesListForScopeSample.js @@ -156,7 +97,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [rolemanagementpolicyassignmentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsDeleteSample.js [rolemanagementpolicyassignmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsGetSample.js [rolemanagementpolicyassignmentslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/roleManagementPolicyAssignmentsListForScopeSample.js -[tenantlevelaccessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization/README.md diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js deleted file mode 100644 index 437e973b5245..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review default settings for the subscription - * - * @summary Get access review default settings for the subscription - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json - */ -async function getAccessReviewDefaultSettings() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewDefaultSettingsOperations.get(); - console.log(result); -} - -getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js deleted file mode 100644 index 328137663068..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewDefaultSettingsPutSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review default settings for the subscription - * - * @summary Get access review default settings for the subscription - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json - */ -async function putAccessReviewDefaultSettings() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewDefaultSettingsOperations.put(properties); - console.log(result); -} - -putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js deleted file mode 100644 index 47d0945a787a..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionCreateSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition - * - * @summary Create a scheduled or one-time Access Review History Definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json - */ -async function putAccessReviewHistoryDefinition() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionOperations.create( - historyDefinitionId, - properties - ); - console.log(result); -} - -putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js deleted file mode 100644 index 31d7f1d9def4..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionDeleteByIdSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete an access review history definition - * - * @summary Delete an access review history definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json - */ -async function deleteAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionOperations.deleteById( - historyDefinitionId - ); - console.log(result); -} - -deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js deleted file mode 100644 index 99428ccf9484..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. - * - * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json - */ -async function postAccessReviewHistoryDefinitionInstance() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( - historyDefinitionId, - instanceId - ); - console.log(result); -} - -postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js deleted file mode 100644 index afa7f63bc40d..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionInstancesListSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review history definition instances by definition Id - * - * @summary Get access review history definition instances by definition Id - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json - */ -async function getAccessReviewHistoryDefinitionInstances() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewHistoryDefinitionInstances.list(historyDefinitionId)) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js deleted file mode 100644 index 24c05ee9365a..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsGetByIdSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review history definition by definition Id - * - * @summary Get access review history definition by definition Id - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json - */ -async function getAccessReviewHistoryDefinition() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitions.getById(historyDefinitionId); - console.log(result); -} - -getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js deleted file mode 100644 index cfd1cff632f0..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewHistoryDefinitionsListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. - * - * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json - */ -async function getAccessReviewHistoryDefinitions() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewHistoryDefinitions.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js deleted file mode 100644 index 40fe2002873d..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceAcceptRecommendationsSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. - * - * @summary An action to accept recommendations for decision in an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json - */ -async function accessReviewInstanceAcceptRecommmendations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.acceptRecommendations( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js deleted file mode 100644 index a65e5f50a74c..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceApplyDecisionsSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to An action to apply all decisions for an access review instance. - * - * @summary An action to apply all decisions for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json - */ -async function accessReviewInstanceApplyDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.applyDecisions( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js deleted file mode 100644 index cb4bac464e66..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceContactedReviewersListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instance contacted reviewers - * - * @summary Get access review instance contacted reviewers - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json - */ -async function getAccessReviewInstanceContactedReviewers() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceContactedReviewers.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js deleted file mode 100644 index b06023f255eb..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceDecisionsListSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instance decisions - * - * @summary Get access review instance decisions - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json - */ -async function getAccessReviewInstanceDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceDecisions.list(scheduleDefinitionId, id)) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js deleted file mode 100644 index 9ff10fba3052..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsGetByIdSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get my single access review instance decision. - * - * @summary Get my single access review instance decision. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json - */ -async function getAccessReviewMyInstanceDecision() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceMyDecisions.getById( - scheduleDefinitionId, - id, - decisionId - ); - console.log(result); -} - -getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js deleted file mode 100644 index 0fa6e02855cc..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsListSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get my access review instance decisions. - * - * @summary Get my access review instance decisions. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json - */ -async function getAccessReviewMyInstanceDecisions() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceMyDecisions.list(scheduleDefinitionId, id)) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js deleted file mode 100644 index 892803d312f3..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceMyDecisionsPatchSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Record a decision. - * - * @summary Record a decision. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json - */ -async function patchAccessReviewMyInstanceDecision() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceMyDecisions.patch( - scheduleDefinitionId, - id, - decisionId, - properties - ); - console.log(result); -} - -patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js deleted file mode 100644 index bb479705e39d..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceResetDecisionsSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to An action to reset all decisions for an access review instance. - * - * @summary An action to reset all decisions for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json - */ -async function accessReviewInstanceResetDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.resetDecisions( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js deleted file mode 100644 index 9322ea16133e..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceSendRemindersSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to An action to send reminders for an access review instance. - * - * @summary An action to send reminders for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json - */ -async function accessReviewInstanceSendReminders() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.sendReminders( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js deleted file mode 100644 index d4f7e2f2de99..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstanceStopSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to An action to stop an access review instance. - * - * @summary An action to stop an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json - */ -async function accessReviewInstanceStop() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.stop(scheduleDefinitionId, id); - console.log(result); -} - -accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js deleted file mode 100644 index a457f3dc96d9..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalGetByIdSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get single access review instance assigned for my approval. - * - * @summary Get single access review instance assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json - */ -async function getAccessReviewInstanceAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstancesAssignedForMyApproval.getById( - scheduleDefinitionId, - id - ); - console.log(result); -} - -getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js deleted file mode 100644 index be77084d4eac..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesAssignedForMyApprovalListSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instances assigned for my approval. - * - * @summary Get access review instances assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json - */ -async function getAccessReviewInstancesAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const filter = "assignedToMeToReview()"; - const options = { - filter, - }; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( - scheduleDefinitionId, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js deleted file mode 100644 index a9fc9ab35c72..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesCreateSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Update access review instance. - * - * @summary Update access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json - */ -async function putAccessReviewInstance() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstances.create(scheduleDefinitionId, id, properties); - console.log(result); -} - -putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js deleted file mode 100644 index a724efdfb14d..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesGetByIdSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instances - * - * @summary Get access review instances - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json - */ -async function getAccessReviewInstance() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstances.getById(scheduleDefinitionId, id); - console.log(result); -} - -getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js deleted file mode 100644 index 9e7e3ce95e9e..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewInstancesListSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instances - * - * @summary Get access review instances - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json - */ -async function getAccessReviewInstances() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstances.list(scheduleDefinitionId)) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js deleted file mode 100644 index 1cf350db0a64..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instances assigned for my approval. - * - * @summary Get access review instances assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json - */ -async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = "assignedToMeToReview()"; - const options = { - filter, - }; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js deleted file mode 100644 index 67a7c7e0f161..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create or Update access review schedule definition. - * - * @summary Create or Update access review schedule definition. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json - */ -async function putAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( - scheduleDefinitionId, - properties - ); - console.log(result); -} - -putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js deleted file mode 100644 index 53302485e016..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsDeleteByIdSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Delete access review schedule definition - * - * @summary Delete access review schedule definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json - */ -async function deleteAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.deleteById(scheduleDefinitionId); - console.log(result); -} - -deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js deleted file mode 100644 index 3676eb7ecddf..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsGetByIdSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get single access review definition - * - * @summary Get single access review definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json - */ -async function getAccessReviewScheduleDefinition() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.getById(scheduleDefinitionId); - console.log(result); -} - -getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js deleted file mode 100644 index b0d05478528b..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review schedule definitions - * - * @summary Get access review schedule definitions - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json - */ -async function getAccessReviewScheduleDefinitions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewScheduleDefinitions.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js deleted file mode 100644 index 90425be030c9..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/accessReviewScheduleDefinitionsStopSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Stop access review definition - * - * @summary Stop access review definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json - */ -async function accessReviewScheduleDefinitionStop() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.stop(scheduleDefinitionId); - console.log(result); -} - -accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js b/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js deleted file mode 100644 index 3048638696df..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/javascript/tenantLevelAccessReviewInstanceContactedReviewersListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AuthorizationManagementClient } = require("@azure/arm-authorization"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get access review instance contacted reviewers - * - * @summary Get access review instance contacted reviewers - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json - */ -async function tenantLevelGetAccessReviewInstanceContactedReviewers() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/README.md b/sdk/authorization/arm-authorization/samples/v9/typescript/README.md index 4f3924d07576..2af45674778c 100644 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/README.md +++ b/sdk/authorization/arm-authorization/samples/v9/typescript/README.md @@ -2,65 +2,35 @@ These sample programs show how to use the TypeScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accessReviewDefaultSettingsGetSample.ts][accessreviewdefaultsettingsgetsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json | -| [accessReviewDefaultSettingsPutSample.ts][accessreviewdefaultsettingsputsample] | Get access review default settings for the subscription x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json | -| [accessReviewHistoryDefinitionCreateSample.ts][accessreviewhistorydefinitioncreatesample] | Create a scheduled or one-time Access Review History Definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json | -| [accessReviewHistoryDefinitionDeleteByIdSample.ts][accessreviewhistorydefinitiondeletebyidsample] | Delete an access review history definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json | -| [accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts][accessreviewhistorydefinitioninstancegeneratedownloadurisample] | Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json | -| [accessReviewHistoryDefinitionInstancesListSample.ts][accessreviewhistorydefinitioninstanceslistsample] | Get access review history definition instances by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json | -| [accessReviewHistoryDefinitionsGetByIdSample.ts][accessreviewhistorydefinitionsgetbyidsample] | Get access review history definition by definition Id x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json | -| [accessReviewHistoryDefinitionsListSample.ts][accessreviewhistorydefinitionslistsample] | Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json | -| [accessReviewInstanceAcceptRecommendationsSample.ts][accessreviewinstanceacceptrecommendationssample] | An action to accept recommendations for decision in an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json | -| [accessReviewInstanceApplyDecisionsSample.ts][accessreviewinstanceapplydecisionssample] | An action to apply all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json | -| [accessReviewInstanceContactedReviewersListSample.ts][accessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json | -| [accessReviewInstanceDecisionsListSample.ts][accessreviewinstancedecisionslistsample] | Get access review instance decisions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json | -| [accessReviewInstanceMyDecisionsGetByIdSample.ts][accessreviewinstancemydecisionsgetbyidsample] | Get my single access review instance decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json | -| [accessReviewInstanceMyDecisionsListSample.ts][accessreviewinstancemydecisionslistsample] | Get my access review instance decisions. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json | -| [accessReviewInstanceMyDecisionsPatchSample.ts][accessreviewinstancemydecisionspatchsample] | Record a decision. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json | -| [accessReviewInstanceResetDecisionsSample.ts][accessreviewinstanceresetdecisionssample] | An action to reset all decisions for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json | -| [accessReviewInstanceSendRemindersSample.ts][accessreviewinstancesendreminderssample] | An action to send reminders for an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json | -| [accessReviewInstanceStopSample.ts][accessreviewinstancestopsample] | An action to stop an access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json | -| [accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts][accessreviewinstancesassignedformyapprovalgetbyidsample] | Get single access review instance assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json | -| [accessReviewInstancesAssignedForMyApprovalListSample.ts][accessreviewinstancesassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json | -| [accessReviewInstancesCreateSample.ts][accessreviewinstancescreatesample] | Update access review instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json | -| [accessReviewInstancesGetByIdSample.ts][accessreviewinstancesgetbyidsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json | -| [accessReviewInstancesListSample.ts][accessreviewinstanceslistsample] | Get access review instances x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json | -| [accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts][accessreviewscheduledefinitionsassignedformyapprovallistsample] | Get access review instances assigned for my approval. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json | -| [accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts][accessreviewscheduledefinitionscreateorupdatebyidsample] | Create or Update access review schedule definition. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json | -| [accessReviewScheduleDefinitionsDeleteByIdSample.ts][accessreviewscheduledefinitionsdeletebyidsample] | Delete access review schedule definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json | -| [accessReviewScheduleDefinitionsGetByIdSample.ts][accessreviewscheduledefinitionsgetbyidsample] | Get single access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json | -| [accessReviewScheduleDefinitionsListSample.ts][accessreviewscheduledefinitionslistsample] | Get access review schedule definitions x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json | -| [accessReviewScheduleDefinitionsStopSample.ts][accessreviewscheduledefinitionsstopsample] | Stop access review definition x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json | -| [eligibleChildResourcesGetSample.ts][eligiblechildresourcesgetsample] | Get the child resources of a resource on which user has eligible access x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json | -| [roleAssignmentScheduleInstancesGetSample.ts][roleassignmentscheduleinstancesgetsample] | Gets the specified role assignment schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json | -| [roleAssignmentScheduleInstancesListForScopeSample.ts][roleassignmentscheduleinstanceslistforscopesample] | Gets role assignment schedule instances of a role assignment schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json | -| [roleAssignmentScheduleRequestsCancelSample.ts][roleassignmentschedulerequestscancelsample] | Cancels a pending role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json | -| [roleAssignmentScheduleRequestsCreateSample.ts][roleassignmentschedulerequestscreatesample] | Creates a role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json | -| [roleAssignmentScheduleRequestsGetSample.ts][roleassignmentschedulerequestsgetsample] | Get the specified role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json | -| [roleAssignmentScheduleRequestsListForScopeSample.ts][roleassignmentschedulerequestslistforscopesample] | Gets role assignment schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json | -| [roleAssignmentScheduleRequestsValidateSample.ts][roleassignmentschedulerequestsvalidatesample] | Validates a new role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json | -| [roleAssignmentSchedulesGetSample.ts][roleassignmentschedulesgetsample] | Get the specified role assignment schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json | -| [roleAssignmentSchedulesListForScopeSample.ts][roleassignmentscheduleslistforscopesample] | Gets role assignment schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json | -| [roleEligibilityScheduleInstancesGetSample.ts][roleeligibilityscheduleinstancesgetsample] | Gets the specified role eligibility schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json | -| [roleEligibilityScheduleInstancesListForScopeSample.ts][roleeligibilityscheduleinstanceslistforscopesample] | Gets role eligibility schedule instances of a role eligibility schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json | -| [roleEligibilityScheduleRequestsCancelSample.ts][roleeligibilityschedulerequestscancelsample] | Cancels a pending role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json | -| [roleEligibilityScheduleRequestsCreateSample.ts][roleeligibilityschedulerequestscreatesample] | Creates a role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json | -| [roleEligibilityScheduleRequestsGetSample.ts][roleeligibilityschedulerequestsgetsample] | Get the specified role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json | -| [roleEligibilityScheduleRequestsListForScopeSample.ts][roleeligibilityschedulerequestslistforscopesample] | Gets role eligibility schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json | -| [roleEligibilityScheduleRequestsValidateSample.ts][roleeligibilityschedulerequestsvalidatesample] | Validates a new role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json | -| [roleEligibilitySchedulesGetSample.ts][roleeligibilityschedulesgetsample] | Get the specified role eligibility schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json | -| [roleEligibilitySchedulesListForScopeSample.ts][roleeligibilityscheduleslistforscopesample] | Gets role eligibility schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json | -| [roleManagementPoliciesDeleteSample.ts][rolemanagementpoliciesdeletesample] | Delete a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json | -| [roleManagementPoliciesGetSample.ts][rolemanagementpoliciesgetsample] | Get the specified role management policy for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json | -| [roleManagementPoliciesListForScopeSample.ts][rolemanagementpolicieslistforscopesample] | Gets role management policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json | -| [roleManagementPoliciesUpdateSample.ts][rolemanagementpoliciesupdatesample] | Update a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json | -| [roleManagementPolicyAssignmentsCreateSample.ts][rolemanagementpolicyassignmentscreatesample] | Create a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json | -| [roleManagementPolicyAssignmentsDeleteSample.ts][rolemanagementpolicyassignmentsdeletesample] | Delete a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json | -| [roleManagementPolicyAssignmentsGetSample.ts][rolemanagementpolicyassignmentsgetsample] | Get the specified role management policy assignment for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json | -| [roleManagementPolicyAssignmentsListForScopeSample.ts][rolemanagementpolicyassignmentslistforscopesample] | Gets role management assignment policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json | -| [tenantLevelAccessReviewInstanceContactedReviewersListSample.ts][tenantlevelaccessreviewinstancecontactedreviewerslistsample] | Get access review instance contacted reviewers x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json | +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [eligibleChildResourcesGetSample.ts][eligiblechildresourcesgetsample] | Get the child resources of a resource on which user has eligible access x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json | +| [roleAssignmentScheduleInstancesGetSample.ts][roleassignmentscheduleinstancesgetsample] | Gets the specified role assignment schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstanceByName.json | +| [roleAssignmentScheduleInstancesListForScopeSample.ts][roleassignmentscheduleinstanceslistforscopesample] | Gets role assignment schedule instances of a role assignment schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleInstancesByScope.json | +| [roleAssignmentScheduleRequestsCancelSample.ts][roleassignmentschedulerequestscancelsample] | Cancels a pending role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsCreateSample.ts][roleassignmentschedulerequestscreatesample] | Creates a role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleAssignmentScheduleRequest.json | +| [roleAssignmentScheduleRequestsGetSample.ts][roleassignmentschedulerequestsgetsample] | Get the specified role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentScheduleRequestsListForScopeSample.ts][roleassignmentschedulerequestslistforscopesample] | Gets role assignment schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleRequestByScope.json | +| [roleAssignmentScheduleRequestsValidateSample.ts][roleassignmentschedulerequestsvalidatesample] | Validates a new role assignment schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleAssignmentScheduleRequestByName.json | +| [roleAssignmentSchedulesGetSample.ts][roleassignmentschedulesgetsample] | Get the specified role assignment schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentScheduleByName.json | +| [roleAssignmentSchedulesListForScopeSample.ts][roleassignmentscheduleslistforscopesample] | Gets role assignment schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleAssignmentSchedulesByScope.json | +| [roleEligibilityScheduleInstancesGetSample.ts][roleeligibilityscheduleinstancesgetsample] | Gets the specified role eligibility schedule instance. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstanceByName.json | +| [roleEligibilityScheduleInstancesListForScopeSample.ts][roleeligibilityscheduleinstanceslistforscopesample] | Gets role eligibility schedule instances of a role eligibility schedule. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleInstancesByScope.json | +| [roleEligibilityScheduleRequestsCancelSample.ts][roleeligibilityschedulerequestscancelsample] | Cancels a pending role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/CancelRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsCreateSample.ts][roleeligibilityschedulerequestscreatesample] | Creates a role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleEligibilityScheduleRequest.json | +| [roleEligibilityScheduleRequestsGetSample.ts][roleeligibilityschedulerequestsgetsample] | Get the specified role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByName.json | +| [roleEligibilityScheduleRequestsListForScopeSample.ts][roleeligibilityschedulerequestslistforscopesample] | Gets role eligibility schedule requests for a scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleRequestByScope.json | +| [roleEligibilityScheduleRequestsValidateSample.ts][roleeligibilityschedulerequestsvalidatesample] | Validates a new role eligibility schedule request. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/ValidateRoleEligibilityScheduleRequestByName.json | +| [roleEligibilitySchedulesGetSample.ts][roleeligibilityschedulesgetsample] | Get the specified role eligibility schedule for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilityScheduleByName.json | +| [roleEligibilitySchedulesListForScopeSample.ts][roleeligibilityscheduleslistforscopesample] | Gets role eligibility schedules for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleEligibilitySchedulesByScope.json | +| [roleManagementPoliciesDeleteSample.ts][rolemanagementpoliciesdeletesample] | Delete a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicy.json | +| [roleManagementPoliciesGetSample.ts][rolemanagementpoliciesgetsample] | Get the specified role management policy for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByName.json | +| [roleManagementPoliciesListForScopeSample.ts][rolemanagementpolicieslistforscopesample] | Gets role management policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyByScope.json | +| [roleManagementPoliciesUpdateSample.ts][rolemanagementpoliciesupdatesample] | Update a role management policy x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PatchPartialRoleManagementPolicy.json | +| [roleManagementPolicyAssignmentsCreateSample.ts][rolemanagementpolicyassignmentscreatesample] | Create a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/PutRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsDeleteSample.ts][rolemanagementpolicyassignmentsdeletesample] | Delete a role management policy assignment x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json | +| [roleManagementPolicyAssignmentsGetSample.ts][rolemanagementpolicyassignmentsgetsample] | Get the specified role management policy assignment for a resource scope x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByName.json | +| [roleManagementPolicyAssignmentsListForScopeSample.ts][rolemanagementpolicyassignmentslistforscopesample] | Gets role management assignment policies for a resource scope. x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetRoleManagementPolicyAssignmentByScope.json | ## Prerequisites @@ -99,48 +69,19 @@ npm run build 4. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node dist/accessReviewDefaultSettingsGetSample.js +node dist/eligibleChildResourcesGetSample.js ``` Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env node dist/accessReviewDefaultSettingsGetSample.js +npx cross-env node dist/eligibleChildResourcesGetSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[accessreviewdefaultsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts -[accessreviewdefaultsettingsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts -[accessreviewhistorydefinitioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts -[accessreviewhistorydefinitiondeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts -[accessreviewhistorydefinitioninstancegeneratedownloadurisample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts -[accessreviewhistorydefinitioninstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts -[accessreviewhistorydefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts -[accessreviewhistorydefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts -[accessreviewinstanceacceptrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts -[accessreviewinstanceapplydecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts -[accessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts -[accessreviewinstancedecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts -[accessreviewinstancemydecisionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts -[accessreviewinstancemydecisionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts -[accessreviewinstancemydecisionspatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts -[accessreviewinstanceresetdecisionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts -[accessreviewinstancesendreminderssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts -[accessreviewinstancestopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts -[accessreviewinstancesassignedformyapprovalgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts -[accessreviewinstancesassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts -[accessreviewinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts -[accessreviewinstancesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts -[accessreviewinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts -[accessreviewscheduledefinitionsassignedformyapprovallistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts -[accessreviewscheduledefinitionscreateorupdatebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts -[accessreviewscheduledefinitionsdeletebyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts -[accessreviewscheduledefinitionsgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts -[accessreviewscheduledefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts -[accessreviewscheduledefinitionsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts [eligiblechildresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/eligibleChildResourcesGetSample.ts [roleassignmentscheduleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesGetSample.ts [roleassignmentscheduleinstanceslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleAssignmentScheduleInstancesListForScopeSample.ts @@ -168,7 +109,6 @@ Take a look at our [API Documentation][apiref] for more information about the AP [rolemanagementpolicyassignmentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsDeleteSample.ts [rolemanagementpolicyassignmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsGetSample.ts [rolemanagementpolicyassignmentslistforscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/roleManagementPolicyAssignmentsListForScopeSample.ts -[tenantlevelaccessreviewinstancecontactedreviewerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-authorization?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/authorization/arm-authorization/README.md diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts deleted file mode 100644 index a0b0a43a56de..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsGetSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review default settings for the subscription - * - * @summary Get access review default settings for the subscription - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewDefaultSettings.json - */ -async function getAccessReviewDefaultSettings() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewDefaultSettingsOperations.get(); - console.log(result); -} - -getAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts deleted file mode 100644 index 50cedccdcf86..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewDefaultSettingsPutSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewScheduleSettings, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review default settings for the subscription - * - * @summary Get access review default settings for the subscription - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewDefaultSettings.json - */ -async function putAccessReviewDefaultSettings() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties: AccessReviewScheduleSettings = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewDefaultSettingsOperations.put( - properties - ); - console.log(result); -} - -putAccessReviewDefaultSettings().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts deleted file mode 100644 index e39c7cb0970e..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionCreateSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewHistoryDefinitionProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a scheduled or one-time Access Review History Definition - * - * @summary Create a scheduled or one-time Access Review History Definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewHistoryDefinition.json - */ -async function putAccessReviewHistoryDefinition() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const properties: AccessReviewHistoryDefinitionProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionOperations.create( - historyDefinitionId, - properties - ); - console.log(result); -} - -putAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts deleted file mode 100644 index 69fa585d77b7..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionDeleteByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete an access review history definition - * - * @summary Delete an access review history definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewHistoryDefinition.json - */ -async function deleteAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const historyDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionOperations.deleteById( - historyDefinitionId - ); - console.log(result); -} - -deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts deleted file mode 100644 index cc30aaaef9c2..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstanceGenerateDownloadUriSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. - * - * @summary Generates a uri which can be used to retrieve review history data. This URI has a TTL of 1 day and can be retrieved by fetching the accessReviewHistoryDefinition object. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PostAccessReviewHistoryDefinitionInstance.json - */ -async function postAccessReviewHistoryDefinitionInstance() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const instanceId = "9038f4f3-3d8d-43c3-8ede-669ea082c43b"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitionInstance.generateDownloadUri( - historyDefinitionId, - instanceId - ); - console.log(result); -} - -postAccessReviewHistoryDefinitionInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts deleted file mode 100644 index f58b44160d78..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionInstancesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review history definition instances by definition Id - * - * @summary Get access review history definition instances by definition Id - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitionInstances.json - */ -async function getAccessReviewHistoryDefinitionInstances() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewHistoryDefinitionInstances.list( - historyDefinitionId - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewHistoryDefinitionInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts deleted file mode 100644 index b3ac5f469101..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsGetByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review history definition by definition Id - * - * @summary Get access review history definition by definition Id - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinition.json - */ -async function getAccessReviewHistoryDefinition() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const historyDefinitionId = "44724910-d7a5-4c29-b28f-db73e717165a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewHistoryDefinitions.getById( - historyDefinitionId - ); - console.log(result); -} - -getAccessReviewHistoryDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts deleted file mode 100644 index de8ee5a79dbe..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewHistoryDefinitionsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. - * - * @summary Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available for 30 days after creation. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewHistoryDefinitions.json - */ -async function getAccessReviewHistoryDefinitions() { - const subscriptionId = "129a304b-4aea-4b86-a9f7-ba7e2b23737a"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewHistoryDefinitions.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewHistoryDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts deleted file mode 100644 index e881a9757421..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceAcceptRecommendationsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to accept recommendations for decision in an access review instance. - * - * @summary An action to accept recommendations for decision in an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceAcceptRecommendations.json - */ -async function accessReviewInstanceAcceptRecommmendations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.acceptRecommendations( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceAcceptRecommmendations().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts deleted file mode 100644 index 8ee8addf9757..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceApplyDecisionsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to apply all decisions for an access review instance. - * - * @summary An action to apply all decisions for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceApplyDecisions.json - */ -async function accessReviewInstanceApplyDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.applyDecisions( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceApplyDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts deleted file mode 100644 index f5545dce25cb..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceContactedReviewersListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instance contacted reviewers - * - * @summary Get access review instance contacted reviewers - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceContactedReviewers.json - */ -async function getAccessReviewInstanceContactedReviewers() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceContactedReviewers.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstanceContactedReviewers().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts deleted file mode 100644 index d308e1577a91..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceDecisionsListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instance decisions - * - * @summary Get access review instance decisions - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceDecisions.json - */ -async function getAccessReviewInstanceDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceDecisions.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts deleted file mode 100644 index 098083ac906b..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsGetByIdSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get my single access review instance decision. - * - * @summary Get my single access review instance decision. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisionById.json - */ -async function getAccessReviewMyInstanceDecision() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceMyDecisions.getById( - scheduleDefinitionId, - id, - decisionId - ); - console.log(result); -} - -getAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts deleted file mode 100644 index b1e50fddef13..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get my access review instance decisions. - * - * @summary Get my access review instance decisions. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceMyDecisions.json - */ -async function getAccessReviewMyInstanceDecisions() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstanceMyDecisions.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewMyInstanceDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts deleted file mode 100644 index de192912a02f..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceMyDecisionsPatchSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewDecisionProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Record a decision. - * - * @summary Record a decision. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PatchAccessReviewInstanceMyDecisionById.json - */ -async function patchAccessReviewMyInstanceDecision() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const decisionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties: AccessReviewDecisionProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceMyDecisions.patch( - scheduleDefinitionId, - id, - decisionId, - properties - ); - console.log(result); -} - -patchAccessReviewMyInstanceDecision().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts deleted file mode 100644 index 4e3d76961b8d..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceResetDecisionsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to reset all decisions for an access review instance. - * - * @summary An action to reset all decisions for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceResetDecisions.json - */ -async function accessReviewInstanceResetDecisions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.resetDecisions( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceResetDecisions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts deleted file mode 100644 index 11ddd932ee2d..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceSendRemindersSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to send reminders for an access review instance. - * - * @summary An action to send reminders for an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/AccessReviewInstanceSendReminders.json - */ -async function accessReviewInstanceSendReminders() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.sendReminders( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceSendReminders().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts deleted file mode 100644 index 815e5afc5b27..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstanceStopSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to An action to stop an access review instance. - * - * @summary An action to stop an access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewInstance.json - */ -async function accessReviewInstanceStop() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "d9b9e056-7004-470b-bf21-1635e98487da"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstanceOperations.stop( - scheduleDefinitionId, - id - ); - console.log(result); -} - -accessReviewInstanceStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts deleted file mode 100644 index 471034e44cfd..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalGetByIdSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get single access review instance assigned for my approval. - * - * @summary Get single access review instance assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json - */ -async function getAccessReviewInstanceAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstancesAssignedForMyApproval.getById( - scheduleDefinitionId, - id - ); - console.log(result); -} - -getAccessReviewInstanceAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts deleted file mode 100644 index c4e9d9a65597..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesAssignedForMyApprovalListSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewInstancesAssignedForMyApprovalListOptionalParams, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances assigned for my approval. - * - * @summary Get access review instances assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json - */ -async function getAccessReviewInstancesAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "488a6d0e-0a63-4946-86e3-1f5bbc934661"; - const filter = "assignedToMeToReview()"; - const options: AccessReviewInstancesAssignedForMyApprovalListOptionalParams = { - filter - }; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstancesAssignedForMyApproval.list( - scheduleDefinitionId, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstancesAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts deleted file mode 100644 index 87d00acf9361..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesCreateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewInstanceProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Update access review instance. - * - * @summary Update access review instance. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewInstance.json - */ -async function putAccessReviewInstance() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const properties: AccessReviewInstanceProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstances.create( - scheduleDefinitionId, - id, - properties - ); - console.log(result); -} - -putAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts deleted file mode 100644 index 6ccfa758845e..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesGetByIdSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances - * - * @summary Get access review instances - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstance.json - */ -async function getAccessReviewInstance() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const id = "4135f961-be78-4005-8101-c72a5af307a2"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewInstances.getById( - scheduleDefinitionId, - id - ); - console.log(result); -} - -getAccessReviewInstance().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts deleted file mode 100644 index 5b8b8fb65158..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewInstancesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances - * - * @summary Get access review instances - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewInstances.json - */ -async function getAccessReviewInstances() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewInstances.list( - scheduleDefinitionId - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewInstances().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts deleted file mode 100644 index 30af9e3d7312..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsAssignedForMyApprovalListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instances assigned for my approval. - * - * @summary Get access review instances assigned for my approval. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json - */ -async function getAccessReviewScheduleDefinitionsAssignedForMyApproval() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const filter = "assignedToMeToReview()"; - const options: AccessReviewScheduleDefinitionsAssignedForMyApprovalListOptionalParams = { - filter - }; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewScheduleDefinitionsAssignedForMyApproval.list( - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewScheduleDefinitionsAssignedForMyApproval().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts deleted file mode 100644 index d6be116ded62..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsCreateOrUpdateByIdSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccessReviewScheduleDefinitionProperties, - AuthorizationManagementClient -} from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create or Update access review schedule definition. - * - * @summary Create or Update access review schedule definition. - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/PutAccessReviewScheduleDefinition.json - */ -async function putAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const properties: AccessReviewScheduleDefinitionProperties = {}; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.createOrUpdateById( - scheduleDefinitionId, - properties - ); - console.log(result); -} - -putAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts deleted file mode 100644 index 3b8be5f31b06..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsDeleteByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Delete access review schedule definition - * - * @summary Delete access review schedule definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/DeleteAccessReviewScheduleDefinition.json - */ -async function deleteAccessReview() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.deleteById( - scheduleDefinitionId - ); - console.log(result); -} - -deleteAccessReview().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts deleted file mode 100644 index d6fd1ca463af..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsGetByIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get single access review definition - * - * @summary Get single access review definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinition.json - */ -async function getAccessReviewScheduleDefinition() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.getById( - scheduleDefinitionId - ); - console.log(result); -} - -getAccessReviewScheduleDefinition().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts deleted file mode 100644 index c65d11e35ed1..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review schedule definitions - * - * @summary Get access review schedule definitions - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/GetAccessReviewScheduleDefinitions.json - */ -async function getAccessReviewScheduleDefinitions() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessReviewScheduleDefinitions.list()) { - resArray.push(item); - } - console.log(resArray); -} - -getAccessReviewScheduleDefinitions().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts deleted file mode 100644 index a0c6c4c55e32..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/accessReviewScheduleDefinitionsStopSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Stop access review definition - * - * @summary Stop access review definition - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/StopAccessReviewScheduleDefinition.json - */ -async function accessReviewScheduleDefinitionStop() { - const subscriptionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const scheduleDefinitionId = "fa73e90b-5bf1-45fd-a182-35ce5fc0674d"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const result = await client.accessReviewScheduleDefinitions.stop( - scheduleDefinitionId - ); - console.log(result); -} - -accessReviewScheduleDefinitionStop().catch(console.error); diff --git a/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts b/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts deleted file mode 100644 index 208201a4fc3c..000000000000 --- a/sdk/authorization/arm-authorization/samples/v9/typescript/src/tenantLevelAccessReviewInstanceContactedReviewersListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AuthorizationManagementClient } from "@azure/arm-authorization"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get access review instance contacted reviewers - * - * @summary Get access review instance contacted reviewers - * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-11-16-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json - */ -async function tenantLevelGetAccessReviewInstanceContactedReviewers() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const scheduleDefinitionId = "265785a7-a81f-4201-8a18-bb0db95982b7"; - const id = "f25ed880-9c31-4101-bc57-825d8df3b58c"; - const credential = new DefaultAzureCredential(); - const client = new AuthorizationManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.tenantLevelAccessReviewInstanceContactedReviewers.list( - scheduleDefinitionId, - id - )) { - resArray.push(item); - } - console.log(resArray); -} - -tenantLevelGetAccessReviewInstanceContactedReviewers().catch(console.error);